Index: src/mips/full-codegen-mips.cc |
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc |
index ec2a248060b143e04ad3b882abe0de5e025c4bce..4525247462fcbb2a72f7d32a1848f93d6441c74e 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -4293,6 +4293,34 @@ void FullCodeGenerator::ExitFinallyBlock() { |
#undef __ |
+#define __ ACCESS_MASM(masm()) |
+ |
+FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( |
+ int* stack_depth, |
+ int* context_length) { |
+ // The macros used here must preserve the result register. |
+ |
+ // Because the handler block contains the context of the finally |
+ // code, we can restore it directly from there for the finally code |
+ // rather than iteratively unwinding contexts via their previous |
+ // links. |
+ __ Drop(*stack_depth); // Down to the handler block. |
+ if (*context_length > 0) { |
+ // Restore the context to its dedicated register and the stack. |
+ __ lw(cp, MemOperand(sp, StackHandlerConstants::kContextOffset)); |
+ __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ } |
+ __ PopTryHandler(); |
+ __ Call(finally_entry_); |
+ |
+ *stack_depth = 0; |
+ *context_length = 0; |
+ return previous_; |
+} |
+ |
+ |
+#undef __ |
+ |
} } // namespace v8::internal |
#endif // V8_TARGET_ARCH_MIPS |