runtime: rename gothrow to throw
Rename "gothrow" to "throw" now that the C version of "throw"
is no longer needed.
This change is purely mechanical except in panic.go where the
old version of "throw" has been deleted.
sed -i "" 's/[[:<:]]gothrow[[:>:]]/throw/g' runtime/*.go
Change-Id: Icf0752299c35958b92870a97111c67bcd9159dc3
Reviewed-on: https://go-review.googlesource.com/2150
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index a45507f..76d63b9 100644
--- a/src/runtime/traceback.go
+++ b/src/runtime/traceback.go
@@ -77,7 +77,7 @@
f := findfunc(frame.pc)
if f == nil {
print("runtime: unknown pc in defer ", hex(frame.pc), "\n")
- gothrow("unknown pc")
+ throw("unknown pc")
}
frame.fn = f
frame.argp = uintptr(deferArgs(d))
@@ -96,7 +96,7 @@
// duplicating the code and all its subtlety.
func gentraceback(pc0 uintptr, sp0 uintptr, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max int, callback func(*stkframe, unsafe.Pointer) bool, v unsafe.Pointer, flags uint) int {
if goexitPC == 0 {
- gothrow("gentraceback before goexitPC initialization")
+ throw("gentraceback before goexitPC initialization")
}
g := getg()
if g == gp && g == g.m.curg {
@@ -113,7 +113,7 @@
// accepts an sp for the current goroutine (typically obtained by
// calling getcallersp) must not run on that goroutine's stack but
// instead on the g0 stack.
- gothrow("gentraceback cannot trace user goroutine on its own stack")
+ throw("gentraceback cannot trace user goroutine on its own stack")
}
gotraceback := gotraceback(nil)
if pc0 == ^uintptr(0) && sp0 == ^uintptr(0) { // Signal to fetch saved values from gp.
@@ -163,7 +163,7 @@
if f == nil {
if callback != nil {
print("runtime: unknown pc ", hex(frame.pc), "\n")
- gothrow("unknown pc")
+ throw("unknown pc")
}
return 0
}
@@ -200,7 +200,7 @@
// to avoid that confusion.
// See golang.org/issue/8153.
if callback != nil {
- gothrow("traceback_arm: found jmpdefer when tracing with callback")
+ throw("traceback_arm: found jmpdefer when tracing with callback")
}
frame.lr = 0
} else {
@@ -221,7 +221,7 @@
// get everything, so crash loudly.
if callback != nil {
print("runtime: unexpected return pc for ", gofuncname(f), " called from ", hex(frame.lr), "\n")
- gothrow("unknown caller pc")
+ throw("unknown caller pc")
}
}
}
@@ -411,7 +411,7 @@
for _defer = gp._defer; _defer != nil; _defer = _defer.link {
print("\tdefer ", _defer, " sp=", hex(_defer.sp), " pc=", hex(_defer.pc), "\n")
}
- gothrow("traceback has leftover defers")
+ throw("traceback has leftover defers")
}
return n
@@ -430,7 +430,7 @@
fn := *(**[2]uintptr)(unsafe.Pointer(arg0))
if fn[0] != f.entry {
print("runtime: confused by ", gofuncname(f), "\n")
- gothrow("reflect mismatch")
+ throw("reflect mismatch")
}
bv := (*bitvector)(unsafe.Pointer(fn[1]))
frame.arglen = uintptr(bv.n / 2 * ptrSize)