]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: clean up now unused pushCallSupported
authorJoel Sing <joel@sing.id.au>
Thu, 16 Apr 2020 05:33:53 +0000 (15:33 +1000)
committerJoel Sing <joel@sing.id.au>
Thu, 16 Apr 2020 15:31:20 +0000 (15:31 +0000)
All platforms now support pushCall, hence remove the now unnecessary
pushCallSupported flag/guard.

Change-Id: I99e4be73839da68a742f3c239bae9ce2f8764624
Reviewed-on: https://go-review.googlesource.com/c/go/+/228497
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/signal_386.go
src/runtime/signal_amd64.go
src/runtime/signal_arm.go
src/runtime/signal_arm64.go
src/runtime/signal_linux_s390x.go
src/runtime/signal_mips64x.go
src/runtime/signal_mipsx.go
src/runtime/signal_ppc64x.go
src/runtime/signal_riscv64.go
src/runtime/signal_unix.go

index 2f390f12f7d10c0341e8ceebbf5e6e14acc17ebe..95749d2cb25397291082c39557ab5711cd0fcdc8 100644 (file)
@@ -48,8 +48,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        }
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Make it look like the signaled instruction called target.
        pc := uintptr(c.eip())
index 29b6a9e7e6acd065981b73c2e981986163d0405f..63ffedbc87077103a49939a712f4b7717e6e1f54 100644 (file)
@@ -73,9 +73,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        }
 }
 
-// TODO: Remove pushCallSupported once all platforms support it.
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Make it look like the signaled instruction called target.
        pc := uintptr(c.rip())
index e1d19244a9790fe271026bc28bedb09d31fec340..b4b3ca458fcc2f4f6ed5d8ac0f7d578178d4a96a 100644 (file)
@@ -63,8 +63,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(uint32(funcPC(sigpanic)))
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
        // push the call. The function being pushed is responsible
index db2ab2720b769440d10d43c6d0fc96a0e0a8302c..ef65f92aa3e1332e350fb466a6ea02b1f70bd905 100644 (file)
@@ -79,8 +79,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(uint64(funcPC(sigpanic)))
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
        // push the call. The function being pushed is responsible
index 424dc59c9e8f2de69b19191b70e2e2f90fa3cd80..15f50351bb24b931d255a6d3eeca50d9fd7ab166 100644 (file)
@@ -110,8 +110,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(uint64(funcPC(sigpanic)))
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
        // push the call. The function being pushed is responsible
index 011db097277b2b9eb758340f4530045e5b0a4c08..6110b1c0232ba7694db1a8041432c392427c09e8 100644 (file)
@@ -85,8 +85,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(sigpanicPC)
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
        // push the call. The function being pushed is responsible
index edc38c043fdc4e942f5d3f248b1fde7fcbbf223e..cdbe193501bd354990530c29e67f6e4ad6a58263 100644 (file)
@@ -80,8 +80,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(uint32(funcPC(sigpanic)))
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
        // push the call. The function being pushed is responsible
index b879ea5269ccf4f2980a48e6d0a5c93fb142b43c..2da09d378ae5a8036283a259ab829318e6b5de9a 100644 (file)
@@ -86,8 +86,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(uint64(funcPC(sigpanic)))
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
        // push the call. The function being pushed is responsible
index 7da69b287bd1a573cb2e4c092afa92df80bea281..e2edaf3735add9acbdff2bdc914958d2a909f295 100644 (file)
@@ -78,8 +78,6 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) {
        c.set_pc(uint64(funcPC(sigpanic)))
 }
 
-const pushCallSupported = true
-
 func (c *sigctxt) pushCall(targetPC uintptr) {
        // Push the LR to stack, as we'll clobber it in order to
        // push the call. The function being pushed is responsible
index 5dbfbaf4b14ba27cfa1acd0640a52d290e15c135..c33f88b046e81d663450e1f92ee85de4e1587fd3 100644 (file)
@@ -336,7 +336,7 @@ func doSigPreempt(gp *g, ctxt *sigctxt) {
        atomic.Store(&gp.m.signalPending, 0)
 }
 
-const preemptMSupported = pushCallSupported
+const preemptMSupported = true
 
 // preemptM sends a preemption request to mp. This request may be
 // handled asynchronously and may be coalesced with other requests to
@@ -345,11 +345,6 @@ const preemptMSupported = pushCallSupported
 // safe-point, it will preempt the goroutine. It always atomically
 // increments mp.preemptGen after handling a preemption request.
 func preemptM(mp *m) {
-       if !pushCallSupported {
-               // This architecture doesn't support ctxt.pushCall
-               // yet, so doSigPreempt won't work.
-               return
-       }
        if GOOS == "darwin" && GOARCH == "arm64" && !iscgo {
                // On darwin, we use libc calls, and cgo is required on ARM64
                // so we have TLS set up to save/restore G during C calls. If cgo is