]> Cypherpunks repositories - gostls13.git/commit
reflect: use global variables for register count
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 17 Feb 2021 19:28:33 +0000 (19:28 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 5 Mar 2021 15:34:15 +0000 (15:34 +0000)
commitc5a1c2276ee41a65cce93b7e443d333dfa29aba7
treedf9f40da1fad8422afdceac4783199cddb122e36
parent302a400316319501748c0f034464fa70e7815272
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>
src/internal/abi/abi_amd64.go
src/reflect/abi.go
src/runtime/asm_amd64.s