diff options
author | Cherry Zhang <cherryyz@google.com> | 2019-11-14 17:03:44 -0500 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2019-11-27 01:29:00 +0000 |
commit | c3f149250e036f6bf77e7c9512dd3d57e1c78452 (patch) | |
tree | b874954c7d5b7193d66ecc7de4f7e7cfe951dfe5 /src/runtime/preempt.go | |
parent | 4a378d712d4a089e2242fe49de6547d493f52bf5 (diff) | |
download | go-c3f149250e036f6bf77e7c9512dd3d57e1c78452.tar.gz go-c3f149250e036f6bf77e7c9512dd3d57e1c78452.zip |
cmd/internal/obj, runtime: use register map to mark unsafe points
Currently we use stack map index -2 to mark unsafe points, i.e.
PC ranges that is not safe for async preemption. This has a
problem: it cannot mark CALL instructions, because for stack scan
a valid stack map index is needed.
This CL switches to use register map index for marking unsafe
points instead, which does not conflict with stack scan and can
be applied on CALL instructions. This is necessary as next CL
will mark call to morestack nonpreemptible.
For #35470.
Change-Id: I357bf26c996e1fee1e7eebe4e6bb07d62930d3f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/207349
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/preempt.go')
-rw-r--r-- | src/runtime/preempt.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/preempt.go b/src/runtime/preempt.go index 60e1bcef5f..2c38ac02f5 100644 --- a/src/runtime/preempt.go +++ b/src/runtime/preempt.go @@ -393,7 +393,7 @@ func isAsyncSafePoint(gp *g, pc, sp, lr uintptr) bool { // use the LR for unwinding, which will be bad. return false } - smi := pcdatavalue(f, _PCDATA_StackMapIndex, pc, nil) + smi := pcdatavalue(f, _PCDATA_RegMapIndex, pc, nil) if smi == -2 { // Unsafe-point marked by compiler. This includes // atomic sequences (e.g., write barrier) and nosplit |