fix ARM stack unwinding

We can't rely on the C++ compiler to save the return address in a
known location on entry to each function we might call from Java
(although GCC 4.5 seems to do so consistently, which is why I hadn't
realized the unwinding code was relying on that assumption), so we
must store it explicitly in MyThread::ip in each thunk.  For PowerPC
and x86, we continue saving it on the stack as always, since the
calling convention guarantees its location relative to the stack
pointer.
This commit is contained in:
Joel Dice
2011-02-19 20:33:26 -07:00
parent b2268143f5
commit 8a88c6ee3c
5 changed files with 29 additions and 13 deletions

View File

@ -2126,7 +2126,11 @@ class MyAssembler: public Assembler {
&handlerConstant);
}
virtual void saveFrame(unsigned stackOffset) {
virtual void saveFrame(unsigned stackOffset, unsigned ipOffset) {
Register link(LinkRegister);
Memory linkDst(ThreadRegister, ipOffset);
moveRM(&c, BytesPerWord, &link, BytesPerWord, &linkDst);
Register stack(StackRegister);
Memory stackDst(ThreadRegister, stackOffset);
moveRM(&c, BytesPerWord, &stack, BytesPerWord, &stackDst);