Index: src/ppc/code-stubs-ppc.cc |
diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc |
index 10bc9ef90e7f714906d3e43b5c98d61840ba4b79..c3fb121b2c0ab39ba734da73979cbab31e992d52 100644 |
--- a/src/ppc/code-stubs-ppc.cc |
+++ b/src/ppc/code-stubs-ppc.cc |
@@ -995,60 +995,6 @@ void CEntryStub::GenerateAheadOfTime(Isolate* isolate) { |
} |
-static void ThrowPendingException(MacroAssembler* masm) { |
- Isolate* isolate = masm->isolate(); |
- |
- ExternalReference pending_handler_context_address( |
- Isolate::kPendingHandlerContextAddress, isolate); |
- ExternalReference pending_handler_code_address( |
- Isolate::kPendingHandlerCodeAddress, isolate); |
- ExternalReference pending_handler_offset_address( |
- Isolate::kPendingHandlerOffsetAddress, isolate); |
- ExternalReference pending_handler_fp_address( |
- Isolate::kPendingHandlerFPAddress, isolate); |
- ExternalReference pending_handler_sp_address( |
- Isolate::kPendingHandlerSPAddress, isolate); |
- |
- // Ask the runtime for help to determine the handler. This will set r3 to |
- // contain the current pending exception, don't clobber it. |
- ExternalReference find_handler(Runtime::kFindExceptionHandler, isolate); |
- { |
- FrameScope scope(masm, StackFrame::MANUAL); |
- __ PrepareCallCFunction(3, 0, r3); |
- __ li(r3, Operand::Zero()); |
- __ li(r4, Operand::Zero()); |
- __ mov(r5, Operand(ExternalReference::isolate_address(isolate))); |
- __ CallCFunction(find_handler, 3); |
- } |
- |
- // Retrieve the handler context, SP and FP. |
- __ mov(cp, Operand(pending_handler_context_address)); |
- __ LoadP(cp, MemOperand(cp)); |
- __ mov(sp, Operand(pending_handler_sp_address)); |
- __ LoadP(sp, MemOperand(sp)); |
- __ mov(fp, Operand(pending_handler_fp_address)); |
- __ LoadP(fp, MemOperand(fp)); |
- |
- // If the handler is a JS frame, restore the context to the frame. |
- // (kind == ENTRY) == (fp == 0) == (cp == 0), so we could test either fp |
- // or cp. |
- Label skip; |
- __ cmpi(cp, Operand::Zero()); |
- __ beq(&skip); |
- __ StoreP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
- __ bind(&skip); |
- |
- // Compute the handler entry address and jump to it. |
- __ mov(r4, Operand(pending_handler_code_address)); |
- __ LoadP(r4, MemOperand(r4)); |
- __ mov(r5, Operand(pending_handler_offset_address)); |
- __ LoadP(r5, MemOperand(r5)); |
- __ addi(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start |
- __ add(ip, r4, r5); |
- __ Jump(ip); |
-} |
- |
- |
void CEntryStub::Generate(MacroAssembler* masm) { |
// Called from JavaScript; parameters are on stack as if calling JS function. |
// r3: number of arguments including receiver |
@@ -1180,7 +1126,54 @@ void CEntryStub::Generate(MacroAssembler* masm) { |
// Handling of exception. |
__ bind(&exception_returned); |
- ThrowPendingException(masm); |
+ ExternalReference pending_handler_context_address( |
+ Isolate::kPendingHandlerContextAddress, isolate()); |
+ ExternalReference pending_handler_code_address( |
+ Isolate::kPendingHandlerCodeAddress, isolate()); |
+ ExternalReference pending_handler_offset_address( |
+ Isolate::kPendingHandlerOffsetAddress, isolate()); |
+ ExternalReference pending_handler_fp_address( |
+ Isolate::kPendingHandlerFPAddress, isolate()); |
+ ExternalReference pending_handler_sp_address( |
+ Isolate::kPendingHandlerSPAddress, isolate()); |
+ |
+ // Ask the runtime for help to determine the handler. This will set r3 to |
+ // contain the current pending exception, don't clobber it. |
+ ExternalReference find_handler(Runtime::kFindExceptionHandler, isolate()); |
+ { |
+ FrameScope scope(masm, StackFrame::MANUAL); |
+ __ PrepareCallCFunction(3, 0, r3); |
+ __ li(r3, Operand::Zero()); |
+ __ li(r4, Operand::Zero()); |
+ __ mov(r5, Operand(ExternalReference::isolate_address(isolate()))); |
+ __ CallCFunction(find_handler, 3); |
+ } |
+ |
+ // Retrieve the handler context, SP and FP. |
+ __ mov(cp, Operand(pending_handler_context_address)); |
+ __ LoadP(cp, MemOperand(cp)); |
+ __ mov(sp, Operand(pending_handler_sp_address)); |
+ __ LoadP(sp, MemOperand(sp)); |
+ __ mov(fp, Operand(pending_handler_fp_address)); |
+ __ LoadP(fp, MemOperand(fp)); |
+ |
+ // If the handler is a JS frame, restore the context to the frame. |
+ // (kind == ENTRY) == (fp == 0) == (cp == 0), so we could test either fp |
+ // or cp. |
+ Label skip; |
+ __ cmpi(cp, Operand::Zero()); |
+ __ beq(&skip); |
+ __ StoreP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ __ bind(&skip); |
+ |
+ // Compute the handler entry address and jump to it. |
+ __ mov(r4, Operand(pending_handler_code_address)); |
+ __ LoadP(r4, MemOperand(r4)); |
+ __ mov(r5, Operand(pending_handler_offset_address)); |
+ __ LoadP(r5, MemOperand(r5)); |
+ __ addi(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start |
+ __ add(ip, r4, r5); |
+ __ Jump(ip); |
} |
@@ -2401,8 +2394,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
__ beq(&runtime); |
// For exception, throw the exception again. |
- __ EnterExitFrame(false); |
- ThrowPendingException(masm); |
+ __ TailCallRuntime(Runtime::kRegExpExecReThrow, 4, 1); |
__ bind(&failure); |
// For failure and exception return null. |