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

Unified Diff: src/regexp/regexp-macro-assembler.cc

Issue 2827243005: Revert of [regexp] Remove remainder of native RegExpExecStub (Closed)
Patch Set: Created 3 years, 8 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/regexp/ppc/regexp-macro-assembler-ppc.cc ('k') | src/regexp/s390/regexp-macro-assembler-s390.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-macro-assembler.cc
diff --git a/src/regexp/regexp-macro-assembler.cc b/src/regexp/regexp-macro-assembler.cc
index 755b604f8c02fd52b2b43bd529f94d1fd451b13f..2e3a8a2f76877eb90bac9dd699ae03ba1e86a505 100644
--- a/src/regexp/regexp-macro-assembler.cc
+++ b/src/regexp/regexp-macro-assembler.cc
@@ -170,18 +170,15 @@
bool is_one_byte = subject_handle->IsOneByteRepresentationUnderneath();
StackLimitCheck check(isolate);
- bool js_has_overflowed = check.JsHasOverflowed();
-
- if (is_direct_call) {
- // Direct calls from JavaScript can be interrupted in two ways:
- // 1. A real stack overflow, in which case we let the caller throw the
- // exception.
- // 2. The stack guard was used to interrupt execution for another purpose,
- // forcing the call through the runtime system.
- return_value = js_has_overflowed ? EXCEPTION : RETRY;
- } else if (js_has_overflowed) {
+ if (check.JsHasOverflowed()) {
isolate->StackOverflow();
return_value = EXCEPTION;
+ } else if (is_direct_call) {
+ // If not real stack overflow the stack guard was used to interrupt
+ // execution for another purpose. If this is a direct call from JavaScript
+ // retry the RegExp forcing the call through the runtime system.
+ // Currently the direct call cannot handle a GC.
+ return_value = RETRY;
} else {
Object* result = isolate->stack_guard()->HandleInterrupts();
if (result->IsException(isolate)) return_value = EXCEPTION;
« no previous file with comments | « src/regexp/ppc/regexp-macro-assembler-ppc.cc ('k') | src/regexp/s390/regexp-macro-assembler-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698