aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/panic.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2025-06-18 17:09:20 -0700
committerKeith Randall <khr@golang.org>2025-08-05 08:59:28 -0700
commit21ab0128b62658ba3e325586f45bb781bee55fda (patch)
tree897bd90692ce8dc1965e6704c03a6b0aa3bd8a05 /src/runtime/panic.go
parent802d056c784d6baa8e5fc13a86e24ecc82ec2bf2 (diff)
downloadgo-21ab0128b62658ba3e325586f45bb781bee55fda.tar.xz
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 <austin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/panic.go')
-rw-r--r--src/runtime/panic.go27
1 files changed, 4 insertions, 23 deletions
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)