1
0
mirror of https://github.com/golang/go synced 2024-11-17 05:44:52 -07:00

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 <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Cherry Mui 2022-02-17 19:43:49 -05:00
parent 20b177268f
commit d93cc8cb96

View File

@ -188,8 +188,12 @@ ret:
// func runtime·racefuncenter(pc uintptr) // func runtime·racefuncenter(pc uintptr)
// Called from instrumented code. // 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 MOVD callpc+0(FP), R9
#endif
JMP racefuncenter<>(SB) JMP racefuncenter<>(SB)
// Common code for racefuncenter // Common code for racefuncenter
@ -205,7 +209,7 @@ TEXT racefuncenter<>(SB), NOSPLIT, $0-0
// func runtime·racefuncexit() // func runtime·racefuncexit()
// Called from instrumented code. // Called from instrumented code.
TEXT runtime·racefuncexit(SB), NOSPLIT, $0-0 TEXT runtime·racefuncexit<ABIInternal>(SB), NOSPLIT, $0-0
load_g load_g
MOVD g_racectx(g), R0 // race context MOVD g_racectx(g), R0 // race context
// void __tsan_func_exit(ThreadState *thr); // void __tsan_func_exit(ThreadState *thr);