]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove tracebackinit and unused skipPC
authorliu-xuewen <liiuxuewen@gmail.com>
Mon, 13 Jul 2020 09:15:38 +0000 (09:15 +0000)
committerKeith Randall <khr@golang.org>
Mon, 17 Aug 2020 21:05:19 +0000 (21:05 +0000)
CL [152537](https://go-review.googlesource.com/c/go/+/152537/) changed the way inlined frames are represented in tracebacks to no longer use skipPC

Change-Id: I42386fdcc5cf72f3c122e789b6af9cbd0c6bed4b
GitHub-Last-Rev: 79c26dcd532907eda4ffc30951845c1c01243501
GitHub-Pull-Request: golang/go#39829
Reviewed-on: https://go-review.googlesource.com/c/go/+/239701
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/asm.s
src/runtime/proc.go
src/runtime/traceback.go

index 95a3424de2613d98c1adc04e5225287efe9efbe7..27d8df9e063ecf8404e5da9ffa15b88c5f4fffbc 100644 (file)
 DATA runtime·no_pointers_stackmap+0x00(SB)/4, $2
 DATA runtime·no_pointers_stackmap+0x04(SB)/4, $0
 GLOBL runtime·no_pointers_stackmap(SB),RODATA, $8
-
-// NaCl requires that these skips be verifiable machine code.
-#ifdef GOARCH_amd64
-#define SKIP4 BYTE $0x90; BYTE $0x90; BYTE $0x90; BYTE $0x90
-#endif
-#ifdef GOARCH_386
-#define SKIP4 BYTE $0x90; BYTE $0x90; BYTE $0x90; BYTE $0x90
-#endif
-#ifdef GOARCH_wasm
-#define SKIP4 UNDEF; UNDEF; UNDEF; UNDEF
-#endif
-#ifndef SKIP4
-#define SKIP4 WORD $0
-#endif
-
-#define SKIP16 SKIP4; SKIP4; SKIP4; SKIP4
-#define SKIP64 SKIP16; SKIP16; SKIP16; SKIP16
-
-// This function must be sizeofSkipFunction bytes.
-TEXT runtime·skipPleaseUseCallersFrames(SB),NOSPLIT,$0-0
-       SKIP64; SKIP64; SKIP64; SKIP64
index ed7e2128aee8956eac3d64243bb98e2c90e3f4c1..9a358cd5291b23eede438596f6c0979a128e2089 100644 (file)
@@ -558,7 +558,6 @@ func schedinit() {
 
        sched.maxmcount = 10000
 
-       tracebackinit()
        moduledataverify()
        stackinit()
        mallocinit()
index 96e552524ed33c45371aa61eb3bb1579ef1d6c68..7850eceafa036914ec247e87315231a69c279e36 100644 (file)
@@ -36,16 +36,6 @@ import (
 
 const usesLR = sys.MinFrameSize > 0
 
-var skipPC uintptr
-
-func tracebackinit() {
-       // Go variable initialization happens late during runtime startup.
-       // Instead of initializing the variables above in the declarations,
-       // schedinit calls this function so that the variables are
-       // initialized and available earlier in the startup sequence.
-       skipPC = funcPC(skipPleaseUseCallersFrames)
-}
-
 // Traceback over the deferred function calls.
 // Report them like calls that have been invoked but not started executing yet.
 func tracebackdefers(gp *g, callback func(*stkframe, unsafe.Pointer) bool, v unsafe.Pointer) {
@@ -83,9 +73,6 @@ func tracebackdefers(gp *g, callback func(*stkframe, unsafe.Pointer) bool, v uns
 
 const sizeofSkipFunction = 256
 
-// This function is defined in asm.s to be sizeofSkipFunction bytes long.
-func skipPleaseUseCallersFrames()
-
 // Generic traceback. Handles runtime stack prints (pcbuf == nil),
 // the runtime.Callers function (pcbuf != nil), as well as the garbage
 // collector (callback != nil).  A little clunky to merge these, but avoids