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

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

Issue 369063005: Revert "Remove unnecessary check in RegExpExecStub." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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') | test/mjsunit/regexp-stack-overflow.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 62ce31cc744d3f29904d261698061758a88630dc..c08e38b50992bbc1a2fbae027654f08cda603c2c 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -1574,14 +1574,19 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
__ ret(REG_EXP_EXEC_ARGUMENT_COUNT * kPointerSize);
__ bind(&exception);
- // Result must now be exception.
+ // Result must now be exception. If there is no pending exception already a
+ // stack overflow (on the backtrack stack) was detected in RegExp code but
+ // haven't created the exception yet. Handle that in the runtime system.
+ // TODO(592): Rerunning the RegExp to get the stack overflow exception.
ExternalReference pending_exception_address(
Isolate::kPendingExceptionAddress, isolate());
Operand pending_exception_operand =
masm->ExternalOperand(pending_exception_address, rbx);
- __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex);
__ movp(rax, pending_exception_operand);
- __ movp(pending_exception_operand, rdx); // Clear pending exception.
+ __ LoadRoot(rdx, Heap::kTheHoleValueRootIndex);
+ __ cmpp(rax, rdx);
+ __ j(equal, &runtime);
+ __ movp(pending_exception_operand, rdx);
__ CompareRoot(rax, Heap::kTerminationExceptionRootIndex);
Label termination_exception;
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | test/mjsunit/regexp-stack-overflow.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698