]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: define racefuncenter and racefuncexit as ABIInternal
authorCherry Mui <cherryyz@google.com>
Fri, 18 Feb 2022 00:43:49 +0000 (19:43 -0500)
committerCherry Mui <cherryyz@google.com>
Fri, 18 Feb 2022 18:46:44 +0000 (18:46 +0000)
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 <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/race_arm64.s

index 798e23294a0237663aec88a4da08e4c4d2bb2a25..59fade02eeeb451e1169a4caa106e6b84cf790e6 100644 (file)
@@ -188,8 +188,12 @@ ret:
 
 // func runtime·racefuncenter(pc uintptr)
 // Called from instrumented code.
-TEXT   runtime·racefuncenter(SB), NOSPLIT, $0-8
+TEXT   runtime·racefuncenter<ABIInternal>(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<ABIInternal>(SB), NOSPLIT, $0-0
        load_g
        MOVD    g_racectx(g), R0        // race context
        // void __tsan_func_exit(ThreadState *thr);