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

Unified Diff: src/mips64/code-stubs-mips64.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/mips/code-stubs-mips.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/code-stubs-mips64.cc
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc
index 458a5da0c49e67f30b96b26bf09ce3acf229d783..643ff5cd01e55af03e694f0e39d431438f5fbd77 100644
--- a/src/mips64/code-stubs-mips64.cc
+++ b/src/mips64/code-stubs-mips64.cc
@@ -1033,59 +1033,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));
- __ ld(cp, MemOperand(cp));
- __ li(sp, Operand(pending_handler_sp_address));
- __ ld(sp, MemOperand(sp));
- __ li(fp, Operand(pending_handler_fp_address));
- __ ld(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));
- __ sd(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
- __ bind(&zero);
-
- // Compute the handler entry address and jump to it.
- __ li(a1, Operand(pending_handler_code_address));
- __ ld(a1, MemOperand(a1));
- __ li(a2, Operand(pending_handler_offset_address));
- __ ld(a2, MemOperand(a2));
- __ Daddu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
- __ Daddu(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
@@ -1194,7 +1141,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));
+ __ ld(cp, MemOperand(cp));
+ __ li(sp, Operand(pending_handler_sp_address));
+ __ ld(sp, MemOperand(sp));
+ __ li(fp, Operand(pending_handler_fp_address));
+ __ ld(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));
+ __ sd(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
+ __ bind(&zero);
+
+ // Compute the handler entry address and jump to it.
+ __ li(a1, Operand(pending_handler_code_address));
+ __ ld(a1, MemOperand(a1));
+ __ li(a2, Operand(pending_handler_offset_address));
+ __ ld(a2, MemOperand(a2));
+ __ Daddu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
+ __ Daddu(t9, a1, a2);
+ __ Jump(t9);
}
@@ -2409,8 +2403,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/mips/code-stubs-mips.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698