]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj, runtime: use register map to mark unsafe points
authorCherry Zhang <cherryyz@google.com>
Thu, 14 Nov 2019 22:03:44 +0000 (17:03 -0500)
committerCherry Zhang <cherryyz@google.com>
Wed, 27 Nov 2019 01:29:00 +0000 (01:29 +0000)
commitc3f149250e036f6bf77e7c9512dd3d57e1c78452
treeb874954c7d5b7193d66ecc7de4f7e7cfe951dfe5
parent4a378d712d4a089e2242fe49de6547d493f52bf5
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>
src/cmd/internal/obj/plist.go
src/runtime/preempt.go