]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.typeparams] all: merge dev.regabi (063c72f) into dev.typeparams
authorMatthew Dempsky <mdempsky@google.com>
Mon, 25 Jan 2021 01:36:59 +0000 (17:36 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 25 Jan 2021 01:37:23 +0000 (17:37 -0800)
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

1  2 
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/noder/import.go

index f0be169f561deb84513c46fe0eec7b4aebf27fe1,9f9bb87dd5397217f49d23d5c3bc99f1f374d3f4..bbbdaa63d4b3448e8ad53d5bf93537420dc89aeb
@@@ -354,17 -354,16 +354,23 @@@ func (v *hairyVisitor) doNode(n ir.Node
                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,