diff options
author | Russ Cox <rsc@golang.org> | 2014-09-12 07:46:11 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-09-12 07:46:11 -0400 |
commit | 9ea01429fd02bdfe62a88d24de5fbb9d574a2f2e (patch) | |
tree | 74fa1dba900e37ddd2d333a1a90dd2290f41916f /src/runtime/asm_arm.s | |
parent | b7709832debee316ddf16c56c15d7806bce63e06 (diff) | |
download | go-9ea01429fd02bdfe62a88d24de5fbb9d574a2f2e.tar.gz |
runtime: stop scanning stack frames/args conservatively
The goal here is to commit fully to having precise information
about stack frames. If we need information we don't have,
crash instead of assuming we should scan conservatively.
Since the stack copying assumes fully precise information,
any crashes during garbage collection that are introduced by
this CL are crashes that could have happened during stack
copying instead. Those are harder to find because stacks are
copied much less often than the garbage collector is invoked.
In service of that goal, remove ARGSIZE macros from
asm_*.s, change switchtoM to have no arguments
(it doesn't have any live arguments), and add
args and locals information to some frames that
can call back into Go.
LGTM=khr
R=khr, rlh
CC=golang-codereviews
https://codereview.appspot.com/137540043
Diffstat (limited to 'src/runtime/asm_arm.s')
-rw-r--r-- | src/runtime/asm_arm.s | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s index a4524f919..368b4ad8e 100644 --- a/src/runtime/asm_arm.s +++ b/src/runtime/asm_arm.s @@ -77,9 +77,7 @@ nocgo: MOVW.W R0, -4(R13) MOVW $0, R0 MOVW.W R0, -4(R13) // push $0 as guard - ARGSIZE(12) BL runtime·newproc(SB) - ARGSIZE(-1) MOVW $12(R13), R13 // pop args and LR // start this M @@ -197,7 +195,7 @@ TEXT runtime·mcall(SB),NOSPLIT,$-4-4 // lives at the bottom of the G stack from the one that lives // at the top of the M stack because the one at the top of // the M stack terminates the stack walk (see topofstack()). -TEXT runtime·switchtoM(SB),NOSPLIT,$0-4 +TEXT runtime·switchtoM(SB),NOSPLIT,$0-0 MOVW $0, R0 BL (R0) // clobber lr to ensure push {lr} is kept RET @@ -258,7 +256,6 @@ oncurg: MOVW R3, SP // call target function - ARGSIZE(0) MOVW R0, R7 MOVW 0(R0), R0 BL (R0) @@ -490,6 +487,7 @@ TEXT runtime·asmcgocall(SB),NOSPLIT,$0-8 RET TEXT runtime·asmcgocall_errno(SB),NOSPLIT,$0-12 + GO_ARGS MOVW fn+0(FP), R1 MOVW arg+4(FP), R0 BL asmcgocall<>(SB) @@ -553,6 +551,9 @@ TEXT runtime·cgocallback(SB),NOSPLIT,$12-12 // cgocallback_gofunc(void (*fn)(void*), void *frame, uintptr framesize) // See cgocall.c for more details. TEXT runtime·cgocallback_gofunc(SB),NOSPLIT,$8-12 + GO_ARGS + NO_LOCAL_POINTERS + // Load m and g from thread-local storage. MOVB runtime·iscgo(SB), R0 CMP $0, R0 |