From 6cac100eefbe07ffd2c9bf64c9a782bf93d79081 Mon Sep 17 00:00:00 2001 From: David Chase Date: Mon, 24 Oct 2016 10:25:05 -0400 Subject: cmd/compile: add intrinsic for reading caller's pc First step towards removing the mandatory argument for getcallerpc, which solves certain problems for the runtime. This might also slightly improve performance. Intrinsic enabled on 386, amd64, amd64p32, runtime asm implementation removed on those architectures. Now-superfluous argument remains in getcallerpc signature (for a future CL; non-386/amd64 asm funcs ignore it). Added getcallerpc to the "not a real function" test in dcl.go, that story is a little odd with respect to unexported functions but that is not this CL. Fixes #17327. Change-Id: I5df1ad91f27ee9ac1f0dd88fa48f1329d6306c3e Reviewed-on: https://go-review.googlesource.com/31851 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/asm_amd64.s | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/runtime/asm_amd64.s') diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s index f992276794..d87f454e03 100644 --- a/src/runtime/asm_amd64.s +++ b/src/runtime/asm_amd64.s @@ -833,12 +833,6 @@ TEXT runtime·stackcheck(SB), NOSPLIT, $0-0 INT $3 RET -TEXT runtime·getcallerpc(SB),NOSPLIT,$8-16 - MOVQ argp+0(FP),AX // addr of first arg - MOVQ -8(AX),AX // get calling pc - MOVQ AX, ret+8(FP) - RET - // func cputicks() int64 TEXT runtime·cputicks(SB),NOSPLIT,$0-0 CMPB runtime·lfenceBeforeRdtsc(SB), $1 -- cgit v1.3-5-g9baa