diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-09-13 22:25:58 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-09-13 22:25:58 +0000 |
commit | cec07c4759e8af44ca77a2beb9312e4e30d1cc7a (patch) | |
tree | 38fe52c7aeba372693d83041bf5037d8fbb2c311 /gcc/go | |
parent | 38fab7369d19fd545eb8510ec198e73949a2c75d (diff) | |
download | gcc-cec07c4759e8af44ca77a2beb9312e4e30d1cc7a.zip gcc-cec07c4759e8af44ca77a2beb9312e4e30d1cc7a.tar.gz gcc-cec07c4759e8af44ca77a2beb9312e4e30d1cc7a.tar.bz2 |
compiler, runtime: call gcWriteBarrier instead of writebarrierptr
In 1.11 writebarrierptr is going away, so change the compiler to call
gcWriteBarrier instead. We weren't using gcWriteBarrier before;
adjust the implementation to use the putFast method.
This revealed a problem in the kickoff function. When using cgo,
kickoff can be called on the g0 of an m allocated by newExtraM. In
that case the m will generally have a p, but systemstack may be called
by wbBufFlush as part of flushing the write barrier buffer. At that
point the buffer is full, so we can not do a write barrier. So adjust
the existing code in kickoff so that in the case where we are g0,
don't do any write barrier at all.
Reviewed-on: https://go-review.googlesource.com/131395
From-SVN: r264295
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/runtime.def | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/wb.cc | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 9a789b9..67ed658 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -82d7205ba9e5c1fe38fd24f89a45caf2e974975b +218c9159635e06e39ae43d0efe1ac1e694fead2e 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/runtime.def b/gcc/go/gofrontend/runtime.def index 1486cd8..ed759e8 100644 --- a/gcc/go/gofrontend/runtime.def +++ b/gcc/go/gofrontend/runtime.def @@ -302,7 +302,7 @@ DEF_GO_RUNTIME(IFACEEFACEEQ, "runtime.ifaceefaceeq", P2(IFACE, EFACE), // Set *dst = src where dst is a pointer to a pointer and src is a pointer. -DEF_GO_RUNTIME(WRITEBARRIERPTR, "runtime.writebarrierptr", +DEF_GO_RUNTIME(GCWRITEBARRIER, "runtime.gcWriteBarrier", P2(POINTER, POINTER), R0()) // Set *dst = *src for an arbitrary type. diff --git a/gcc/go/gofrontend/wb.cc b/gcc/go/gofrontend/wb.cc index 4944b68..4f84d99 100644 --- a/gcc/go/gofrontend/wb.cc +++ b/gcc/go/gofrontend/wb.cc @@ -380,7 +380,7 @@ Gogo::propagate_writebarrierrec() // This is compatible with the definition in the runtime package. // // For types that are pointer shared (pointers, maps, chans, funcs), -// we replaced the call to typedmemmove with writebarrierptr(&A, B). +// we replaced the call to typedmemmove with gcWriteBarrier(&A, B). // As far as the GC is concerned, all pointers are the same, so it // doesn't need the type descriptor. // @@ -391,7 +391,7 @@ Gogo::propagate_writebarrierrec() // runtime package, so we could optimize by only testing it once // between function calls. // -// A slice could be handled with a call to writebarrierptr plus two +// A slice could be handled with a call to gcWriteBarrier plus two // integer moves. // Traverse the IR adding write barriers. @@ -824,7 +824,7 @@ Gogo::assign_with_write_barrier(Function* function, Block* enclosing, case Type::TYPE_MAP: case Type::TYPE_CHANNEL: // These types are all represented by a single pointer. - call = Runtime::make_call(Runtime::WRITEBARRIERPTR, loc, 2, lhs, rhs); + call = Runtime::make_call(Runtime::GCWRITEBARRIER, loc, 2, lhs, rhs); break; case Type::TYPE_STRING: |