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 <bradfitz@golang.org>
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index 4f63502..6c87d7e 100644
--- a/src/runtime/traceback.go
+++ b/src/runtime/traceback.go
@@ -234,7 +234,7 @@
// 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
}