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

Unified Diff: runtime/vm/precompiler.h

Issue 1259123009: Initial tree-shaking for precompilation: only selective compilation, no removal of unused Functions… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync + more dart:io roots Created 5 years, 4 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 140a8661ed74d6d76b7faf9e481ee3b1e29c7703..158a8ba88803215eb9bcf4805595f048ebb51d98 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -10,11 +10,54 @@
namespace dart {
// Forward declarations.
+class Class;
+class Error;
+class Field;
+class Function;
+class GrowableObjectArray;
class RawError;
+class String;
-class Precompiler : public AllStatic {
+class Precompiler : public ValueObject {
public:
static RawError* CompileAll();
+
+ private:
+ explicit Precompiler(Thread* thread);
+
+ void DoCompileAll();
+ void ClearAllCode();
+ void AddRoots();
+ void Iterate();
+ void CleanUp();
+
+ void AddCalleesOf(const Function& function);
+ void AddField(const Field& field);
+ void AddFunction(const Function& function);
+ void AddClass(const Class& cls);
+ void AddSelector(const String& selector);
+ bool IsSent(const String& selector);
+
+ void ProcessFunction(const Function& function);
+ void CheckForNewDynamicFunctions();
+
+ Thread* thread() const { return thread_; }
+ Zone* zone() const { return zone_; }
+ Isolate* isolate() const { return isolate_; }
+
+ Thread* thread_;
+ Zone* zone_;
+ Isolate* isolate_;
+
+ bool changed_;
+ intptr_t function_count_;
+ intptr_t class_count_;
+
+ const GrowableObjectArray& libraries_;
+ const GrowableObjectArray& pending_functions_;
+ const GrowableObjectArray& collected_closures_;
+ const GrowableObjectArray& sent_selectors_;
+ Error& error_;
};
} // namespace dart
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/precompiler.cc » ('j') | runtime/vm/precompiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698