diff options
author | Austin Clements <austin@google.com> | 2020-10-03 20:40:49 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2020-10-05 17:03:04 +0000 |
commit | 40bff82885b8de850f909f38357c53670562f815 (patch) | |
tree | 7fb9287e26532c35d4e19c8040e56c11de744f05 /src/runtime/asm_arm64.s | |
parent | 9dc65d7dc9268d5150174ec55cc4753fe18f554c (diff) | |
download | go-40bff82885b8de850f909f38357c53670562f815.tar.gz go-40bff82885b8de850f909f38357c53670562f815.zip |
runtime: define and use call16 everywhere
Currently, runtime.call16 is defined and used only on 32-bit
architectures, while 64-bit architectures all start at call32 and go
up from there. This led to unnecessary complexity because call16's
prototype needed to be in a different file, separate from all of the
other call* prototypes, which in turn led to it getting out of sync
with the other call* prototypes. This CL adds call16 on 64-bit
architectures, bringing them all into sync, and moves the call16
prototype to live with the others.
Prior to CL 31655 (in 2016), call16 couldn't be implemented on 64-bit
architectures because it needed at least four words of argument space
to invoke "callwritebarrier" after copying back the results. CL 31655
changed the way call* invoked the write barrier in preparation for the
hybrid barrier; since the hybrid barrier had to be invoked prior to
copying back results, it needed a different solution that didn't reuse
call*'s stack space. At this point, call16 was no longer a problem on
64-bit, but we never added it. Until now.
Change-Id: Id10ade0e4f75c6ea76afa6229ddaee2b994c27dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/259339
Trust: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/asm_arm64.s')
-rw-r--r-- | src/runtime/asm_arm64.s | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s index 6b3d1e779e..5eda3063d7 100644 --- a/src/runtime/asm_arm64.s +++ b/src/runtime/asm_arm64.s @@ -331,6 +331,7 @@ TEXT runtime·morestack_noctxt(SB),NOSPLIT|NOFRAME,$0-0 TEXT ·reflectcall(SB), NOSPLIT|NOFRAME, $0-32 MOVWU argsize+24(FP), R16 + DISPATCH(runtime·call16, 16) DISPATCH(runtime·call32, 32) DISPATCH(runtime·call64, 64) DISPATCH(runtime·call128, 128) @@ -416,6 +417,7 @@ TEXT callRet<>(SB), NOSPLIT, $40-0 // These have 8 added to make the overall frame size a multiple of 16, // as required by the ABI. (There is another +8 for the saved LR.) +CALLFN(·call16, 24 ) CALLFN(·call32, 40 ) CALLFN(·call64, 72 ) CALLFN(·call128, 136 ) |