mirror of
https://github.com/golang/go
synced 2024-09-28 20:14:28 -06:00
cmd/compile: small inlining tweak for range-func panics
treat the panic, like a panic. It helps with inlining, and thus reduced closure allocation and performance, for many examples of function range iterators. Change-Id: Ib1a656cdfa56eb2dee400089c4c94ac14f1d2104 Reviewed-on: https://go-review.googlesource.com/c/go/+/541235 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
b5e31780b6
commit
2380862c7c
@ -528,6 +528,8 @@ opSwitch:
|
||||
case "throw":
|
||||
v.budget -= inlineExtraThrowCost
|
||||
break opSwitch
|
||||
case "panicrangeexit":
|
||||
cheap = true
|
||||
}
|
||||
// Special case for reflect.noescape. It does just type
|
||||
// conversions to appease the escape analysis, and doesn't
|
||||
|
Loading…
Reference in New Issue
Block a user