Index: src/arm/fast-codegen-arm.cc |
diff --git a/src/arm/fast-codegen-arm.cc b/src/arm/fast-codegen-arm.cc |
index 04fff5ca1528a2dfaa7071426b669d47625ca65d..c177ed80b24f28cd9f5bc74437951aaeb462d816 100644 |
--- a/src/arm/fast-codegen-arm.cc |
+++ b/src/arm/fast-codegen-arm.cc |
@@ -1647,6 +1647,7 @@ void FastCodeGenerator::VisitCompareOperation(CompareOperation* expr) { |
// Convert current context to test context: End post-test code. |
} |
+ |
void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
__ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
Move(expr->context(), r0); |
@@ -1655,7 +1656,38 @@ void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) { |
Register FastCodeGenerator::result_register() { return r0; } |
-#undef __ |
+// ---------------------------------------------------------------------------- |
+// Non-local control flow support. |
+ |
+void FastCodeGenerator::EnterFinallyBlock() { |
+ // Cook return address in link register to stack (smi encoded Code* delta) |
+ __ sub(r1, lr, Operand(masm_->CodeObject())); |
+ ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
+ ASSERT_EQ(0, kSmiTag); |
+ __ add(r1, r1, Operand(r1)); // Convert to smi. |
+ __ push(r1); |
+ // Store result register while executing finally block. |
+ __ push(r0); |
+} |
+ |
+ |
+void FastCodeGenerator::ReturnFromFinallyBlock() { |
+ // Restore result register from stack. |
+ __ pop(r0); |
+ // Uncook return address and return. |
+ __ pop(r1); |
+ ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
+ __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
+ __ add(pc, r1, Operand(masm_->CodeObject())); |
+} |
+ |
+void FastCodeGenerator::ThrowException() { |
+ __ push(r0); |
+ __ CallRuntime(Runtime::kThrow, 1); |
+} |
+ |
+ |
+#undef __ |
} } // namespace v8::internal |