Skip to content

Commit

Permalink
cmd/compile: make stkobj symbols content-addressable
Browse files Browse the repository at this point in the history
Shrinks binaries a little bit.

size    before    after     Δ       %
api     4892370   4875858   -16512  -0.338%
asm     4711218   4694706   -16512  -0.350%
cgo     4164770   4148258   -16512  -0.396%
compile 21875922  21826386  -49536  -0.226%
cover   4358370   4341858   -16512  -0.379%
doc     3532562   3516050   -16512  -0.467%
link    6110786   6094274   -16512  -0.270%
objdump 3982914   3966402   -16512  -0.415%
pprof   12869986  12836962  -33024  -0.257%
trace   9614626   9598114   -16512  -0.172%
vet     6580322   6563810   -16512  -0.251%
total   102897284 102666116 -231168 -0.225%

Change-Id: Idf4ba3c05e35ec1d1ae957d6ded00ae79cc0fd2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/172198
Trust: Josh Bleecher Snyder <[email protected]>
Run-TryBot: Josh Bleecher Snyder <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
  • Loading branch information
josharian committed Oct 5, 2021
1 parent 3100dc1 commit c1a0aa3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cmd/compile/internal/liveness/plive.go
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,7 @@ func (lv *liveness) emitStackObjects() *obj.LSym {
// Populate the stack object data.
// Format must match runtime/stack.go:stackObjectRecord.
x := base.Ctxt.Lookup(lv.fn.LSym.Name + ".stkobj")
x.Set(obj.AttrContentAddressable, true)
lv.fn.LSym.Func().StackObjects = x
off := 0
off = objw.Uintptr(x, off, uint64(len(vars)))
Expand Down

0 comments on commit c1a0aa3

Please sign in to comment.