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

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') | runtime/vm/intrinsifier_x64.cc » ('J')
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..ad82af8778963702064beb92c4c3f61d97827560 100644
--- a/runtime/lib/regexp.cc
+++ b/runtime/lib/regexp.cc
@@ -87,10 +87,29 @@ DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 3) {
if (FLAG_interpret_irregexp || FLAG_precompiled_runtime) {
return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index,
- zone);
+ /*sticky=*/false, zone);
}
- return IRRegExpMacroAssembler::Execute(regexp, subject, start_index, zone);
+ return IRRegExpMacroAssembler::Execute(regexp, subject, start_index,
+ /*sticky=*/false, zone);
}
+
+DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatchSticky, 3) {
+ // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch.
rmacnak 2016/11/17 00:49:52 MatchSticky
Vyacheslav Egorov (Google) 2016/11/17 16:51:33 Done.
+ 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) {
+ return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index,
+ /*sticky=*/true, zone);
+ }
+
+ return IRRegExpMacroAssembler::Execute(regexp, subject, start_index,
+ /*sticky=*/true, zone);
+}
+
+
} // namespace dart
« no previous file with comments | « no previous file | runtime/lib/regexp_patch.dart » ('j') | runtime/vm/intrinsifier_x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698