mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: change Func.Inldcl from []*Node to *[]*Node
Save a few bytes in Func. Passes toolstash -cmp. Update #14473. Change-Id: I824fa7d5cb2d93f6f59938ccd86114abcbea0043 Reviewed-on: https://go-review.googlesource.com/19968 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
52d9479e3b
commit
6abc8c9a88
3 changed files with 11 additions and 4 deletions
|
|
@ -150,7 +150,10 @@ func caninl(fn *Node) {
|
||||||
|
|
||||||
fn.Func.Nname.Func.Inl = fn.Nbody
|
fn.Func.Nname.Func.Inl = fn.Nbody
|
||||||
fn.Nbody = inlcopylist(fn.Func.Nname.Func.Inl)
|
fn.Nbody = inlcopylist(fn.Func.Nname.Func.Inl)
|
||||||
fn.Func.Nname.Func.Inldcl = inlcopyslice(fn.Func.Nname.Name.Defn.Func.Dcl)
|
inldcl := inlcopyslice(fn.Func.Nname.Name.Defn.Func.Dcl)
|
||||||
|
if len(inldcl) > 0 {
|
||||||
|
fn.Func.Nname.Func.Inldcl = &inldcl
|
||||||
|
}
|
||||||
fn.Func.Nname.Func.InlCost = int32(maxBudget - budget)
|
fn.Func.Nname.Func.InlCost = int32(maxBudget - budget)
|
||||||
|
|
||||||
// hack, TODO, check for better way to link method nodes back to the thing with the ->inl
|
// hack, TODO, check for better way to link method nodes back to the thing with the ->inl
|
||||||
|
|
@ -569,9 +572,13 @@ func mkinlcall1(np **Node, fn *Node, isddd bool) {
|
||||||
//dumplist("ninit pre", ninit);
|
//dumplist("ninit pre", ninit);
|
||||||
|
|
||||||
var dcl []*Node
|
var dcl []*Node
|
||||||
if fn.Name.Defn != nil { // local function
|
if fn.Name.Defn != nil {
|
||||||
dcl = fn.Func.Inldcl // imported function
|
// local function
|
||||||
|
if fn.Func.Inldcl != nil {
|
||||||
|
dcl = *fn.Func.Inldcl
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// imported function
|
||||||
dcl = fn.Func.Dcl
|
dcl = fn.Func.Dcl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ type Func struct {
|
||||||
Exit *NodeList
|
Exit *NodeList
|
||||||
cvars *[]*Node // closure params
|
cvars *[]*Node // closure params
|
||||||
Dcl []*Node // autodcl for this func/closure
|
Dcl []*Node // autodcl for this func/closure
|
||||||
Inldcl []*Node // copy of dcl for use in inlining
|
Inldcl *[]*Node // copy of dcl for use in inlining
|
||||||
Closgen int
|
Closgen int
|
||||||
Outerfunc *Node
|
Outerfunc *Node
|
||||||
Fieldtrack []*Type
|
Fieldtrack []*Type
|
||||||
|
|
|
||||||
BIN
src/cmd/compile/internal/gc/test
Executable file
BIN
src/cmd/compile/internal/gc/test
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue