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

Unified Diff: runtime/vm/raw_object_snapshot.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 | « runtime/vm/raw_object.h ('k') | runtime/vm/regexp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index aebda455c32d238e3cc9740d2de013af9e600db3..2177722230db715feafb2e2f8ed329996f050abd 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -2894,16 +2894,12 @@ RawRegExp* RegExp::ReadFrom(SnapshotReader* reader,
reader->Read<int32_t>());
regex.StoreNonPointer(&regex.raw_ptr()->type_flags_, reader->Read<int8_t>());
- // TODO(18854): Need to implement a way of recreating the irrexp functions.
const Function& no_function = Function::Handle(reader->zone());
- regex.set_function(kOneByteStringCid, no_function);
- regex.set_function(kTwoByteStringCid, no_function);
- regex.set_function(kExternalOneByteStringCid, no_function);
- regex.set_function(kExternalTwoByteStringCid, no_function);
-
- const TypedData& no_bytecode = TypedData::Handle(reader->zone());
- regex.set_bytecode(true, no_bytecode);
- regex.set_bytecode(false, no_bytecode);
+ for (intptr_t cid = kOneByteStringCid; cid <= kExternalTwoByteStringCid;
+ cid++) {
+ regex.set_function(cid, /*sticky=*/false, no_function);
+ regex.set_function(cid, /*sticky=*/true, no_function);
+ }
return regex.raw();
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/regexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698