]> Cypherpunks repositories - gostls13.git/commit
runtime, cmd/internal/obj: get rid of rewindmorestack
authorCherry Zhang <cherryyz@google.com>
Sun, 2 Oct 2016 21:10:13 +0000 (17:10 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 5 Oct 2016 18:19:46 +0000 (18:19 +0000)
commit4c9a372946347304094cbf5306cce6336d11e64b
treee691158fb60dcabb54a3f84cc2ce09a5040ff6c4
parent56b746974cb8dcd44b09c3db384e8aeaae8a9d3e
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>
13 files changed:
src/cmd/internal/obj/arm/obj5.go
src/cmd/internal/obj/arm64/obj7.go
src/cmd/internal/obj/pcln.go
src/cmd/internal/obj/ppc64/obj9.go
src/cmd/internal/obj/s390x/objz.go
src/cmd/internal/obj/x86/obj6.go
src/runtime/stack.go
src/runtime/sys_arm.go
src/runtime/sys_arm64.go
src/runtime/sys_mips64x.go
src/runtime/sys_ppc64x.go
src/runtime/sys_s390x.go
src/runtime/sys_x86.go