Index: runtime/vm/stub_code_arm.cc |
=================================================================== |
--- runtime/vm/stub_code_arm.cc (revision 21660) |
+++ runtime/vm/stub_code_arm.cc (working copy) |
@@ -1474,16 +1474,39 @@ |
// Jump to the exception handler. |
-// No Result. |
+// LR: return address. |
+// R0: program_counter. |
+// R1: stack_pointer. |
+// R2: frame_pointer. |
+// R3: error object. |
+// SP: address of stacktrace object. |
+// Does not return. |
void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
- __ Unimplemented("JumpToExceptionHandler Stub"); |
+ ASSERT(kExceptionObjectReg == R0); |
+ ASSERT(kStackTraceObjectReg == R1); |
+ __ mov(LR, ShifterOperand(R0)); // Program counter. |
+ __ mov(R0, ShifterOperand(R3)); // Error object. |
+ __ ldr(R1, Address(SP, 0)); // Error object. |
zra
2013/04/18 15:45:25
Stacktrace object?
regis
2013/04/18 16:18:27
Done.
|
+ __ mov(FP, ShifterOperand(R2)); // Frame_pointer. |
+ __ mov(SP, ShifterOperand(R1)); // Stack pointer. |
zra
2013/04/18 15:45:25
Is R1 the stack pointer here? I thought it was alr
regis
2013/04/18 16:18:27
Good catch! This stub is only used when running on
|
+ __ bx(LR); // Jump to the exception handler code. |
} |
// Jump to the error handler. |
-// No Result. |
+// LR: return address. |
+// R0: program_counter. |
+// R1: stack_pointer. |
+// R2: frame_pointer. |
+// R3: error object. |
+// Does not return. |
void StubCode::GenerateJumpToErrorHandlerStub(Assembler* assembler) { |
- __ Unimplemented("JumpToErrorHandler Stub"); |
+ ASSERT(kExceptionObjectReg == R0); |
+ __ mov(LR, ShifterOperand(R0)); // Program counter. |
+ __ mov(R0, ShifterOperand(R3)); // Error object. |
+ __ mov(FP, ShifterOperand(R2)); // Frame_pointer. |
+ __ mov(SP, ShifterOperand(R1)); // Stack pointer. |
+ __ bx(LR); // Jump to the exception handler code. |
} |