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

Unified Diff: runtime/lib/regexp.cc

Issue 2510783002: VM: Optimize RegExp.matchAsPrefix(...) by generating a sticky RegExp specialization. (Closed)
Patch Set: Done Created 4 years, 1 month 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 | runtime/lib/regexp_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/regexp.cc
diff --git a/runtime/lib/regexp.cc b/runtime/lib/regexp.cc
index 7a50561109244c8f55282b3aedc2d02edff0e1f0..87795731c57db2a2461f537c3fa7cacf6ea594dc 100644
--- a/runtime/lib/regexp.cc
+++ b/runtime/lib/regexp.cc
@@ -78,19 +78,34 @@ DEFINE_NATIVE_ENTRY(RegExp_getGroupCount, 1) {
}
-DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 3) {
- // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch.
+static RawObject* ExecuteMatch(Zone* zone,
+ NativeArguments* arguments,
+ bool sticky) {
const RegExp& regexp = RegExp::CheckedHandle(arguments->NativeArgAt(0));
ASSERT(!regexp.IsNull());
GET_NON_NULL_NATIVE_ARGUMENT(String, subject, arguments->NativeArgAt(1));
GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2));
- if (FLAG_interpret_irregexp || FLAG_precompiled_runtime) {
+ if (FLAG_interpret_irregexp) {
return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index,
- zone);
+ /*sticky=*/sticky, zone);
}
- return IRRegExpMacroAssembler::Execute(regexp, subject, start_index, zone);
+ return IRRegExpMacroAssembler::Execute(regexp, subject, start_index,
+ /*sticky=*/sticky, zone);
}
+
+DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 3) {
+ // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch.
+ return ExecuteMatch(zone, arguments, /*sticky=*/false);
+}
+
+
+DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatchSticky, 3) {
+ // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatchSticky.
+ return ExecuteMatch(zone, arguments, /*sticky=*/true);
+}
+
+
} // namespace dart
« no previous file with comments | « no previous file | runtime/lib/regexp_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698