From 2919ad1ee3bf475c8f3aae44c2aec694a9843c4d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 13 Sep 2018 16:44:43 +0000 Subject: libgo: build roots index to speed up bulkBarrierPreWrite To reduce the amount of time spent in write barrier processing (specifically runtime.bulkBarrierPreWrite), add support for building a 'GC roots index', basically a sorted list of all roots, so as to allow more efficient lookups of gcdata structures for globals. The previous implementation worked on the raw (unsorted) roots list itself, which did not scale well. Reviewed-on: https://go-review.googlesource.com/132595 From-SVN: r264276 --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/gogo.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 1afbcb4..ca47d87 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -acf852f838e6b99f907d84648be853fa2c374393 +70bd9801911f8ed27df410d36a928166c37a68fd The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index c16b40e..dd6733f 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -1535,7 +1535,8 @@ Gogo::write_globals() // Avoid putting runtime.gcRoots itself on the list. if (this->compiling_runtime() && this->package_name() == "runtime" - && Gogo::unpack_hidden_name(no->name()) == "gcRoots") + && (Gogo::unpack_hidden_name(no->name()) == "gcRoots" + || Gogo::unpack_hidden_name(no->name()) == "gcRootsIndex")) ; else var_gc.push_back(no); -- cgit v1.1