From 4c9a372946347304094cbf5306cce6336d11e64b Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Sun, 2 Oct 2016 17:10:13 -0400 Subject: 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 --- src/runtime/stack.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/runtime/stack.go') diff --git a/src/runtime/stack.go b/src/runtime/stack.go index d022b8274b..90db4204a9 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -602,7 +602,7 @@ func adjustpointers(scanp unsafe.Pointer, cbv *bitvector, adjinfo *adjustinfo, f } if minp <= p && p < maxp { if stackDebug >= 3 { - print("adjust ptr ", p, " ", funcname(f), "\n") + print("adjust ptr ", hex(p), " ", funcname(f), "\n") } if useCAS { ppu := (*unsafe.Pointer)(unsafe.Pointer(pp)) @@ -957,7 +957,6 @@ func newstack() { thisg.m.morebuf.lr = 0 thisg.m.morebuf.sp = 0 thisg.m.morebuf.g = 0 - rewindmorestack(&gp.sched) // NOTE: stackguard0 may change underfoot, if another thread // is about to try to preempt gp. Read it just once and use that same -- cgit v1.3-5-g9baa