1
0
mirror of https://github.com/golang/go synced 2024-11-19 13:54:56 -07:00

runtime: fix silly frame sizes on arm and arm64

"-8" is not a sensible frame size on arm and we're about to start
rejecting it. Replace it with -4.

Likewise, "-4" is not a sensible frame size on arm64 and we're about
to start rejecting it. Replace it with -8.

Finally, clean up some places we're weirdly inconsistent about using 0
versus -8.

Change-Id: If85e229993d5f7f1f0cfa9852b4e294d053bd784
Reviewed-on: https://go-review.googlesource.com/92038
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Austin Clements 2018-01-25 13:57:37 -05:00
parent 495174302f
commit 8a064c6008
5 changed files with 21 additions and 21 deletions

View File

@ -300,7 +300,7 @@ TEXT runtime·morestack(SB),NOSPLIT,$-8-0
// is still in this function, and not the beginning of the next.
UNDEF
TEXT runtime·morestack_noctxt(SB),NOSPLIT,$-4-0
TEXT runtime·morestack_noctxt(SB),NOSPLIT,$-8-0
MOVW $0, R26
B runtime·morestack(SB)
@ -745,7 +745,7 @@ eq:
MOVB R3, ret+16(FP)
RET
TEXT runtime·cmpstring(SB),NOSPLIT,$-4-40
TEXT runtime·cmpstring(SB),NOSPLIT,$-8-40
MOVD s1_base+0(FP), R2
MOVD s1_len+8(FP), R0
MOVD s2_base+16(FP), R3
@ -753,7 +753,7 @@ TEXT runtime·cmpstring(SB),NOSPLIT,$-4-40
ADD $40, RSP, R7
B runtime·cmpbody<>(SB)
TEXT bytes·Compare(SB),NOSPLIT,$-4-56
TEXT bytes·Compare(SB),NOSPLIT,$-8-56
MOVD s1+0(FP), R2
MOVD s1+8(FP), R0
MOVD s2+24(FP), R3
@ -770,7 +770,7 @@ TEXT bytes·Compare(SB),NOSPLIT,$-4-56
//
// On exit:
// R4, R5, and R6 are clobbered
TEXT runtime·cmpbody<>(SB),NOSPLIT,$-4-0
TEXT runtime·cmpbody<>(SB),NOSPLIT,$-8-0
CMP R2, R3
BEQ samebytes // same starting pointers; compare lengths
CMP R0, R1

View File

@ -29,10 +29,10 @@ ok:
TEXT runtimeinternalatomic·Casuintptr(SB), NOSPLIT, $0-25
B runtimeinternalatomic·Cas64(SB)
TEXT runtimeinternalatomic·Loaduintptr(SB), NOSPLIT, $-8-16
TEXT runtimeinternalatomic·Loaduintptr(SB), NOSPLIT, $0-16
B runtimeinternalatomic·Load64(SB)
TEXT runtimeinternalatomic·Loaduint(SB), NOSPLIT, $-8-16
TEXT runtimeinternalatomic·Loaduint(SB), NOSPLIT, $0-16
B runtimeinternalatomic·Load64(SB)
TEXT runtimeinternalatomic·Storeuintptr(SB), NOSPLIT, $0-16

View File

@ -5,21 +5,21 @@
#include "textflag.h"
// uint32 runtimeinternalatomic·Load(uint32 volatile* addr)
TEXT ·Load(SB),NOSPLIT,$-8-12
TEXT ·Load(SB),NOSPLIT,$0-12
MOVD ptr+0(FP), R0
LDARW (R0), R0
MOVW R0, ret+8(FP)
RET
// uint64 runtimeinternalatomic·Load64(uint64 volatile* addr)
TEXT ·Load64(SB),NOSPLIT,$-8-16
TEXT ·Load64(SB),NOSPLIT,$0-16
MOVD ptr+0(FP), R0
LDAR (R0), R0
MOVD R0, ret+8(FP)
RET
// void *runtimeinternalatomic·Loadp(void *volatile *addr)
TEXT ·Loadp(SB),NOSPLIT,$-8-16
TEXT ·Loadp(SB),NOSPLIT,$0-16
MOVD ptr+0(FP), R0
LDAR (R0), R0
MOVD R0, ret+8(FP)

View File

@ -74,7 +74,7 @@ TEXT runtime·thr_start(SB),NOSPLIT,$0
RET
// Exit the entire program (like C exit)
TEXT runtime·exit(SB),NOSPLIT,$-8
TEXT runtime·exit(SB),NOSPLIT,$-4
MOVW code+0(FP), R0 // arg 1 exit status
MOVW $SYS_exit, R7
SWI $0
@ -99,7 +99,7 @@ storeloop:
MOVW.CS R8, (R8)
JMP 0(PC)
TEXT runtime·open(SB),NOSPLIT,$-8
TEXT runtime·open(SB),NOSPLIT,$-4
MOVW name+0(FP), R0 // arg 1 name
MOVW mode+4(FP), R1 // arg 2 mode
MOVW perm+8(FP), R2 // arg 3 perm
@ -109,7 +109,7 @@ TEXT runtime·open(SB),NOSPLIT,$-8
MOVW R0, ret+12(FP)
RET
TEXT runtime·read(SB),NOSPLIT,$-8
TEXT runtime·read(SB),NOSPLIT,$-4
MOVW fd+0(FP), R0 // arg 1 fd
MOVW p+4(FP), R1 // arg 2 buf
MOVW n+8(FP), R2 // arg 3 count
@ -119,7 +119,7 @@ TEXT runtime·read(SB),NOSPLIT,$-8
MOVW R0, ret+12(FP)
RET
TEXT runtime·write(SB),NOSPLIT,$-8
TEXT runtime·write(SB),NOSPLIT,$-4
MOVW fd+0(FP), R0 // arg 1 fd
MOVW p+4(FP), R1 // arg 2 buf
MOVW n+8(FP), R2 // arg 3 count
@ -129,7 +129,7 @@ TEXT runtime·write(SB),NOSPLIT,$-8
MOVW R0, ret+12(FP)
RET
TEXT runtime·closefd(SB),NOSPLIT,$-8
TEXT runtime·closefd(SB),NOSPLIT,$-4
MOVW fd+0(FP), R0 // arg 1 fd
MOVW $SYS_close, R7
SWI $0
@ -137,7 +137,7 @@ TEXT runtime·closefd(SB),NOSPLIT,$-8
MOVW R0, ret+4(FP)
RET
TEXT runtime·getrlimit(SB),NOSPLIT,$-8
TEXT runtime·getrlimit(SB),NOSPLIT,$-4
MOVW kind+0(FP), R0
MOVW limit+4(FP), R1
MOVW $SYS_getrlimit, R7
@ -168,7 +168,7 @@ TEXT runtime·raiseproc(SB),NOSPLIT,$0
SWI $0
RET
TEXT runtime·setitimer(SB), NOSPLIT, $-8
TEXT runtime·setitimer(SB), NOSPLIT, $-4
MOVW mode+0(FP), R0
MOVW new+4(FP), R1
MOVW old+8(FP), R2
@ -216,7 +216,7 @@ TEXT runtime·nanotime(SB), NOSPLIT, $32
MOVW R1, ret_hi+4(FP)
RET
TEXT runtime·sigaction(SB),NOSPLIT,$-8
TEXT runtime·sigaction(SB),NOSPLIT,$-4
MOVW sig+0(FP), R0 // arg 1 sig
MOVW new+4(FP), R1 // arg 2 act
MOVW old+8(FP), R2 // arg 3 oact
@ -283,7 +283,7 @@ TEXT runtime·madvise(SB),NOSPLIT,$0
// ignore failure - maybe pages are locked
RET
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
TEXT runtime·sigaltstack(SB),NOSPLIT,$-4
MOVW new+0(FP), R0
MOVW old+4(FP), R1
MOVW $SYS_sigaltstack, R7

View File

@ -33,7 +33,7 @@ storeloop:
MOVW R8, (R8)
JMP 0(PC)
TEXT runtime·open(SB),NOSPLIT,$-8
TEXT runtime·open(SB),NOSPLIT,$-4
MOVW name+0(FP), R0
MOVW mode+4(FP), R1
MOVW perm+8(FP), R2
@ -42,14 +42,14 @@ TEXT runtime·open(SB),NOSPLIT,$-8
MOVW R0, ret+12(FP)
RET
TEXT runtime·closefd(SB),NOSPLIT,$-8
TEXT runtime·closefd(SB),NOSPLIT,$-4
MOVW fd+0(FP), R0
SWI $0xa00006
MOVW.CS $-1, R0
MOVW R0, ret+4(FP)
RET
TEXT runtime·read(SB),NOSPLIT,$-8
TEXT runtime·read(SB),NOSPLIT,$-4
MOVW fd+0(FP), R0
MOVW p+4(FP), R1
MOVW n+8(FP), R2