aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/mips
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2025-02-11 15:02:08 -0800
committerKeith Randall <khr@golang.org>2025-04-25 12:21:48 -0700
commit3f3782feed6e0726ddb08afd32dad7d94fbb38c6 (patch)
tree1fdceec931e4169b405a1909f624b7987b1adc6b /src/cmd/internal/obj/mips
parentdc1e255104f3fee2589da61b7fa80627beb885f4 (diff)
downloadgo-3f3782feed6e0726ddb08afd32dad7d94fbb38c6.tar.xz
cmd/compile: allow all of the preamble to be preemptible
We currently make some parts of the preamble unpreemptible because it confuses morestack. See comments in the code. Instead, have morestack handle those weird cases so we can remove unpreemptible marks from most places. This CL makes user functions preemptible everywhere if they have no write barriers (at least, on x86). In cmd/go the fraction of functions that need preemptible markings drops from 82% to 36%. Makes the cmd/go binary 0.3% smaller. Update #35470 Change-Id: Ic83d5eabfd0f6d239a92e65684bcce7e67ff30bb Reviewed-on: https://go-review.googlesource.com/c/go/+/648518 Auto-Submit: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal/obj/mips')
-rw-r--r--src/cmd/internal/obj/mips/obj0.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/cmd/internal/obj/mips/obj0.go b/src/cmd/internal/obj/mips/obj0.go
index b9152fe57e..ef242c5f3b 100644
--- a/src/cmd/internal/obj/mips/obj0.go
+++ b/src/cmd/internal/obj/mips/obj0.go
@@ -767,12 +767,6 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
p.To.Type = obj.TYPE_REG
p.To.Reg = REG_R1
- // Mark the stack bound check and morestack call async nonpreemptible.
- // If we get preempted here, when resumed the preemption request is
- // cleared, but we'll still call morestack, which will double the stack
- // unnecessarily. See issue #35470.
- p = c.ctxt.StartUnsafePoint(p, c.newprog)
-
var q *obj.Prog
if framesize <= abi.StackSmall {
// small stack: SP < stackguard
@@ -876,8 +870,6 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog {
}
p.Mark |= BRANCH
- p = c.ctxt.EndUnsafePoint(p, c.newprog, -1)
-
// JMP start
p = obj.Appendp(p, c.newprog)