diff options
| author | qmuntal <quimmuntal@gmail.com> | 2023-02-08 16:51:34 +0100 |
|---|---|---|
| committer | Quim Muntal <quimmuntal@gmail.com> | 2023-03-01 17:28:41 +0000 |
| commit | d20e688fcff2e5cc0d5fcc85dc5cc69ce92f919b (patch) | |
| tree | e8e43c85036fa89faf9be7d515c711a40f2fb104 /src/cmd | |
| parent | a5f3cb6f75f31ea7336ce87375cbc30c73360def (diff) | |
| download | go-d20e688fcff2e5cc0d5fcc85dc5cc69ce92f919b.tar.xz | |
runtime: remove implicit NOFRAME heuristic support
All amd64 OSes already make use of the NOFRAME flag wherever is
required, so we can remove the frameless nosplit functions heuristic
code path.
Updates #58378
Change-Id: I966970693ba07f8c66da0aca83c23caad7cbbfe5
Reviewed-on: https://go-review.googlesource.com/c/go/+/466458
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/internal/obj/x86/obj6.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/cmd/internal/obj/x86/obj6.go b/src/cmd/internal/obj/x86/obj6.go index 395a0a7919..fc0a9c4484 100644 --- a/src/cmd/internal/obj/x86/obj6.go +++ b/src/cmd/internal/obj/x86/obj6.go @@ -614,27 +614,15 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) { } } - var usefpheuristic bool - switch ctxt.Headtype { - case objabi.Hwindows, objabi.Hdarwin, objabi.Hlinux, objabi.Hdragonfly, - objabi.Hfreebsd, objabi.Hnetbsd, objabi.Hopenbsd, objabi.Hsolaris, objabi.Hplan9: - default: - usefpheuristic = true - } - var bpsize int if ctxt.Arch.Family == sys.AMD64 && !p.From.Sym.NoFrame() && // (1) below - !(autoffset == 0 && p.From.Sym.NoSplit() && usefpheuristic) && // (2) below - !(autoffset == 0 && !hasCall) { // (3) below + !(autoffset == 0 && !hasCall) { // (2) below // Make room to save a base pointer. // There are 2 cases we must avoid: // 1) If noframe is set (which we do for functions which tail call). - // 2) Scary runtime internals which would be all messed up by frame pointers. - // We detect these using a heuristic: frameless nosplit functions. - // TODO: Maybe someday we label them all with NOFRAME and get rid of this heuristic. // For performance, we also want to avoid: - // 3) Frameless leaf functions + // 2) Frameless leaf functions bpsize = ctxt.Arch.PtrSize autoffset += int32(bpsize) p.To.Offset += int64(bpsize) |
