mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/gc: more Node cleanups
More cleanups to gc.Node
- make Node.Local a boolean
- make Type.Local a boolean
- reduce the size of Node.Esc to a uint8
Reducing the size of Node.Esc shaves ~45mb off the RSS compiling cmd/internal/gc on amd64
before:
Maximum resident set size (kbytes): 659496
after:
Maximum resident set size (kbytes): 612196
- declare gc.Funcdepth as int32
- declare Node.Funcdepth as int32
In both cases, these were previously machine specific int types. This doesn't result in
any memory saving at the moment due to struct padding.
Change-Id: Iabef8da15e962fe8b79d7fd3d402fb26ce7ec31c
Reviewed-on: https://go-review.googlesource.com/7261
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
b353a69509
commit
e498181942
9 changed files with 29 additions and 29 deletions
|
|
@ -40,26 +40,26 @@ type Node struct {
|
|||
Nowritebarrier bool // emit compiler error instead of write barrier
|
||||
Walkdef uint8
|
||||
Typecheck uint8
|
||||
Local uint8
|
||||
Local bool
|
||||
Dodata uint8
|
||||
Initorder uint8
|
||||
Used bool
|
||||
Isddd bool // is the argument variadic
|
||||
Readonly bool
|
||||
Implicit bool
|
||||
Addrtaken bool // address taken, even if not moved to heap
|
||||
Assigned bool // is the variable ever assigned to
|
||||
Captured bool // is the variable captured by a closure
|
||||
Byval bool // is the variable captured by value or by reference
|
||||
Dupok bool // duplicate definitions ok (for func)
|
||||
Wrapper bool // is method wrapper (for func)
|
||||
Reslice bool // this is a reslice x = x[0:y] or x = append(x, ...)
|
||||
Likely int8 // likeliness of if statement
|
||||
Hasbreak bool // has break statement
|
||||
Needzero bool // if it contains pointers, needs to be zeroed on function entry
|
||||
Needctxt bool // function uses context register (has closure variables)
|
||||
Esc uint // EscXXX
|
||||
Funcdepth int
|
||||
Addrtaken bool // address taken, even if not moved to heap
|
||||
Assigned bool // is the variable ever assigned to
|
||||
Captured bool // is the variable captured by a closure
|
||||
Byval bool // is the variable captured by value or by reference
|
||||
Dupok bool // duplicate definitions ok (for func)
|
||||
Wrapper bool // is method wrapper (for func)
|
||||
Reslice bool // this is a reslice x = x[0:y] or x = append(x, ...)
|
||||
Likely int8 // likeliness of if statement
|
||||
Hasbreak bool // has break statement
|
||||
Needzero bool // if it contains pointers, needs to be zeroed on function entry
|
||||
Needctxt bool // function uses context register (has closure variables)
|
||||
Esc uint8 // EscXXX
|
||||
Funcdepth int32
|
||||
|
||||
// most nodes
|
||||
Type *Type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue