aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_arm.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-12 07:46:11 -0400
committerRuss Cox <rsc@golang.org>2014-09-12 07:46:11 -0400
commite844f53a0198e81b359d198fc0dcf15cf01d6ed1 (patch)
tree61fa2ae1685cb6f7ebc6d89d95d35dd0b830bd31 /src/runtime/asm_arm.s
parenta7c6d89166fd7bf6c9af6013cbfaa21971ba28f0 (diff)
downloadgo-e844f53a0198e81b359d198fc0dcf15cf01d6ed1.tar.xz
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://golang.org/cl/137540043
Diffstat (limited to 'src/runtime/asm_arm.s')
-rw-r--r--src/runtime/asm_arm.s9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/runtime/asm_arm.s b/src/runtime/asm_arm.s
index a4524f919b..368b4ad8e8 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