From 20a6ff7261adecc1ba0dc3f3cd6a29054fdf90b7 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 27 Jan 2015 18:29:02 -0500 Subject: runtime: eliminate uses of BP on amd64 Any place that clobbers BP in the runtime can potentially interfere with frame pointer unwinding with GOEXPERIMENT=framepointer. This change eliminates uses of BP in the runtime to address this problem. We have spare registers everywhere this occurs, so there's no downside to eliminating BP. Where possible, this uses the same new register as the amd64p32 runtime, which doesn't use BP due to restrictions placed on it by NaCL. One nice side effect of this is that it will let perf/VTune unwind the call stack even through a call to systemstack, which will let us get really good call graphs from the garbage collector. Change-Id: I0ffa14cb4dd2b613a7049b8ec59df37c52286212 Reviewed-on: https://go-review.googlesource.com/3390 Reviewed-by: Minux Ma Reviewed-by: Russ Cox --- src/runtime/sys_linux_amd64.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/runtime/sys_linux_amd64.s') diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s index 1125edd7fd..aac741b713 100644 --- a/src/runtime/sys_linux_amd64.s +++ b/src/runtime/sys_linux_amd64.s @@ -216,9 +216,9 @@ TEXT runtimeĀ·sigtramp(SB),NOSPLIT,$64 MOVQ R10, 40(SP) // g = m->gsignal - MOVQ g_m(R10), BP - MOVQ m_gsignal(BP), BP - MOVQ BP, g(BX) + MOVQ g_m(R10), AX + MOVQ m_gsignal(AX), AX + MOVQ AX, g(BX) MOVQ DI, 0(SP) MOVQ SI, 8(SP) -- cgit v1.3