]> Cypherpunks repositories - gostls13.git/commit
runtime: define and use call16 everywhere
authorAustin Clements <austin@google.com>
Sun, 4 Oct 2020 00:40:49 +0000 (20:40 -0400)
committerAustin Clements <austin@google.com>
Mon, 5 Oct 2020 17:03:04 +0000 (17:03 +0000)
commit40bff82885b8de850f909f38357c53670562f815
tree7fb9287e26532c35d4e19c8040e56c11de744f05
parent9dc65d7dc9268d5150174ec55cc4753fe18f554c
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>
src/runtime/asm_amd64.s
src/runtime/asm_arm64.s
src/runtime/asm_mips64x.s
src/runtime/asm_ppc64x.s
src/runtime/asm_riscv64.s
src/runtime/asm_s390x.s
src/runtime/asm_wasm.s
src/runtime/stubs.go
src/runtime/stubs32.go [deleted file]