mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/gc: separate Name-only Node fields
Name will be converted from an anonymous to a named field in a subsequent, automated CL. No functional changes. Passes toolstash -cmp. This reduces the size of gc.Node from 424 to 400 bytes. This in turn reduces the permanent (pprof -inuse_space) memory usage while compiling the test/rotate?.go tests: test old(MB) new(MB) change rotate0 379.49 367.30 -3.21% rotate1 373.42 361.59 -3.16% rotate2 381.17 368.77 -3.25% rotate3 374.30 362.48 -3.15% Updates #9933. Change-Id: I21479527c136add4f1efb9342774e3be3e276e83 Reviewed-on: https://go-review.googlesource.com/10120 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
13485be939
commit
76ec0ee53a
3 changed files with 23 additions and 16 deletions
|
|
@ -380,6 +380,8 @@ func Nod(op int, nleft *Node, nright *Node) *Node {
|
|||
switch op {
|
||||
case OCLOSURE, ODCLFUNC:
|
||||
n.Func = new(Func)
|
||||
case ONAME:
|
||||
n.Name = new(Name)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
|
@ -771,7 +773,6 @@ func treecopy(n *Node) *Node {
|
|||
}
|
||||
fallthrough
|
||||
|
||||
// fall through
|
||||
case ONAME, OLITERAL, OTYPE:
|
||||
m = n
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue