From: Cherry Mui Date: Fri, 18 Feb 2022 00:43:49 +0000 (-0500) Subject: runtime: define racefuncenter and racefuncexit as ABIInternal X-Git-Tag: go1.18~33^2~40 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d93cc8cb9639212ee674ecbc9149fb897dd8fd77;p=gostls13.git 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 --- diff --git a/src/runtime/race_arm64.s b/src/runtime/race_arm64.s index 798e23294a..59fade02ee 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);