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

Unified Diff: runtime/vm/precompiler.h

Issue 1758153002: Tree-shake consts. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: no closure call bit on icdata anymore either 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
« no previous file with comments | « runtime/vm/object.h ('k') | 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 43b7b96f9a7e9ab75861830c2dae29872fa3fee0..31465f23c60dd65e2b568afa60b02ab7247946ec 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -236,6 +236,29 @@ class TypeArgumentsKeyValueTrait {
typedef DirectChainedHashMap<TypeArgumentsKeyValueTrait> TypeArgumentsSet;
+class InstanceKeyValueTrait {
+ public:
+ // Typedefs needed for the DirectChainedHashMap template.
+ typedef const Instance* Key;
+ typedef const Instance* Value;
+ typedef const Instance* Pair;
+
+ static Key KeyOf(Pair kv) { return kv; }
+
+ static Value ValueOf(Pair kv) { return kv; }
+
+ static inline intptr_t Hashcode(Key key) {
+ return key->GetClassId();
+ }
+
+ static inline bool IsKeyEqual(Pair pair, Key key) {
+ return pair->raw() == key->raw();
+ }
+};
+
+typedef DirectChainedHashMap<InstanceKeyValueTrait> InstanceSet;
+
+
class Precompiler : public ValueObject {
public:
static RawError* CompileAll(
@@ -284,6 +307,7 @@ class Precompiler : public ValueObject {
void ProcessFunction(const Function& function);
void CheckForNewDynamicFunctions();
+ void TraceConstFunctions();
void DropFunctions();
void DropFields();
@@ -340,6 +364,7 @@ class Precompiler : public ValueObject {
ClassSet classes_to_retain_;
TypeArgumentsSet typeargs_to_retain_;
AbstractTypeSet types_to_retain_;
+ InstanceSet consts_to_retain_;
Error& error_;
};
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698