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 1409523003: Trace through const objects instead of spying on flow graph construction to find closure functions.… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/isolate.cc ('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 32dff56c016e0e9eb2f5ca03e6e503985e773a78..4a5d84475570681988000f10de56453d51b72170 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -64,6 +64,28 @@ class StackmapKeyValueTrait {
typedef DirectChainedHashMap<StackmapKeyValueTrait> StackmapSet;
+class FunctionKeyValueTrait {
+ public:
+ // Typedefs needed for the DirectChainedHashMap template.
+ typedef const Function* Key;
+ typedef const Function* Value;
+ typedef const Function* 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<FunctionKeyValueTrait> FunctionSet;
+
class Precompiler : public ValueObject {
public:
@@ -79,9 +101,9 @@ class Precompiler : public ValueObject {
void AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]);
void AddEntryPoints(Dart_QualifiedFunctionName entry_points[]);
void Iterate();
- void CleanUp();
void AddCalleesOf(const Function& function);
+ void AddConstObject(const Instance& instance);
void AddClosureCall(const ICData& call_site);
void AddField(const Field& field);
void AddFunction(const Function& function);
@@ -124,8 +146,8 @@ class Precompiler : public ValueObject {
const GrowableObjectArray& libraries_;
const GrowableObjectArray& pending_functions_;
- const GrowableObjectArray& collected_closures_;
SymbolSet sent_selectors_;
+ FunctionSet enqueued_functions_;
Error& error_;
};
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698