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

Unified Diff: runtime/vm/regexp.cc

Issue 1814983004: Don't create matcher functions when interpreting regex. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/regexp.cc
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index e49c3d8253c2e3169b6dc0edecde52ed47abb0e1..9daab26a9c5a4e3a35fd7c152a95032dda9a43f2 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -5317,14 +5317,16 @@ RawJSRegExp* RegExpEngine::CreateJSRegExp(Zone* zone,
regexp.set_is_complex();
regexp.set_is_global(); // All dart regexps are global.
- const Library& lib = Library::Handle(zone, Library::CoreLibrary());
- const Class& owner = Class::Handle(
- zone, lib.LookupClass(Symbols::RegExp()));
-
- CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner);
- CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner);
- CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner);
- CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner);
+ if (!FLAG_interpret_irregexp) {
+ const Library& lib = Library::Handle(zone, Library::CoreLibrary());
+ const Class& owner = Class::Handle(
+ zone, lib.LookupClass(Symbols::RegExp()));
+
+ CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner);
+ CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner);
+ CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner);
+ CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner);
+ }
return regexp.raw();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698