Eager re-sync-branch to keep Git history reasonably accurate, since
Git lacks a better way of encoding partial merges like CL 286172.
Conflicts:
- src/cmd/compile/internal/inline/inl.go
- src/cmd/compile/internal/noder/import.go
- src/cmd/compile/internal/noder/noder.go
Merge List:
+ 2021-01-25
063c72f06d [dev.regabi] cmd/compile: backport changes from dev.typeparams (
9456804)
+ 2021-01-23
d05d6fab32 [dev.regabi] cmd/compile: replace ir.Name map with ir.NameSet for SSA 2
+ 2021-01-23
48badc5fa8 [dev.regabi] cmd/compile: fix escape analysis problem with closures
+ 2021-01-23
51e1819a8d [dev.regabi] cmd/compile: scan body of closure in tooHairy to check for disallowed nodes
Change-Id: I48c0435f7aaf56f4aec26518a7459e9d95a51e9c
return true
case ir.OCLOSURE:
- // TODO(danscales) - fix some bugs when budget is lowered below 30
+ // TODO(danscales,mdempsky): Get working with -G.
+ // Probably after #43818 is fixed.
+ if base.Flag.G > 0 {
+ v.reason = "inlining closures not yet working with -G"
+ return true
+ }
+
+ // TODO(danscales) - fix some bugs when budget is lowered below 15
// Maybe make budget proportional to number of closure variables, e.g.:
//v.budget -= int32(len(n.(*ir.ClosureExpr).Func.ClosureVars) * 3)
- v.budget -= 30
+ v.budget -= 15
+ // Scan body of closure (which DoChildren doesn't automatically
+ // do) to check for disallowed ops in the body and include the
+ // body in the budget.
+ if doList(n.(*ir.ClosureExpr).Func.Body, v.do) {
+ return true
+ }
case ir.ORANGE,
ir.OSELECT,