should be simple enough, the number of AST nodes must less than the budget (80); function doesn't contain complex things like closures, defer, recover, select, etc; function isn't prefixed by go:noinline; function isn't prefixed by go:uintptrescapes, since the escape information will be lost during inlining; function has body; etc. 登場した背景 6
{ // No inlining nor devirtualization performed on b.Loop body if base.Flag.LowerM > 1 { fmt.Printf("%v: skip inlining within testing.B.loop for %v\n", ir.Line(n), n) } // We still want to explore inlining opportunities in other parts of ForStmt. nFor, _ := n.(*ir.ForStmt) nForInit := nFor.Init() for i, x := range nForInit { if x != nil { nForInit[i] = s.mark(x) } } if nFor.Cond != nil { nFor.Cond = s.mark(nFor.Cond) } if nFor.Post != nil { nFor.Post = s.mark(nFor.Post) } return n } (--以下略--) src/cmd/compile/internal/inline/interleaved/interleaved.go どのようにしてインライン展開を防ぐのか? 11