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

Unified Diff: runtime/vm/raw_object.h

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/object_service.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 50900b4991d393e79df7a857a5722261aaf03c58..94c98224ebe053d2c6ed35030bd84afe174050f5 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -2116,14 +2116,29 @@ class RawRegExp : public RawInstance {
}
RawSmi* num_bracket_expressions_;
RawString* pattern_; // Pattern to be used for matching.
- RawFunction* one_byte_function_;
- RawFunction* two_byte_function_;
+ union {
+ RawFunction* function_;
+ RawTypedData* bytecode_;
+ } one_byte_;
+ union {
+ RawFunction* function_;
+ RawTypedData* bytecode_;
+ } two_byte_;
RawFunction* external_one_byte_function_;
RawFunction* external_two_byte_function_;
- RawTypedData* one_byte_bytecode_;
- RawTypedData* two_byte_bytecode_;
+ union {
+ RawFunction* function_;
+ RawTypedData* bytecode_;
+ } one_byte_sticky_;
+ union {
+ RawFunction* function_;
+ RawTypedData* bytecode_;
+ } two_byte_sticky_;
+ RawFunction* external_one_byte_sticky_function_;
+ RawFunction* external_two_byte_sticky_function_;
RawObject** to() {
- return reinterpret_cast<RawObject**>(&ptr()->two_byte_bytecode_);
+ return reinterpret_cast<RawObject**>(
+ &ptr()->external_two_byte_sticky_function_);
}
intptr_t num_registers_;
« no previous file with comments | « runtime/vm/object_service.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698