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

Unified Diff: runtime/vm/precompiler.h

Issue 1609983002: Precompilation: drop Field objects unless they are an entry point or referenced from a constant poo… (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') | runtime/vm/precompiler.cc » ('J')
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 50f95512dace85302a36597b3b9e3cf65f168ed6..fe7ec2da7308266d574e4eb6b59e8678e23fcaea 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -87,6 +87,29 @@ class FunctionKeyValueTrait {
typedef DirectChainedHashMap<FunctionKeyValueTrait> FunctionSet;
+class FieldKeyValueTrait {
+ public:
+ // Typedefs needed for the DirectChainedHashMap template.
+ typedef const Field* Key;
+ typedef const Field* Value;
+ typedef const Field* Pair;
+
+ static Key KeyOf(Pair kv) { return kv; }
+
+ static Value ValueOf(Pair kv) { return kv; }
+
+ static inline intptr_t Hashcode(Key key) {
+ return key->token_pos();
+ }
+
+ static inline bool IsKeyEqual(Pair pair, Key key) {
+ return pair->raw() == key->raw();
+ }
+};
+
+typedef DirectChainedHashMap<FieldKeyValueTrait> FieldSet;
+
+
class Precompiler : public ValueObject {
public:
static RawError* CompileAll(
@@ -125,6 +148,7 @@ class Precompiler : public ValueObject {
void CheckForNewDynamicFunctions();
void DropUncompiledFunctions();
+ void DropFields();
void CollectDynamicFunctionNames();
void BindStaticCalls();
void DedupStackmaps();
@@ -155,11 +179,13 @@ class Precompiler : public ValueObject {
intptr_t class_count_;
intptr_t selector_count_;
intptr_t dropped_function_count_;
+ intptr_t dropped_field_count_;
const GrowableObjectArray& libraries_;
const GrowableObjectArray& pending_functions_;
SymbolSet sent_selectors_;
FunctionSet enqueued_functions_;
+ FieldSet fields_to_retain_;
Error& error_;
};
« no previous file with comments | « no previous file | runtime/vm/precompiler.cc » ('j') | runtime/vm/precompiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698