Skip to content

Commit d93cc8c

Browse files
committed
runtime: define racefuncenter and racefuncexit as ABIInternal
They are called from compiler instrumented code as ABIInternal. Define them as ABIInternal to avoid the wrappers and save some stack space, to avoid nosplit overflow in -race -N -l build. For #51247. Change-Id: Iadad7d6da8ac03780a7b02b03b004c52d34e020a Reviewed-on: https://go-review.googlesource.com/c/go/+/386715 Trust: Cherry Mui <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent 20b1772 commit d93cc8c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/runtime/race_arm64.s

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,12 @@ ret:
188188

189189
// func runtime·racefuncenter(pc uintptr)
190190
// Called from instrumented code.
191-
TEXT runtime·racefuncenter(SB), NOSPLIT, $0-8
191+
TEXT runtime·racefuncenter<ABIInternal>(SB), NOSPLIT, $0-8
192+
#ifdef GOEXPERIMENT_regabiargs
193+
MOVD R0, R9 // callpc
194+
#else
192195
MOVD callpc+0(FP), R9
196+
#endif
193197
JMP racefuncenter<>(SB)
194198

195199
// Common code for racefuncenter
@@ -205,7 +209,7 @@ TEXT racefuncenter<>(SB), NOSPLIT, $0-0
205209

206210
// func runtime·racefuncexit()
207211
// Called from instrumented code.
208-
TEXT runtime·racefuncexit(SB), NOSPLIT, $0-0
212+
TEXT runtime·racefuncexit<ABIInternal>(SB), NOSPLIT, $0-0
209213
load_g
210214
MOVD g_racectx(g), R0 // race context
211215
// void __tsan_func_exit(ThreadState *thr);

0 commit comments

Comments
 (0)