Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index be85fa15be8d3888bf27b28f0c2faaf788eccb12..bd3d2e697486b3486a2131aa6801556e183133c4 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -3712,7 +3712,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { |
// r3: argc |
// [sp+0]: argv |
- Label invoke, exit; |
+ Label invoke, handler_entry, exit; |
// Called from C, so do not pop argc and args on exit (preserve sp) |
// No need to save register-passed args |
@@ -3775,23 +3775,26 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { |
__ bind(&cont); |
__ push(ip); |
- // Call a faked try-block that does the invoke. |
- __ bl(&invoke); |
- |
- // Caught exception: Store result (exception) in the pending |
- // exception field in the JSEnv and return a failure sentinel. |
- // Coming in here the fp will be invalid because the PushTryHandler below |
- // sets it to 0 to signal the existence of the JSEntry frame. |
+ // Jump to a faked try block that does the invoke, with a faked catch |
+ // block that sets the pending exception. |
+ __ jmp(&invoke); |
+ __ bind(&handler_entry); |
+ handler_offset_ = handler_entry.pos(); |
+ // Caught exception: Store result (exception) in the pending exception |
+ // field in the JSEnv and return a failure sentinel. Coming in here the |
+ // fp will be invalid because the PushTryHandler below sets it to 0 to |
+ // signal the existence of the JSEntry frame. |
__ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
isolate))); |
__ str(r0, MemOperand(ip)); |
__ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
__ b(&exit); |
- // Invoke: Link this frame into the handler chain. |
+ // Invoke: Link this frame into the handler chain. There's only one |
+ // handler block in this code object, so its index is 0. |
__ bind(&invoke); |
// Must preserve r0-r4, r5-r7 are available. |
- __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); |
+ __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER, 0); |
// If an exception not caught by another handler occurs, this handler |
// returns control to the code after the bl(&invoke) above, which |
// restores all kCalleeSaved registers (including cp and fp) to their |
@@ -4900,7 +4903,7 @@ void RegExpConstructResultStub::Generate(MacroAssembler* masm) { |
} |
-void CallFunctionStub::FinishCode(Code* code) { |
+void CallFunctionStub::FinishCode(Handle<Code> code) { |
code->set_has_function_cache(false); |
} |