aboutsummaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2020-10-14 08:36:11 -0400
committerThan McIntosh <thanm@google.com>2020-10-29 15:13:09 +0000
commit50af50d136551e2009b2b52e829570536271cdaa (patch)
treeea00744bee71fee9f096928404082e6748e57b95 /src/reflect
parentecb79e8afa7811fd23b2e550a2bc5b22ea0aa82d (diff)
downloadgo-50af50d136551e2009b2b52e829570536271cdaa.tar.gz
go-50af50d136551e2009b2b52e829570536271cdaa.zip
reflect,runtime: use internal ABI for selected ASM routines
Change the definitions of selected runtime assembly routines from ABI0 (the default) to ABIInternal. The ABIInternal def is intended to indicate that these functions don't follow the existing Go runtime ABI. In addition, convert the assembly reference to runtime.main (from runtime.mainPC) to ABIInternal. Finally, for functions such as "runtime.duffzero" that are called directly from generated code, make sure that the compiler looks up the correct ABI version. This is intended to support the register abi work, however these changes should not have any issues even when GOEXPERIMENT=regabi is not in effect. Updates #27539, #40724. Change-Id: I9846f8dcaccc95718cf2e61a18b7e924a0677e4c Reviewed-on: https://go-review.googlesource.com/c/go/+/262319 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/asm_amd64.s12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/reflect/asm_amd64.s b/src/reflect/asm_amd64.s
index fb28ab87f1..5c8e56558c 100644
--- a/src/reflect/asm_amd64.s
+++ b/src/reflect/asm_amd64.s
@@ -9,7 +9,9 @@
// See the comment on the declaration of makeFuncStub in makefunc.go
// for more details.
// No arg size here; runtime pulls arg map out of the func value.
-TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$32
+// makeFuncStub must be ABIInternal because it is placed directly
+// in function values.
+TEXT ·makeFuncStub<ABIInternal>(SB),(NOSPLIT|WRAPPER),$32
NO_LOCAL_POINTERS
MOVQ DX, 0(SP)
LEAQ argframe+0(FP), CX
@@ -17,14 +19,16 @@ TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$32
MOVB $0, 24(SP)
LEAQ 24(SP), AX
MOVQ AX, 16(SP)
- CALL ·callReflect(SB)
+ CALL ·callReflect<ABIInternal>(SB)
RET
// methodValueCall is the code half of the function returned by makeMethodValue.
// See the comment on the declaration of methodValueCall in makefunc.go
// for more details.
// No arg size here; runtime pulls arg map out of the func value.
-TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$32
+// methodValueCall must be ABIInternal because it is placed directly
+// in function values.
+TEXT ·methodValueCall<ABIInternal>(SB),(NOSPLIT|WRAPPER),$32
NO_LOCAL_POINTERS
MOVQ DX, 0(SP)
LEAQ argframe+0(FP), CX
@@ -32,5 +36,5 @@ TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$32
MOVB $0, 24(SP)
LEAQ 24(SP), AX
MOVQ AX, 16(SP)
- CALL ·callMethod(SB)
+ CALL ·callMethod<ABIInternal>(SB)
RET