aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/panic.go
diff options
context:
space:
mode:
authorKeith Randall <khr@google.com>2019-02-05 16:22:38 -0800
committerKeith Randall <khr@golang.org>2019-03-18 20:10:55 +0000
commitd949d0b9252be1fffeadd65183a6bab3acf3de7a (patch)
tree842d96e7575d306fafd07322dbd7771ba56929ea /src/runtime/panic.go
parent991c85a750574a608daf70330e26070f8cd97bb4 (diff)
downloadgo-d949d0b9252be1fffeadd65183a6bab3acf3de7a.tar.xz
cmd/compile: reorganize init functions
Instead of writing an init function per package that does the same thing for every package, just write that implementation once in the runtime. Change the compiler to generate a data structure that encodes the required initialization operations. Reduces cmd/go binary size by 0.3%+. Most of the init code is gone, including all the corresponding stack map info. The .inittask structures that replace them are quite a bit smaller. Most usefully to me, there is no longer an init function in every -S output. (There is an .inittask global there, but it's much less distracting.) After this CL we could change the name of the "init.ializers" function back to just "init". Update #6853 R=go1.13 Change-Id: Iec82b205cc52fe3ade4d36406933c97dbc9c01b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/161337 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'src/runtime/panic.go')
-rw-r--r--src/runtime/panic.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go
index 918ab7682a..543fd23c01 100644
--- a/src/runtime/panic.go
+++ b/src/runtime/panic.go
@@ -183,10 +183,6 @@ func panicmem() {
panic(memoryError)
}
-func throwinit() {
- throw("recursive call during initialization - linker skew")
-}
-
// Create a new deferred function fn with siz bytes of arguments.
// The compiler turns a defer statement into a call to this.
//go:nosplit