From 21ab0128b62658ba3e325586f45bb781bee55fda Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 18 Jun 2025 17:09:20 -0700 Subject: cmd/compile: remove support for old-style bounds check calls This CL rips out the support for old-style assembly stubs. We need to keep the Go stubs for wasm support. Change-Id: I23d6d9f2f06be1ded8d22b3e0ef04ff6e252a587 Reviewed-on: https://go-review.googlesource.com/c/go/+/682402 Reviewed-by: Austin Clements LUCI-TryBot-Result: Go LUCI Reviewed-by: Cuong Manh Le Reviewed-by: Michael Knyszek --- src/runtime/panic.go | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'src/runtime') diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 8f9ab4dd47..8c91c9435a 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -103,9 +103,8 @@ func panicCheck2(err string) { // these (they always look like they're called from the runtime). // Hence, for these, we just check for clearly bad runtime conditions. // -// The panic{Index,Slice} functions are implemented in assembly and tail call -// to the goPanic{Index,Slice} functions below. This is done so we can use -// a space-minimal register calling convention. +// The goPanic{Index,Slice} functions are only used by wasm. All the other architectures +// use panic{Bounds,Extend} in assembly, which then call to panicBounds{64,32,32X}. // failures in the comparisons for s[x], 0 <= x < y (y == len(s)) // @@ -205,28 +204,10 @@ func goPanicSliceConvert(x int, y int) { panic(boundsError{x: int64(x), signed: true, y: y, code: abi.BoundsConvert}) } -// Implemented in assembly, as they take arguments in registers. -// Declared here to mark them as ABIInternal. -func panicIndex(x int, y int) -func panicIndexU(x uint, y int) -func panicSliceAlen(x int, y int) -func panicSliceAlenU(x uint, y int) -func panicSliceAcap(x int, y int) -func panicSliceAcapU(x uint, y int) -func panicSliceB(x int, y int) -func panicSliceBU(x uint, y int) -func panicSlice3Alen(x int, y int) -func panicSlice3AlenU(x uint, y int) -func panicSlice3Acap(x int, y int) -func panicSlice3AcapU(x uint, y int) -func panicSlice3B(x int, y int) -func panicSlice3BU(x uint, y int) -func panicSlice3C(x int, y int) -func panicSlice3CU(x uint, y int) -func panicSliceConvert(x int, y int) - +// Implemented in assembly. Declared here to mark them as ABIInternal. func panicBounds() // in asm_GOARCH.s files, called from generated code func panicExtend() // in asm_GOARCH.s files, called from generated code (on 32-bit archs) + func panicBounds64(pc uintptr, regs *[16]int64) { // called from panicBounds on 64-bit archs f := findfunc(pc) v := pcdatavalue(f, abi.PCDATA_PanicBounds, pc-1) -- cgit v1.3-5-g45d5