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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_PRECOMPILER_H_ 5 #ifndef VM_PRECOMPILER_H_
6 #define VM_PRECOMPILER_H_ 6 #define VM_PRECOMPILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 // Forward declarations. 12 // Forward declarations.
13 class Class;
14 class Error;
15 class Field;
16 class Function;
17 class GrowableObjectArray;
13 class RawError; 18 class RawError;
19 class String;
14 20
15 class Precompiler : public AllStatic { 21 class Precompiler : public ValueObject {
16 public: 22 public:
17 static RawError* CompileAll(); 23 static RawError* CompileAll();
24
25 private:
26 explicit Precompiler(Thread* thread);
27
28 void DoCompileAll();
29 void ClearAllCode();
30 void AddRoots();
31 void Iterate();
32 void CleanUp();
33
34 void AddCalleesOf(const Function& function);
35 void AddField(const Field& field);
36 void AddFunction(const Function& function);
37 void AddClass(const Class& cls);
38 void AddSelector(const String& selector);
39 bool IsSent(const String& selector);
40
41 void ProcessFunction(const Function& function);
42 void CheckForNewDynamicFunctions();
43
44 Thread* thread() const { return thread_; }
45 Zone* zone() const { return zone_; }
46 Isolate* isolate() const { return isolate_; }
47
48 Thread* thread_;
49 Zone* zone_;
50 Isolate* isolate_;
51
52 bool changed_;
53 intptr_t function_count_;
54 intptr_t class_count_;
55
56 const GrowableObjectArray& libraries_;
57 const GrowableObjectArray& pending_functions_;
58 const GrowableObjectArray& collected_closures_;
59 const GrowableObjectArray& sent_selectors_;
60 Error& error_;
18 }; 61 };
19 62
20 } // namespace dart 63 } // namespace dart
21 64
22 #endif // VM_PRECOMPILER_H_ 65 #endif // VM_PRECOMPILER_H_
OLDNEW
« 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