diff options
author | Cherry Zhang <cherryyz@google.com> | 2016-10-02 17:10:13 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2016-10-05 18:19:46 +0000 |
commit | 4c9a372946347304094cbf5306cce6336d11e64b (patch) | |
tree | e691158fb60dcabb54a3f84cc2ce09a5040ff6c4 /src/runtime/sys_ppc64x.go | |
parent | 56b746974cb8dcd44b09c3db384e8aeaae8a9d3e (diff) | |
download | go-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_ppc64x.go')
-rw-r--r-- | src/runtime/sys_ppc64x.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/runtime/sys_ppc64x.go b/src/runtime/sys_ppc64x.go index 2ea1f81ee3..796f27c4e3 100644 --- a/src/runtime/sys_ppc64x.go +++ b/src/runtime/sys_ppc64x.go @@ -19,21 +19,4 @@ func gostartcall(buf *gobuf, fn, ctxt unsafe.Pointer) { 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 uint32 - if buf.pc&3 == 0 && buf.pc != 0 { - inst = *(*uint32)(unsafe.Pointer(buf.pc)) - if inst>>26 == 18 && inst&3 == 0 { - //print("runtime: rewind pc=", hex(buf.pc), " to pc=", hex(uintptr(buf.pc + int32(inst<<6)>>6)), "\n"); - buf.pc += uintptr(int32(inst<<6) >> 6) - return - } - } - print("runtime: pc=", hex(buf.pc), " ", hex(inst), "\n") - throw("runtime: misuse of rewindmorestack") -} - func prepGoExitFrame(sp uintptr) |