]> git.ipfire.org Git - thirdparty/gcc.git/commit
runtime: persistentalloc and cache itabs
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 May 2019 20:27:36 +0000 (20:27 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 1 May 2019 20:27:36 +0000 (20:27 +0000)
commit551b38615cc0a4030a7aff85260848c63e9cd417
tree26483152e3287f06aa81c6a9d5905447f1ac0474
parent61fd42acd0629492b86d504fcd2e8d495e49371f
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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270778 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/go/runtime/iface.go