]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: make ir.Name the ONAME Node implementation
authorRuss Cox <rsc@golang.org>
Sat, 28 Nov 2020 06:41:13 +0000 (01:41 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 30 Nov 2020 18:33:57 +0000 (18:33 +0000)
commit862f638a89c5ec721a53446fb1a74f9ad15893d5
tree1a49a893d55d4d19186886b89a9342f051f3c0bf
parentf6106d195db8bd7ef268e621f4a0d9ddbe9c58f6
[dev.regabi] cmd/compile: make ir.Name the ONAME Node implementation

Before this CL, an ONAME Node was represented by three structs
linked together: a node, a Name, and a Param. Previous CLs removed
OLABEL and OPACK from the set of nodes that knew about Name.
Now Name can be repurposed to *be* the ONAME Node implementation,
replacing three linked structs totaling 152+64+88 = 304 bytes (64-bit)
with a single 232-byte struct.

Many expressions in the code become simpler as well, without having
to use .Param. and sometimes even .Name().
(For a node n where n.Name() != nil, n.Name() == n.(*Name) now.)

Passes buildall w/ toolstash -cmp.

Change-Id: Ie719f1285c05623b9fd2faaa059e5b360a64b3be
Reviewed-on: https://go-review.googlesource.com/c/go/+/274094
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
24 files changed:
src/cmd/compile/fmtmap_test.go
src/cmd/compile/internal/gc/alg.go
src/cmd/compile/internal/gc/align.go
src/cmd/compile/internal/gc/closure.go
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/embed.go
src/cmd/compile/internal/gc/escape.go
src/cmd/compile/internal/gc/gen.go
src/cmd/compile/internal/gc/iexport.go
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/universe.go
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/ir/expr.go [new file with mode: 0644]
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/mini.go
src/cmd/compile/internal/ir/name.go
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/ir/sizeof_test.go