Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Unified Diff: src/mips/code-stubs-mips.cc

Issue 1012103002: Delegate throwing in RegExpExecStub to CEntryStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ported to all the architectures. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.cc
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc
index 60ba09f0633cb02caf2337a2729fd21a0e0cdb21..69cf51e700f0d5bd68528440d2c261c4f92b0e02 100644
--- a/src/mips/code-stubs-mips.cc
+++ b/src/mips/code-stubs-mips.cc
@@ -1037,59 +1037,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 v0 to
- // contain the current pending exception, don't clobber it.
- ExternalReference find_handler(Runtime::kFindExceptionHandler, isolate);
- {
- FrameScope scope(masm, StackFrame::MANUAL);
- __ PrepareCallCFunction(3, 0, a0);
- __ mov(a0, zero_reg);
- __ mov(a1, zero_reg);
- __ li(a2, Operand(ExternalReference::isolate_address(isolate)));
- __ CallCFunction(find_handler, 3);
- }
-
- // Retrieve the handler context, SP and FP.
- __ li(cp, Operand(pending_handler_context_address));
- __ lw(cp, MemOperand(cp));
- __ li(sp, Operand(pending_handler_sp_address));
- __ lw(sp, MemOperand(sp));
- __ li(fp, Operand(pending_handler_fp_address));
- __ lw(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 zero;
- __ Branch(&zero, eq, cp, Operand(zero_reg));
- __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
- __ bind(&zero);
-
- // Compute the handler entry address and jump to it.
- __ li(a1, Operand(pending_handler_code_address));
- __ lw(a1, MemOperand(a1));
- __ li(a2, Operand(pending_handler_offset_address));
- __ lw(a2, MemOperand(a2));
- __ Addu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
- __ Addu(t9, a1, a2);
- __ Jump(t9);
-}
-
-
void CEntryStub::Generate(MacroAssembler* masm) {
// Called from JavaScript; parameters are on stack as if calling JS function
// a0: number of arguments including receiver
@@ -1199,7 +1146,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 v0 to
+ // contain the current pending exception, don't clobber it.
+ ExternalReference find_handler(Runtime::kFindExceptionHandler, isolate());
+ {
+ FrameScope scope(masm, StackFrame::MANUAL);
+ __ PrepareCallCFunction(3, 0, a0);
+ __ mov(a0, zero_reg);
+ __ mov(a1, zero_reg);
+ __ li(a2, Operand(ExternalReference::isolate_address(isolate())));
+ __ CallCFunction(find_handler, 3);
+ }
+
+ // Retrieve the handler context, SP and FP.
+ __ li(cp, Operand(pending_handler_context_address));
+ __ lw(cp, MemOperand(cp));
+ __ li(sp, Operand(pending_handler_sp_address));
+ __ lw(sp, MemOperand(sp));
+ __ li(fp, Operand(pending_handler_fp_address));
+ __ lw(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 zero;
+ __ Branch(&zero, eq, cp, Operand(zero_reg));
+ __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
+ __ bind(&zero);
+
+ // Compute the handler entry address and jump to it.
+ __ li(a1, Operand(pending_handler_code_address));
+ __ lw(a1, MemOperand(a1));
+ __ li(a2, Operand(pending_handler_offset_address));
+ __ lw(a2, MemOperand(a2));
+ __ Addu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
+ __ Addu(t9, a1, a2);
+ __ Jump(t9);
}
@@ -2373,8 +2367,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
__ Branch(&runtime, eq, v0, Operand(a1));
// For exception, throw the exception again.
- __ EnterExitFrame(false);
- ThrowPendingException(masm);
+ __ TailCallRuntime(Runtime::kRegExpExecReThrow, 4, 1);
__ bind(&failure);
// For failure and exception return null.
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698