Skip to content

Commit b2c391b

Browse files
valyalabradfitz
authored andcommitted
cmd/compile/internal/gc: shrink Sym by 8 bytes on amd64
Move 8-bit flags field after 32-bit Block field Change-Id: I8e5e9a2285477aac2402a839a105e710d5340224 Reviewed-on: https://go-review.googlesource.com/37848 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 67d69f8 commit b2c391b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/cmd/compile/internal/gc/go.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,14 @@ type Sym struct {
5151
Pkg *Pkg
5252
Name string // object name
5353
Def *Node // definition: ONAME OTYPE OPACK or OLITERAL
54-
Block int32 // blocknumber to catch redeclaration
5554
Lastlineno src.XPos // last declaration for diagnostic
55+
Block int32 // blocknumber to catch redeclaration
5656

57+
flags bitset8
5758
Label *Node // corresponding label (ephemeral)
5859
Origpkg *Pkg // original package for . import
5960
Lsym *obj.LSym
6061
Fsym *Sym // funcsym
61-
62-
flags bitset8
6362
}
6463

6564
const (

src/cmd/compile/internal/gc/sizeof_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestSizeof(t *testing.T) {
2626
{Name{}, 36, 56},
2727
{Param{}, 28, 56},
2828
{Node{}, 84, 136},
29-
{Sym{}, 64, 120},
29+
{Sym{}, 64, 112},
3030
{Type{}, 60, 96},
3131
{MapType{}, 20, 40},
3232
{ForwardType{}, 20, 32},

0 commit comments

Comments
 (0)