aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_s390x.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2016-10-02 17:10:13 -0400
committerCherry Zhang <cherryyz@google.com>2016-10-05 18:19:46 +0000
commit4c9a372946347304094cbf5306cce6336d11e64b (patch)
treee691158fb60dcabb54a3f84cc2ce09a5040ff6c4 /src/runtime/sys_s390x.go
parent56b746974cb8dcd44b09c3db384e8aeaae8a9d3e (diff)
downloadgo-4c9a372946347304094cbf5306cce6336d11e64b.tar.gz
go-4c9a372946347304094cbf5306cce6336d11e64b.zip
runtime, cmd/internal/obj: get rid of rewindmorestack
In the function prologue, we emit a jump to the beginning of the function immediately after calling morestack. And in the runtime stack growing code, it decodes and emulates that jump. This emulation was necessary before we had per-PC SP deltas, since the traceback code assumed that the frame size was fixed for the whole function, except on the first instruction where it was 0. Since we now have per-PC SP deltas and PCDATA, we can correctly record that the frame size is 0. This makes the emulation unnecessary. This may be helpful for registerized calling convention, where there may be unspills of arguments after calling morestack. It also simplifies the runtime. Change-Id: I7ebee31eaee81795445b33f521ab6a79624c4ceb Reviewed-on: https://go-review.googlesource.com/30138 Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/sys_s390x.go')
-rw-r--r--src/runtime/sys_s390x.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/runtime/sys_s390x.go b/src/runtime/sys_s390x.go
index 2aa81e75c0..e710840819 100644
--- a/src/runtime/sys_s390x.go
+++ b/src/runtime/sys_s390x.go
@@ -16,30 +16,3 @@ func gostartcall(buf *gobuf, fn, ctxt unsafe.Pointer) {
buf.pc = uintptr(fn)
buf.ctxt = ctxt
}
-
-// Called to rewind context saved during morestack back to beginning of function.
-// To help us, the linker emits a jmp back to the beginning right after the
-// call to morestack. We just have to decode and apply that jump.
-func rewindmorestack(buf *gobuf) {
- var inst uint64
- if buf.pc&1 == 0 && buf.pc != 0 {
- inst = *(*uint64)(unsafe.Pointer(buf.pc))
- switch inst >> 48 {
- case 0xa7f4: // BRC (branch relative on condition) instruction.
- inst >>= 32
- inst &= 0xFFFF
- offset := int64(int16(inst))
- offset <<= 1
- buf.pc += uintptr(offset)
- return
- case 0xc0f4: // BRCL (branch relative on condition long) instruction.
- inst >>= 16
- inst = inst & 0xFFFFFFFF
- inst = (inst << 1) & 0xFFFFFFFF
- buf.pc += uintptr(int32(inst))
- return
- }
- }
- print("runtime: pc=", hex(buf.pc), " ", hex(inst), "\n")
- throw("runtime: misuse of rewindmorestack")
-}