aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/reflect
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-05-01 20:27:36 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-01 20:27:36 +0000
commit1da37f43b21e0c35e57b627edfa99ec80d2976ee (patch)
tree26483152e3287f06aa81c6a9d5905447f1ac0474 /libgo/go/reflect
parent9f3a481e08cbcce98793b3c7a78045e4e9621493 (diff)
downloadgcc-1da37f43b21e0c35e57b627edfa99ec80d2976ee.zip
gcc-1da37f43b21e0c35e57b627edfa99ec80d2976ee.tar.gz
gcc-1da37f43b21e0c35e57b627edfa99ec80d2976ee.tar.bz2
runtime: persistentalloc and cache itabs
Previously, each time we do an interface conversion for which the method table is not known at compile time, we allocate a new method table. This CL ports the mechanism of itab caching from the gc runtime, adapted to our itab representation and method finding mechanism. With the cache, we reuse the same itab for the same (interface, concrete) type pair. This reduces allocations in interface conversions. Unlike the gc runtime, we don't prepopulate the cache with statically allocated itabs, as currently we don't have a way to find them. This means we don't deduplicate run-time allocated itabs with compile-time allocated ones. But that is not too bad -- it is just a cache anyway. As now itabs are never freed, it is also possible to drop the write barrier for writing the first word of an interface header. I'll leave this optimization for the future. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/171617 From-SVN: r270778
Diffstat (limited to 'libgo/go/reflect')
0 files changed, 0 insertions, 0 deletions