]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] runtime: fix ABI targets in runtime.panic{Index,Slice} shims
authorThan McIntosh <thanm@google.com>
Mon, 14 Dec 2020 15:03:37 +0000 (10:03 -0500)
committerThan McIntosh <thanm@google.com>
Tue, 22 Dec 2020 14:50:50 +0000 (14:50 +0000)
commit306b2451c849c9a5835069f317dfea851e526a00
tree2a3693ee4ebec1eeb87d7e52a2890253e3177f42
parent94cfeca0a5b36a70a8bdd1a0015eb78c7e9a3311
[dev.regabi] runtime: fix ABI targets in runtime.panic{Index,Slice} shims

Fix up the assembly shim routines runtime.panic{Index,Slice} and
friends so that their tail calls target ABIInternal and not ABI0
functions. This is so as to ensure that these calls don't go through
an ABI0->ABIInternal wrapper (which would throw off the machinery in
the called routines designed to detect whether the violation happened
in the runtime).

Note that when the compiler starts emitting real register calls to
these routines, we'll need to rewrite them to update the arg size and
ensure that args are in the correct registers. For example, the
current shim

TEXT runtime·panicIndex<ABIInternal>(SB),NOSPLIT,$0-16
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
JMP runtime·goPanicIndex<ABIInternal>(SB)

will need to change to

TEXT runtime·panicIndex<ABIInternal>(SB),NOSPLIT,$0
// AX already set up properly
MOVQ CX, BX // second argument expected in BX
JMP runtime·goPanicIndex<ABIInternal>(SB)

Change-Id: I48d1b5138fb4d229380ad12735cfaca5c50e6cc3
Reviewed-on: https://go-review.googlesource.com/c/go/+/278755
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
src/runtime/asm_amd64.s