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

Unified Diff: src/builtins/builtins-regexp.cc

Issue 2438283002: Revert of [regexp] Use consistent map checks for fast paths (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | src/regexp/regexp-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-regexp.cc
diff --git a/src/builtins/builtins-regexp.cc b/src/builtins/builtins-regexp.cc
index 65df206e56146d01165ef4ceb5137310189410fc..dcf45d5177b5b68017da747c33314bfbed407fb0 100644
--- a/src/builtins/builtins-regexp.cc
+++ b/src/builtins/builtins-regexp.cc
@@ -1290,16 +1290,22 @@
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, string,
Object::ToString(isolate, string_obj));
- if (RegExpUtils::IsUnmodifiedRegExp(isolate, recv)) {
- RETURN_RESULT_OR_FAILURE(
- isolate,
- RegExpSplit(isolate, Handle<JSRegExp>::cast(recv), string, limit_obj));
- }
-
Handle<JSFunction> regexp_fun = isolate->regexp_function();
Handle<Object> ctor;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, ctor, SpeciesConstructor(isolate, recv, regexp_fun));
+
+ if (recv->IsJSRegExp() && *ctor == *regexp_fun) {
+ Handle<Object> exec;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, exec, JSObject::GetProperty(
+ recv, factory->NewStringFromAsciiChecked("exec")));
+ if (RegExpUtils::IsBuiltinExec(exec)) {
+ RETURN_RESULT_OR_FAILURE(
+ isolate, RegExpSplit(isolate, Handle<JSRegExp>::cast(recv), string,
+ limit_obj));
+ }
+ }
Handle<Object> flags_obj;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
« no previous file with comments | « no previous file | src/regexp/regexp-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698