gcc/libgo/runtime
Ian Lance Taylor 4a2bb7fcb0 compiler, runtime: replace hashmap code with Go 1.7 hashmap
This change removes the gccgo-specific hashmap code and replaces it with
    the hashmap code from the Go 1.7 runtime.  The Go 1.7 hashmap code is
    more efficient, does a better job on details like when to update a key,
    and provides some support against denial-of-service attacks.
    
    The compiler is changed to call the new hashmap functions instead of the
    old ones.
    
    The compiler now tracks which types are reflexive and which require
    updating when used as a map key, and records the information in map type
    descriptors.
    
    Map_index_expression is simplified.  The special case for a map index on
    the right hand side of a tuple expression has been unnecessary for some
    time, and is removed.  The support for specially marking a map index as
    an lvalue is removed, in favor of lowering an assignment to a map index
    into a function call.  The long-obsolete support for a map index of a
    pointer to a map is removed.
    
    The __go_new_map_big function (known to the compiler as
    Runtime::MAKEMAPBIG) is no longer needed, as the new runtime.makemap
    function takes an int64 hint argument.
    
    The old map descriptor type and supporting expression is removed.
    
    The compiler was still supporting the long-obsolete syntax `m[k] = 0,
    false` to delete a value from a map.  That is now removed, requiring a
    change to one of the gccgo-specific tests.
    
    The builtin len function applied to a map or channel p is now compiled
    as `p == nil ? 0 : *(*int)(p)`.  The __go_chan_len function (known to
    the compiler as Runtime::CHAN_LEN) is removed.
    
    Support for a shared zero value for maps to large value types is
    introduced, along the lines of the gc compiler.  The zero value is
    handled as a common variable.
    
    The hash function is changed to take a seed argument, changing the
    runtime hash functions and the compiler-generated hash functions.
    Unlike the gc compiler, both the hash and equal functions continue to
    take the type length.
    
    Types that can not be compared now store nil for the hash and equal
    functions, rather than pointing to functions that throw.  Interface hash
    and comparison functions now check explicitly for nil.  This matches the
    gc compiler and permits a simple implementation for ismapkey.
    
    The compiler is changed to permit marking struct and array types as
    incomparable, meaning that they have no hash or equal function.  We use
    this for thunk types, removing the existing special code to avoid
    generating hash/equal functions for them.
    
    The C runtime code adds memclr, memequal, and memmove functions.
    
    The hashmap code uses go:linkname comments to make the functions
    visible, as otherwise the compiler would discard them.
    
    The hashmap code comments out the unused reference to the address of the
    first parameter in the race code, as otherwise the compiler thinks that
    the parameter escapes and copies it onto the heap.  This is probably not
    needed when we enable escape analysis.
    
    Several runtime map tests that ere previously skipped for gccgo are now
    run.
    
    The Go runtime picks up type kind information and stubs.  The type kind
    information causes the generated runtime header file to define some
    constants, including `empty`, and the C code is adjusted accordingly.
    
    A Go-callable version of runtime.throw, that takes a Go string, is
    added to be called from the hashmap code.
    
    Reviewed-on: https://go-review.googlesource.com/29447

	* go.go-torture/execute/map-1.go: Replace old map deletion syntax
	with call to builtin delete function.

From-SVN: r240334
2016-09-21 20:58:51 +00:00
..
arch.h Update Go library to last weekly. 2011-10-26 23:57:58 +00:00
array.h compiler, runtime: More steps toward separating int and intgo. 2012-11-01 03:02:13 +00:00
chan.goc compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
chan.h libgo: update to go1.7rc3 2016-07-22 18:15:38 +00:00
cpuprof.goc libgo: Update to Go 1.3 release. 2014-07-19 08:53:52 +00:00
defs.h
env_posix.c runtime: Remove now unnecessary pad field from ParFor. 2015-10-31 00:59:47 +00:00
getncpu-bsd.c runtime: support NumCPU() on more platforms Added support for Solaris, Irix, *BSD (including Darwin). 2012-08-07 04:42:49 +00:00
getncpu-irix.c runtime: support NumCPU() on more platforms Added support for Solaris, Irix, *BSD (including Darwin). 2012-08-07 04:42:49 +00:00
getncpu-linux.c runtime: Check for CPU_COUNT itself, don't check glibc version. 2014-10-03 05:04:59 +00:00
getncpu-none.c runtime: support NumCPU() on more platforms Added support for Solaris, Irix, *BSD (including Darwin). 2012-08-07 04:42:49 +00:00
getncpu-solaris.c runtime: support NumCPU() on more platforms Added support for Solaris, Irix, *BSD (including Darwin). 2012-08-07 04:42:49 +00:00
go-alloc.h
go-append.c libgo: Merge to master revision 19184. 2014-06-06 22:37:27 +00:00
go-assert-interface.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-assert.c runtime: Copy runtime_printf from other Go library. 2012-05-24 20:44:34 +00:00
go-assert.h
go-breakpoint.c re PR go/46986 (Go is not supported on Darwin) 2013-01-24 19:44:23 +00:00
go-byte-array-to-string.c libgo: Update to October 24 version of master library. 2013-11-06 19:49:01 +00:00
go-caller.c libgo: update to go1.7rc3 2016-07-22 18:15:38 +00:00
go-callers.c compiler, runtime: mark stub methods, ignore them in runtime.Caller. 2016-02-03 06:54:41 +00:00
go-can-convert-interface.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-cdiv.c runtime: fix misc gcc-isms and undefined behavior 2014-05-28 23:10:47 +00:00
go-cgo.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-check-interface.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-construct-map.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-convert-interface.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-copy.c Unify handling of runtime support functions. 2011-04-13 21:00:59 +00:00
go-defer.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-deferred-recover.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-eface-compare.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-eface-val-compare.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-ffi.c re PR go/72814 (reflect FAILs on 32-bit Solaris/SPARC: SIGILL) 2016-08-08 19:53:44 +00:00
go-ffi.h reflect, runtime: Use libffi closures to implement reflect.MakeFunc. 2014-07-19 21:36:26 +00:00
go-fieldtrack.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-iface.goc runtime: Rename iface.goc to go-iface.goc. 2014-07-11 00:39:03 +00:00
go-int-array-to-string.c runtime: Fix handling of surrogate pairs in string([]rune). 2013-11-26 23:27:29 +00:00
go-int-to-string.c libgo: Update to October 24 version of master library. 2013-11-06 19:49:01 +00:00
go-interface-compare.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-interface-eface-compare.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-interface-val-compare.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-libmain.c runtime: For c-archive/c-shared, install signal handlers synchronously. 2016-02-12 22:10:09 +00:00
go-main.c re PR go/69357 (libgo refers to _end in a non-weak way) 2016-02-09 00:34:55 +00:00
go-make-slice.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-matherr.c runtime: Use __builtin_{inf,nan} rather than INFINITY/NAN. 2012-02-10 00:40:27 +00:00
go-memclr.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-memcmp.c compiler, runtime: Memcmp routine returns intgo. 2012-11-06 18:12:45 +00:00
go-memequal.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-memmove.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-nanotime.c libgo: Update to weekly.2011-12-02. 2011-12-13 19:16:27 +00:00
go-new.c compiler,runtime: Determine if allocations need new pointers in runtime. 2015-07-14 01:22:25 +00:00
go-nosys.c libgo: change build procedure to use build tags 2016-08-06 00:36:33 +00:00
go-now.c re PR go/66574 (Time is provided in millisecond precision instead of nanoseconds as described in go documentation) 2015-11-21 01:27:44 +00:00
go-panic.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-panic.h runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-print.c compiler, runtime: More steps toward separating int and intgo. 2012-11-01 03:02:13 +00:00
go-recover.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-reflect-call.c re PR go/68496 ([libgo] reflect test fails on Linux x86-64) 2015-11-23 21:17:45 +00:00
go-rune.c compiler, libgo: Fixes to prepare for 64-bit int. 2012-11-06 18:28:21 +00:00
go-runtime-error.c compiler, runtime: More steps toward separating int and intgo. 2012-11-01 03:02:13 +00:00
go-setenv.c libgo: Merge to master revision 19184. 2014-06-06 22:37:27 +00:00
go-signal.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-strcmp.c compiler, runtime: More steps toward separating int and intgo. 2012-11-01 03:02:13 +00:00
go-string-to-byte-array.c libgo: Update to final Go 1.6 release. 2016-02-18 05:56:46 +00:00
go-string-to-int-array.c libgo: Merge to master revision 19184. 2014-06-06 22:37:27 +00:00
go-string.h compiler, libgo: Fixes to prepare for 64-bit int. 2012-11-06 18:28:21 +00:00
go-strplus.c libgo: Update to October 24 version of master library. 2013-11-06 19:49:01 +00:00
go-strslice.c compiler, runtime: More steps toward separating int and intgo. 2012-11-01 03:02:13 +00:00
go-traceback.c reflect, runtime: Use libffi closures to implement reflect.MakeFunc. 2014-07-19 21:36:26 +00:00
go-trampoline.c libgo: Update to revision 15193:6fdc1974457c of master library. 2012-12-22 01:15:33 +00:00
go-type-complex.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-type-eface.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-type-float.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-type-identity.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-type-interface.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-type-string.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-type.h compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
go-typedesc-equal.c re PR go/65755 (incorrect reflection of struct fields with gccgo) 2015-04-17 18:19:44 +00:00
go-unsafe-new.c libgo: Update to Go 1.1.1. 2013-07-16 06:54:42 +00:00
go-unsafe-newarray.c libgo: Update to Go 1.1.1. 2013-07-16 06:54:42 +00:00
go-unsafe-pointer.c compiler, reflect, runtime: remove zero field from type descriptor 2015-10-29 18:14:50 +00:00
go-unsetenv.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-unwind.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
go-varargs.c libgo: Solaris portability fixes. 2015-11-06 19:15:45 +00:00
goc2c.c runtime: Merge master revision 19185. 2014-07-12 00:01:09 +00:00
heapdump.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
interface.h compiler, runtime: More steps toward separating int and intgo. 2012-11-01 03:02:13 +00:00
lfstack.goc runtime: Fix recent lfstack change on Solaris. 2015-09-24 13:33:20 +00:00
lock_futex.c libgo: Merge to master revision 19184. 2014-06-06 22:37:27 +00:00
lock_sema.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
malloc.goc compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
malloc.h compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
mcache.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
mcentral.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
mem.c runtime: Add casts to mincore call to compile on Solaris. 2014-08-04 17:54:09 +00:00
mem_posix_memalign.c runtime: RTEMS build fixes. 2011-12-13 21:59:26 +00:00
mfixalloc.c libgo: Update to October 24 version of master library. 2013-11-06 19:49:01 +00:00
mgc0.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
mgc0.h libgo: Update to Go 1.3 release. 2014-07-19 08:53:52 +00:00
mheap.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
mprof.goc runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
msize.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
netpoll.goc runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
netpoll_epoll.c libgo: Update to Go 1.3 release. 2014-07-19 08:53:52 +00:00
netpoll_kqueue.c libgo: Update to Go 1.3 release. 2014-07-19 08:53:52 +00:00
netpoll_select.c re PR go/61303 (gccgo: segfault, regression since 4.8.2) 2015-11-26 00:24:21 +00:00
netpoll_stub.c libgo: Merge to master revision 19184. 2014-06-06 22:37:27 +00:00
panic.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
parfor.c runtime: Remove now unnecessary pad field from ParFor. 2015-10-31 00:59:47 +00:00
print.c runtime: also disable split stacks for runtime_snprintf function under Clang 2014-07-20 09:24:16 +00:00
proc.c compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
rdebug.goc libgo: Update to Go 1.3 release. 2014-07-19 08:53:52 +00:00
reflect.goc runtime: Drop reflectFlags tests. 2014-07-11 00:26:25 +00:00
rtems-task-variable-add.c
runtime.c runtime: make gsignal stack at least SIGSTKSZ bytes 2016-08-31 13:59:03 +00:00
runtime.h compiler, runtime: replace hashmap code with Go 1.7 hashmap 2016-09-21 20:58:51 +00:00
runtime1.goc runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
sema.goc libgo: update to go1.7rc3 2016-07-22 18:15:38 +00:00
signal_unix.c runtime: use -fgo-c-header to build C header file 2016-08-30 21:07:47 +00:00
signal_unix.h libgo: Update to Go 1.1.1. 2013-07-16 06:54:42 +00:00
sigqueue.goc runtime: Remove now unnecessary pad field from ParFor. 2015-10-31 00:59:47 +00:00
string.goc runtime: Remove undefined references to runtime_race*. 2014-12-23 20:33:53 +00:00
thread-linux.c libgo: Update to October 24 version of master library. 2013-11-06 19:49:01 +00:00
thread-sema.c runtime: support NumCPU() on more platforms Added support for Solaris, Irix, *BSD (including Darwin). 2012-08-07 04:42:49 +00:00
thread.c libgo: Update to Go 1.1.1. 2013-07-16 06:54:42 +00:00
time.goc compiler, reflect, runtime: Use static chain for closures. 2015-01-16 22:58:53 +00:00
yield.c runtime: Use _mm_pause rather than __builtin_ia32_pause. 2014-05-30 13:53:58 +00:00