cmd/internal/obj: replace Addr.U struct {...} with Val interface{}
An interface{} is more in the spirit of the original union.
By my calculations, on 64-bit systems this reduces
Addr from 120 to 80 bytes, and Prog from 592 to 424 bytes.
Change-Id: I0d7b0981513c2a3c94c9ac76bb4f8816485b5a3c
Reviewed-on: https://go-review.googlesource.com/7744
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/src/cmd/7g/ggen.go b/src/cmd/7g/ggen.go
index fe04bdf..7eb913f 100644
--- a/src/cmd/7g/ggen.go
+++ b/src/cmd/7g/ggen.go
@@ -17,7 +17,7 @@
// fill in argument size, stack size
ptxt.To.Type = obj.TYPE_TEXTSIZE
- ptxt.To.U.Argsize = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr)))
+ ptxt.To.Val = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr)))
frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg)))
ptxt.To.Offset = int64(frame)
@@ -840,7 +840,7 @@
//p1->from.offset = 1; // likely
p1.To.Type = obj.TYPE_BRANCH
- p1.To.U.Branch = p2.Link
+ p1.To.Val = p2.Link
// crash by write to memory address 0.
p2.As = arm64.AMOVD