]> Cypherpunks repositories - gostls13.git/commit
runtime: mark panicshift and panicdivide as //go:yeswritebarrierrec
authorMatthew Dempsky <mdempsky@google.com>
Fri, 13 May 2022 23:06:53 +0000 (16:06 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 16 May 2022 09:31:07 +0000 (09:31 +0000)
commit568590b0856d457f38404505f96d21032c35f844
treea457dbcb8ec25c44ac0a2d0fb40c9879eb1c4972
parent35d83535f7235ee54bd30bff05b27d4407147300
runtime: mark panicshift and panicdivide as //go:yeswritebarrierrec

When compiling package runtime, cmd/compile logically has two copies
of package runtime: the actual source files being compiled, and the
internal description used for emitting compiler-generated calls.

Notably, CL 393715 will cause the compiler's write barrier validation
to start recognizing that compiler-generated calls are actually calls
to the corresponding functions from the source package. And today,
there are some code paths in nowritebarrierrec code paths that
actually end up generating code to call panicshift or panicdivide.

In preparation, this CL marks those functions as
//go:yeswritebarrierrec. We probably want to actually cleanup those
code paths to avoid these calls actually (e.g., explicitly convert
shift count expressions to an unsigned integer type). But for now,
this at least unblocks CL 393715 while preserving the status quo.

Updates #51734.

Change-Id: I01f89adb72466c0260a9cd363e3e09246e39cff9
Reviewed-on: https://go-review.googlesource.com/c/go/+/406316
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/runtime/panic.go