diff options
| author | Russ Cox <rsc@golang.org> | 2021-01-28 16:22:52 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-02-19 00:02:49 +0000 |
| commit | 54da3ab385686dec5554164ba9558214445deec9 (patch) | |
| tree | 93bad7fe11b54fde70f0580d0c0e1766b68e730b /src/runtime/asm_amd64.s | |
| parent | fbe74dbf4263841819368a2a3c90e599392e0808 (diff) | |
| download | go-54da3ab385686dec5554164ba9558214445deec9.tar.xz | |
runtime: use TOPFRAME to identify top-of-frame functions
No change to actual runtime, but helps reduce the laundry list
of functions.
mcall, morestack, and asmcgocall are not actually top-of-frame,
so those need more attention in follow-up CLs.
mstart moved to assembly so that it can be marked TOPFRAME.
Since TOPFRAME also tells DWARF consumers not to unwind
this way, this change should also improve debuggers a
marginal amount.
This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
This CL is, however, not windows/arm64-specific.
It is cleanup meant to make the port (and future ports) easier.
Change-Id: If1e0d46ca973de5e46b62948d076f675f285b5d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/288802
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/asm_amd64.s')
| -rw-r--r-- | src/runtime/asm_amd64.s | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s index 8ee2ac2123..a68dc72ae5 100644 --- a/src/runtime/asm_amd64.s +++ b/src/runtime/asm_amd64.s @@ -84,7 +84,7 @@ GLOBL _rt0_amd64_lib_argc<>(SB),NOPTR, $8 DATA _rt0_amd64_lib_argv<>(SB)/8, $0 GLOBL _rt0_amd64_lib_argv<>(SB),NOPTR, $8 -TEXT runtime·rt0_go(SB),NOSPLIT,$0 +TEXT runtime·rt0_go(SB),NOSPLIT|TOPFRAME,$0 // copy arguments forward on an even stack MOVQ DI, AX // argc MOVQ SI, BX // argv @@ -250,6 +250,10 @@ TEXT runtime·asminit(SB),NOSPLIT,$0-0 // No per-thread init. RET +TEXT runtime·mstart(SB),NOSPLIT|TOPFRAME,$0 + CALL runtime·mstart0(SB) + RET // not reached + /* * go-routine */ @@ -1440,7 +1444,7 @@ TEXT _cgo_topofstack(SB),NOSPLIT,$0 // so as to make it identifiable to traceback (this // function it used as a sentinel; traceback wants to // see the func PC, not a wrapper PC). -TEXT runtime·goexit<ABIInternal>(SB),NOSPLIT,$0-0 +TEXT runtime·goexit<ABIInternal>(SB),NOSPLIT|TOPFRAME,$0-0 BYTE $0x90 // NOP CALL runtime·goexit1(SB) // does not return // traceback from goexit1 must hit code range of goexit |
