From d93cc8cb9639212ee674ecbc9149fb897dd8fd77 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Thu, 17 Feb 2022 19:43:49 -0500 Subject: [PATCH] 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 Run-TryBot: Cherry Mui TryBot-Result: Gopher Robot Reviewed-by: Michael Knyszek --- src/runtime/race_arm64.s | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtime/race_arm64.s b/src/runtime/race_arm64.s index 798e23294a0..59fade02eee 100644 --- a/src/runtime/race_arm64.s +++ b/src/runtime/race_arm64.s @@ -188,8 +188,12 @@ ret: // func runtime·racefuncenter(pc uintptr) // Called from instrumented code. -TEXT runtime·racefuncenter(SB), NOSPLIT, $0-8 +TEXT runtime·racefuncenter(SB), NOSPLIT, $0-8 +#ifdef GOEXPERIMENT_regabiargs + MOVD R0, R9 // callpc +#else MOVD callpc+0(FP), R9 +#endif JMP racefuncenter<>(SB) // Common code for racefuncenter @@ -205,7 +209,7 @@ TEXT racefuncenter<>(SB), NOSPLIT, $0-0 // func runtime·racefuncexit() // Called from instrumented code. -TEXT runtime·racefuncexit(SB), NOSPLIT, $0-0 +TEXT runtime·racefuncexit(SB), NOSPLIT, $0-0 load_g MOVD g_racectx(g), R0 // race context // void __tsan_func_exit(ThreadState *thr);