aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-06-22 22:11:01 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-06-22 22:11:01 +0000
commitb34391e08e273b5dbdce966518c6d7be0596bd16 (patch)
treea7c718ad2a1c12d1364d1ab18d4899f4fdbbe2e6
parentf384e12acc5b5b06d5fcc9a40ea6cffb8c0aa4c8 (diff)
downloadgcc-b34391e08e273b5dbdce966518c6d7be0596bd16.zip
gcc-b34391e08e273b5dbdce966518c6d7be0596bd16.tar.gz
gcc-b34391e08e273b5dbdce966518c6d7be0596bd16.tar.bz2
runtime: mark dropm and callees nowritebarrierrec
The CgocallbackDone function calls dropm after it calls entersyscall, which means that dropm must not have any write barriers. Mark it accordingly. Reviewed-on: https://go-review.googlesource.com/46464 From-SVN: r249577
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--libgo/go/runtime/os_gccgo.go1
-rw-r--r--libgo/go/runtime/proc.go5
-rw-r--r--libgo/go/runtime/signal_unix.go1
4 files changed, 8 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index fb6b7be..3f42df6 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-55b2b2dee55bd495a770347daaf858634057ecb0
+c5aa42107d116c9121de447d214297c88dd9f5fa
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/go/runtime/os_gccgo.go b/libgo/go/runtime/os_gccgo.go
index 358a38b..db3ea48 100644
--- a/libgo/go/runtime/os_gccgo.go
+++ b/libgo/go/runtime/os_gccgo.go
@@ -32,6 +32,7 @@ func minit() {
// Called from dropm to undo the effect of an minit.
//go:nosplit
+//go:nowritebarrierrec
func unminit() {
unminitSignals()
}
diff --git a/libgo/go/runtime/proc.go b/libgo/go/runtime/proc.go
index bdf7144..77b624b 100644
--- a/libgo/go/runtime/proc.go
+++ b/libgo/go/runtime/proc.go
@@ -1447,6 +1447,9 @@ func oneNewExtraM() {
// in which dropm happens on each cgo call, is still correct too.
// We may have to keep the current version on systems with cgo
// but without pthreads, like Windows.
+//
+// CgocallBackDone calls this after releasing p, so no write barriers.
+//go:nowritebarrierrec
func dropm() {
// Clear m and g, and return m to the extra list.
// After the call to setg we can only call nosplit functions
@@ -1492,6 +1495,7 @@ var extraMWaiters uint32
// return a nil list head if that's what it finds. If nilokay is false,
// lockextra will keep waiting until the list head is no longer nil.
//go:nosplit
+//go:nowritebarrierrec
func lockextra(nilokay bool) *m {
const locked = 1
@@ -1524,6 +1528,7 @@ func lockextra(nilokay bool) *m {
}
//go:nosplit
+//go:nowritebarrierrec
func unlockextra(mp *m) {
atomic.Storeuintptr(&extram, uintptr(unsafe.Pointer(mp)))
}
diff --git a/libgo/go/runtime/signal_unix.go b/libgo/go/runtime/signal_unix.go
index c8713b6..e2642ee 100644
--- a/libgo/go/runtime/signal_unix.go
+++ b/libgo/go/runtime/signal_unix.go
@@ -599,6 +599,7 @@ func minitSignalMask() {
// unminitSignals is called from dropm, via unminit, to undo the
// effect of calling minit on a non-Go thread.
//go:nosplit
+//go:nowritebarrierrec
func unminitSignals() {
if getg().m.newSigstack {
signalstack(nil, 0)