aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_arm.s
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-10-27 15:20:21 -0400
committerAustin Clements <austin@google.com>2017-10-30 16:33:55 +0000
commit15d6ab69fbd8c84cde109def59c7e002296c19e8 (patch)
tree4e41f0e94965a21024d4c3bd13011edfea04922c /src/runtime/asm_arm.s
parent67a7d5d88503646a7e411cf5ae9c38e485b9be1b (diff)
downloadgo-15d6ab69fbd8c84cde109def59c7e002296c19e8.tar.gz
go-15d6ab69fbd8c84cde109def59c7e002296c19e8.zip
runtime: make systemstack tail call if already switched
Currently systemstack always calls its argument, even if we're already on the system stack. Unfortunately, traceback with _TraceJump stops at the first systemstack it sees, which often cuts off runtime stacks early in profiles. Fix this by performing a tail call if we're already on the system stack. This eliminates it from the traceback entirely, so it won't stop prematurely (or all get mushed into a single node in the profile graph). Change-Id: Ibc69e8765e899f8d3806078517b8c7314da196f4 Reviewed-on: https://go-review.googlesource.com/74050 Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/asm_arm.s')
-rw-r--r--src/runtime/asm_arm.s6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index caa96cc4b3..306984e8f7 100644
--- a/src/runtime/asm_arm.s
+++ b/src/runtime/asm_arm.s
@@ -358,10 +358,12 @@ switch:
RET
noswitch:
+ // Using a tail call here cleans up tracebacks since we won't stop
+ // at an intermediate systemstack.
MOVW R0, R7
MOVW 0(R0), R0
- BL (R0)
- RET
+ MOVW.P 4(R13), R14 // restore LR
+ B (R0)
/*
* support for morestack