1
0
mirror of https://github.com/golang/go synced 2024-11-22 16:25:07 -07:00

runtime: use register ABI in panicIndex/Slice functions

runtime.panicIndex*/panicSlice* functions move the arguments in
the right place then tail calls goPanicIndex*/Slice* using
internal ABI. (It uses internal ABI to avoid wrappers, because
the callee needs to get the caller's PC, to know whether it panics
in the runtime.) This CL makes it to use the register ABI if it
is enabled.

Change-Id: Id2ebb51b4bfb3e9aa7cb66d0a9aee63fccee5ecd
Reviewed-on: https://go-review.googlesource.com/c/go/+/308649
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Cherry Zhang 2021-04-08 12:13:58 -04:00
parent ca8540affd
commit 96a6745088

View File

@ -1874,68 +1874,138 @@ TEXT runtime·debugCallPanicked(SB),NOSPLIT,$16-16
// The tail call makes these stubs disappear in backtraces.
// Defined as ABIInternal since they do not use the stack-based Go ABI.
TEXT runtime·panicIndex<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicIndex<ABIInternal>(SB)
TEXT runtime·panicIndexU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicIndexU<ABIInternal>(SB)
TEXT runtime·panicSliceAlen<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX
MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAlen<ABIInternal>(SB)
TEXT runtime·panicSliceAlenU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX
MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAlenU<ABIInternal>(SB)
TEXT runtime·panicSliceAcap<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX
MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAcap<ABIInternal>(SB)
TEXT runtime·panicSliceAcapU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX
MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAcapU<ABIInternal>(SB)
TEXT runtime·panicSliceB<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSliceB<ABIInternal>(SB)
TEXT runtime·panicSliceBU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSliceBU<ABIInternal>(SB)
TEXT runtime·panicSlice3Alen<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3Alen<ABIInternal>(SB)
TEXT runtime·panicSlice3AlenU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3AlenU<ABIInternal>(SB)
TEXT runtime·panicSlice3Acap<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3Acap<ABIInternal>(SB)
TEXT runtime·panicSlice3AcapU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3AcapU<ABIInternal>(SB)
TEXT runtime·panicSlice3B<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX
MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSlice3B<ABIInternal>(SB)
TEXT runtime·panicSlice3BU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX
MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSlice3BU<ABIInternal>(SB)
TEXT runtime·panicSlice3C<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSlice3C<ABIInternal>(SB)
TEXT runtime·panicSlice3CU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSlice3CU<ABIInternal>(SB)
#ifdef GOOS_android