diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2020-10-22 16:55:55 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2021-03-11 17:26:22 +0000 |
commit | f009b5b2268a7fcdfe046057cbf2a75306dbfc5e (patch) | |
tree | 0c5da8482cab010c564e36528dab31c7364e095a /src/runtime/stubs.go | |
parent | 415ca3f1f0fa05a98561752e0787f59b77f19645 (diff) | |
download | go-f009b5b2268a7fcdfe046057cbf2a75306dbfc5e.tar.gz go-f009b5b2268a7fcdfe046057cbf2a75306dbfc5e.zip |
runtime: support register ABI for finalizers
This change modifies runfinq to properly pass arguments to finalizers in
registers via reflectcall.
For #40724.
Change-Id: I414c0eff466ef315a0eb10507994e598dd29ccb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/300112
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/stubs.go')
-rw-r--r-- | src/runtime/stubs.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index 5011d7199e..a2e04a64a5 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -396,3 +396,31 @@ func addmoduledata() // Injected by the signal handler for panicking signals. On many platforms it just // jumps to sigpanic. func sigpanic0() + +// intArgRegs is used by the various register assignment +// algorithm implementations in the runtime. These include:. +// - Finalizers (mfinal.go) +// - Windows callbacks (syscall_windows.go) +// +// Both are stripped-down versions of the algorithm since they +// only have to deal with a subset of cases (finalizers only +// take a pointer or interface argument, Go Windows callbacks +// don't support floating point). +// +// It should be modified with care and are generally only +// modified when testing this package. +// +// It should never be set higher than its internal/abi +// constant counterparts, because the system relies on a +// structure that is at least large enough to hold the +// registers the system supports. +// +// Currently it's set to zero because using the actual +// constant will break every part of the toolchain that +// uses finalizers or Windows callbacks to call functions +// The value that is currently commented out there should be +// the actual value once we're ready to use the register ABI +// everywhere. +// +// Protected by finlock. +var intArgRegs = 0 // abi.IntArgRegs |