]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't mark uintptr->unsafe.Pointer conversion unsafe points
authorCherry Mui <cherryyz@google.com>
Wed, 11 Jan 2023 23:56:31 +0000 (18:56 -0500)
committerCherry Mui <cherryyz@google.com>
Tue, 28 Feb 2023 23:42:44 +0000 (23:42 +0000)
commit0384235a15110bb3f8bf3a65eff4543d4d3e837b
treece79c96558eea9283e69583bd30622ad104e6da1
parent65fa9ce8b51f86bf3c9c9ff4d7ae41b40a537e69
cmd/compile: don't mark uintptr->unsafe.Pointer conversion unsafe points

In the past, we planned to implement asynchronous preemption using
precise register pointer maps. In this strategy, conversions between
unsafe.Pointer and uintptr would need to be marked as unsafe points,
as if a pointer value is temporarily converted to uintptr (and not
live otherwise), the GC would not be able to see it when scanning
the stack (and registers).

But now we actually implemented asynchronous preemption with inner
frame conservative scan. So even if a pointer value lives as an
integer the GC can still see it. There is no need to mark the
conversion as unsafe points. This allows more places to be
preempted, as well as for debugger to inject a call.

Fixes #57719.

Change-Id: I375ab820d8d74d122b565cf72ecc7cdb225dbc01
Reviewed-on: https://go-review.googlesource.com/c/go/+/461696
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/liveness/plive.go