]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssagen: share runtime._defer types
authorMatthew Dempsky <mdempsky@google.com>
Mon, 21 Aug 2023 20:51:21 +0000 (13:51 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 21 Aug 2023 23:30:29 +0000 (23:30 +0000)
commite7240ed8868f8c1df9e3421711eb8d0a537c3414
tree669143669de59cff812d731d02f180d4982657fa
parent42f4ccb6f9c2f64f3ebe684c6bc81a6f286dd164
cmd/compile/internal/ssagen: share runtime._defer types

Rather than constructing a new runtime._defer struct type at each
defer statement, we can use a single shared one. Also, by naming it
runtime._defer, we avoid emitting new runtime and DWARF type
descriptors in every package that contains a "defer" statement.

Shaves ~1kB off cmd/go.

Change-Id: I0bd819aec9f856546e684abf620e339a7555e73f
Reviewed-on: https://go-review.googlesource.com/c/go/+/521676
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ssagen/ssa.go