save return address in arm.cpp's MyAssembler::saveFrame

This is necessary to allow safe stack unwinding (e.g. for exception
handling and garbage collection) from native code.
This commit is contained in:
Joel Dice 2010-09-03 00:18:19 +01:00
parent a20d7e028b
commit bd01784249

View File

@ -1856,6 +1856,11 @@ class MyAssembler: public Assembler {
}
virtual void saveFrame(unsigned stackOffset, unsigned) {
Register returnAddress(LinkRegister);
Memory returnAddressDst
(StackRegister, arch_->returnAddressOffset() * BytesPerWord);
moveRM(&c, BytesPerWord, &returnAddress, BytesPerWord, &returnAddressDst);
Register stack(StackRegister);
Memory stackDst(ThreadRegister, stackOffset);
moveRM(&c, BytesPerWord, &stack, BytesPerWord, &stackDst);