]> Cypherpunks repositories - gostls13.git/commit
cmd/5l, runtime: make ARM integer division profiler-friendly
authorRuss Cox <rsc@golang.org>
Wed, 30 Oct 2013 18:50:34 +0000 (18:50 +0000)
committerRuss Cox <rsc@golang.org>
Wed, 30 Oct 2013 18:50:34 +0000 (18:50 +0000)
commitb0db472ea29a9f8283888e0cb5f7545f86dbc32c
tree5f1ba31a9eadd7962dfe80fbb60e98c7bc16a65a
parent95ae85fb821671c49847a2d1d41f972b905f171b
cmd/5l, runtime: make ARM integer division profiler-friendly

The implementation of division constructed non-standard
stack frames that could not be handled by the traceback
routines.

CL 13239052 left the frames non-standard but fixed them
for the specific case of a divide-by-zero panic.
A profiling signal can arrive at any time, so that fix
is not sufficient.

Change the division to store the extra argument in the M struct
instead of in a new stack slot. That keeps the frames bog standard
at all times.

Also fix a related bug in the traceback code: when starting
a traceback, the LR register should be ignored if the current
function has already allocated its stack frame and saved the
original LR on the stack. The stack copy should be used, as the
LR register may have been modified.

Combined, these make the torture test from issue 6681 pass.

Fixes #6681.

R=golang-dev, r, josharian
CC=golang-dev
https://golang.org/cl/19810043
src/cmd/5l/noop.c
src/pkg/runtime/pprof/pprof_test.go
src/pkg/runtime/runtime.h
src/pkg/runtime/traceback_arm.c
src/pkg/runtime/vlop_arm.s