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

Unified Diff: runtime/vm/precompiler.h

Issue 1644543004: Precompilation: canonicalize lists of stackmaps. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.h
diff --git a/runtime/vm/precompiler.h b/runtime/vm/precompiler.h
index fe7ec2da7308266d574e4eb6b59e8678e23fcaea..0d98df2382d7d7ab2da093a7428554d3c4c770cc 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -64,6 +64,38 @@ class StackmapKeyValueTrait {
typedef DirectChainedHashMap<StackmapKeyValueTrait> StackmapSet;
+
+class ArrayKeyValueTrait {
+ public:
+ // Typedefs needed for the DirectChainedHashMap template.
+ typedef const Array* Key;
+ typedef const Array* Value;
+ typedef const Array* Pair;
+
+ static Key KeyOf(Pair kv) { return kv; }
+
+ static Value ValueOf(Pair kv) { return kv; }
+
+ static inline intptr_t Hashcode(Key key) {
+ return key->Length();
+ }
+
+ static inline bool IsKeyEqual(Pair pair, Key key) {
+ if (pair->Length() != key->Length()) {
+ return false;
+ }
+ for (intptr_t i = 0; i < pair->Length(); i++) {
+ if (pair->At(i) != key->At(i)) {
+ return false;
+ }
+ }
+ return true;
+ }
+};
+
+typedef DirectChainedHashMap<ArrayKeyValueTrait> ArraySet;
+
+
class FunctionKeyValueTrait {
public:
// Typedefs needed for the DirectChainedHashMap template.
@@ -152,6 +184,7 @@ class Precompiler : public ValueObject {
void CollectDynamicFunctionNames();
void BindStaticCalls();
void DedupStackmaps();
+ void DedupStackmapLists();
void ResetPrecompilerState();
class FunctionVisitor : public ValueObject {
« no previous file with comments | « no previous file | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698