Commit fc5baec3 authored by Austin Clements's avatar Austin Clements

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/3782Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 67a03fd6
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment