From: Austin Clements Date: Tue, 3 Feb 2015 14:18:15 +0000 (-0500) Subject: runtime: rearrange framepointer check condition X-Git-Tag: go1.5beta1~2171 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fc5baec37f65baf33a8b6777e576b85de62654ec;p=gostls13.git runtime: rearrange framepointer check condition The test for the framepointer experiment flag is cheaper and more branch-predictable than the other parts of this conditional, so move it first. This is also more readable. (Originally, the flag check required parsing the experiments string, which is why it was done last. Now that flag is cached.) Change-Id: I84e00fa7e939e9064f0fa0a4a6fe00576dd61457 Reviewed-on: https://go-review.googlesource.com/3782 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 4f63502e85..6c87d7e2e4 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -234,7 +234,7 @@ func gentraceback(pc0 uintptr, sp0 uintptr, lr0 uintptr, gp *g, skip int, pcbuf // If framepointer_enabled and there's a frame, then // there's a saved bp here. - if GOARCH == "amd64" && frame.varp > frame.sp && framepointer_enabled { + if framepointer_enabled && GOARCH == "amd64" && frame.varp > frame.sp { frame.varp -= regSize }