From 826831acf7426f4e5e27198f96dbb07f933551b8 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Wed, 16 Mar 2016 12:41:55 -0700 Subject: [PATCH] cmd/compile: move LSym.RefIdx for better packing Change-Id: I0516d49ee8381c5e022d77c2fb41515c01c8a631 Reviewed-on: https://go-review.googlesource.com/20764 Reviewed-by: Brad Fitzpatrick Reviewed-by: David Crawshaw --- src/cmd/internal/obj/link.go | 5 +++-- src/cmd/internal/obj/sizeof_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index cbf4bf4183..ad496021a1 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -314,7 +314,6 @@ type LSym struct { Leaf uint8 Seenglobl uint8 Onlist uint8 - RefIdx int // Index of this symbol in the symbol reference list. // ReflectMethod means the function may call reflect.Type.Method or // reflect.Type.MethodByName. Matching is imprecise (as reflect.Type @@ -330,7 +329,9 @@ type LSym struct { // visible outside of the module (shared library or executable) that contains its // definition. (When not compiling to support Go shared libraries, all symbols are // local in this sense unless there is a cgo_export_* directive). - Local bool + Local bool + + RefIdx int // Index of this symbol in the symbol reference list. Args int32 Locals int32 Size int64 diff --git a/src/cmd/internal/obj/sizeof_test.go b/src/cmd/internal/obj/sizeof_test.go index 14bdbe20dc..f7173d3c4c 100644 --- a/src/cmd/internal/obj/sizeof_test.go +++ b/src/cmd/internal/obj/sizeof_test.go @@ -23,7 +23,7 @@ func TestSizeof(t *testing.T) { _64bit uintptr // size on 64bit platforms }{ {Addr{}, 52, 80}, - {LSym{}, 84, 144}, + {LSym{}, 80, 136}, {Prog{}, 196, 288}, } -- 2.48.1