gcc/libgo/go/reflect
Ian Lance Taylor 39c0aa5f74 compiler, runtime, reflect: generate unique type descriptors
Currently, the compiler already generates common symbols for type
    descriptors, so the type descriptors are unique. However, when a
    type is created through reflection, it is not deduplicated with
    compiler-generated types. As a consequence, we cannot assume type
    descriptors are unique, and cannot use pointer equality to
    compare them. Also, when constructing a reflect.Type, it has to
    go through a canonicalization map, which introduces overhead to
    reflect.TypeOf, and lock contentions in concurrent programs.
    
    In order for the reflect package to deduplicate types with
    compiler-created types, we register all the compiler-created type
    descriptors at startup time. The reflect package, when it needs
    to create a type, looks up the registry of compiler-created types
    before creates a new one. There is no lock contention since the
    registry is read-only after initialization.
    
    This lets us get rid of the canonicalization map, and also makes
    it possible to compare type descriptors with pointer equality.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179598

From-SVN: r271894
2019-06-03 23:37:04 +00:00
..
all_test.go compiler,runtime: do more direct interfaces 2019-05-01 21:34:16 +00:00
deepequal.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
example_test.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
export_test.go libgo: update to Go1.10beta1 2018-01-09 01:23:08 +00:00
makefunc.go libgo: update to Go 1.8 release candidate 1 2017-01-14 00:05:42 +00:00
makefunc_ffi.go libgo: update to Go 1.11.1 release 2018-10-08 14:21:30 +00:00
makefunc_ffi_c.c runtime: rewrite panic/defer code from C to Go 2016-11-22 17:58:04 +00:00
set_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
swapper.go libgo: update to Go1.10beta1 2018-01-09 01:23:08 +00:00
tostring_test.go libgo: Update to Go 1.1.1. 2013-07-16 06:54:42 +00:00
type.go compiler, runtime, reflect: generate unique type descriptors 2019-06-03 23:37:04 +00:00
value.go reflect: correctly handle direct interface typed receiver in Value.call 2019-05-08 04:39:19 +00:00