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

Unified Diff: runtime/vm/precompiler.h

Issue 1653003003: Precompilation: canonicalize Instructions in PRODUCT mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
Index: runtime/vm/precompiler.h
diff --git a/runtime/vm/precompiler.h b/runtime/vm/precompiler.h
index ecc881ea6ab49ac0c8aea164b883dfbad38fdb6a..f01679ac9f06b6eb46e4877ab50088bd5262b592 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -96,6 +96,29 @@ class ArrayKeyValueTrait {
typedef DirectChainedHashMap<ArrayKeyValueTrait> ArraySet;
+class InstructionsKeyValueTrait {
+ public:
+ // Typedefs needed for the DirectChainedHashMap template.
+ typedef const Instructions* Key;
+ typedef const Instructions* Value;
+ typedef const Instructions* Pair;
+
+ static Key KeyOf(Pair kv) { return kv; }
+
+ static Value ValueOf(Pair kv) { return kv; }
+
+ static inline intptr_t Hashcode(Key key) {
+ return key->size();
+ }
+
+ static inline bool IsKeyEqual(Pair pair, Key key) {
+ return pair->Equals(*key);
+ }
+};
+
+typedef DirectChainedHashMap<InstructionsKeyValueTrait> InstructionsSet;
+
+
class FunctionKeyValueTrait {
public:
// Typedefs needed for the DirectChainedHashMap template.
@@ -184,6 +207,7 @@ class Precompiler : public ValueObject {
void BindStaticCalls();
void DedupStackmaps();
void DedupStackmapLists();
+ void DedupInstructions();
void ResetPrecompilerState();
void CollectDynamicFunctionNames();
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | runtime/vm/precompiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698