Skip to content

Commit ba97be4

Browse files
liu-xuewenrandall77
authored andcommitted
runtime: remove tracebackinit and unused skipPC
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: 79c26dc GitHub-Pull-Request: golang#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>
1 parent 17553c6 commit ba97be4

File tree

3 files changed

+0
-35
lines changed

3 files changed

+0
-35
lines changed

src/runtime/asm.s

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,3 @@
1111
DATA runtime·no_pointers_stackmap+0x00(SB)/4, $2
1212
DATA runtime·no_pointers_stackmap+0x04(SB)/4, $0
1313
GLOBL runtime·no_pointers_stackmap(SB),RODATA, $8
14-
15-
// NaCl requires that these skips be verifiable machine code.
16-
#ifdef GOARCH_amd64
17-
#define SKIP4 BYTE $0x90; BYTE $0x90; BYTE $0x90; BYTE $0x90
18-
#endif
19-
#ifdef GOARCH_386
20-
#define SKIP4 BYTE $0x90; BYTE $0x90; BYTE $0x90; BYTE $0x90
21-
#endif
22-
#ifdef GOARCH_wasm
23-
#define SKIP4 UNDEF; UNDEF; UNDEF; UNDEF
24-
#endif
25-
#ifndef SKIP4
26-
#define SKIP4 WORD $0
27-
#endif
28-
29-
#define SKIP16 SKIP4; SKIP4; SKIP4; SKIP4
30-
#define SKIP64 SKIP16; SKIP16; SKIP16; SKIP16
31-
32-
// This function must be sizeofSkipFunction bytes.
33-
TEXT runtime·skipPleaseUseCallersFrames(SB),NOSPLIT,$0-0
34-
SKIP64; SKIP64; SKIP64; SKIP64

src/runtime/proc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,6 @@ func schedinit() {
558558

559559
sched.maxmcount = 10000
560560

561-
tracebackinit()
562561
moduledataverify()
563562
stackinit()
564563
mallocinit()

src/runtime/traceback.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ import (
3636

3737
const usesLR = sys.MinFrameSize > 0
3838

39-
var skipPC uintptr
40-
41-
func tracebackinit() {
42-
// Go variable initialization happens late during runtime startup.
43-
// Instead of initializing the variables above in the declarations,
44-
// schedinit calls this function so that the variables are
45-
// initialized and available earlier in the startup sequence.
46-
skipPC = funcPC(skipPleaseUseCallersFrames)
47-
}
48-
4939
// Traceback over the deferred function calls.
5040
// Report them like calls that have been invoked but not started executing yet.
5141
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
8373

8474
const sizeofSkipFunction = 256
8575

86-
// This function is defined in asm.s to be sizeofSkipFunction bytes long.
87-
func skipPleaseUseCallersFrames()
88-
8976
// Generic traceback. Handles runtime stack prints (pcbuf == nil),
9077
// the runtime.Callers function (pcbuf != nil), as well as the garbage
9178
// collector (callback != nil). A little clunky to merge these, but avoids

0 commit comments

Comments
 (0)