diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2021-02-17 19:28:33 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2021-03-05 15:34:15 +0000 |
commit | c5a1c2276ee41a65cce93b7e443d333dfa29aba7 (patch) | |
tree | df9f40da1fad8422afdceac4783199cddb122e36 /src/internal | |
parent | 302a400316319501748c0f034464fa70e7815272 (diff) | |
download | go-c5a1c2276ee41a65cce93b7e443d333dfa29aba7.tar.gz go-c5a1c2276ee41a65cce93b7e443d333dfa29aba7.zip |
reflect: use global variables for register count
This change switches reflect to use global variables for ABI-related
register counts instead of internal/abi constants. The advantage of
doing so is that we can make the internal/abi constants non-zero and
enable the runtime register argument spiller/unspiller even if they're
not used. It's basically turning two things we need to flip when we
switch to the register ABI into one.
It also paves the way for testing the reflect register ABI path
independently, because now we can switch the global variables at will
and run the register-assignment algorithm in tests without having the
rest of the runtime be broken.
Change-Id: Ie23629a37a5c80aeb24909d4bd9eacbd3f0c06d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/293149
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/internal')
-rw-r--r-- | src/internal/abi/abi_amd64.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/internal/abi/abi_amd64.go b/src/internal/abi/abi_amd64.go index 77589d4c34..07c3ec1aab 100644 --- a/src/internal/abi/abi_amd64.go +++ b/src/internal/abi/abi_amd64.go @@ -10,16 +10,12 @@ package abi const ( // See abi_generic.go. - // Currently these values are zero because whatever uses - // them will expect the register ABI, which isn't ready - // yet. - // RAX, RBX, RCX, RDI, RSI, R8, R9, R10, R11. - IntArgRegs = 0 // 9 + IntArgRegs = 9 // X0 -> X14. - FloatArgRegs = 0 // 15 + FloatArgRegs = 15 // We use SSE2 registers which support 64-bit float operations. - EffectiveFloatRegSize = 0 // 8 + EffectiveFloatRegSize = 8 ) |