OLD | NEW |
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 #include "vm/hash_map.h" | 9 #include "vm/hash_map.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 private: | 73 private: |
74 Zone* zone_; | 74 Zone* zone_; |
75 DirectChainedHashMap<SymbolPair> map_; | 75 DirectChainedHashMap<SymbolPair> map_; |
76 }; | 76 }; |
77 | 77 |
78 | 78 |
79 class Precompiler : public ValueObject { | 79 class Precompiler : public ValueObject { |
80 public: | 80 public: |
81 static RawError* CompileAll( | 81 static RawError* CompileAll( |
82 Dart_QualifiedFunctionName embedder_entry_points[]); | 82 Dart_QualifiedFunctionName embedder_entry_points[], |
| 83 bool reset_fields); |
83 | 84 |
84 private: | 85 private: |
85 explicit Precompiler(Thread* thread); | 86 Precompiler(Thread* thread, bool reset_fields); |
86 | 87 |
87 void DoCompileAll(Dart_QualifiedFunctionName embedder_entry_points[]); | 88 void DoCompileAll(Dart_QualifiedFunctionName embedder_entry_points[]); |
88 void ClearAllCode(); | 89 void ClearAllCode(); |
89 void AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]); | 90 void AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]); |
90 void AddEntryPoints(Dart_QualifiedFunctionName entry_points[]); | 91 void AddEntryPoints(Dart_QualifiedFunctionName entry_points[]); |
91 void Iterate(); | 92 void Iterate(); |
92 void CleanUp(); | 93 void CleanUp(); |
93 | 94 |
94 void AddCalleesOf(const Function& function); | 95 void AddCalleesOf(const Function& function); |
95 void AddClosureCall(const ICData& call_site); | 96 void AddClosureCall(const ICData& call_site); |
96 void AddField(const Field& field); | 97 void AddField(const Field& field); |
97 void AddFunction(const Function& function); | 98 void AddFunction(const Function& function); |
98 void AddClass(const Class& cls); | 99 void AddClass(const Class& cls); |
99 void AddSelector(const String& selector); | 100 void AddSelector(const String& selector); |
100 bool IsSent(const String& selector); | 101 bool IsSent(const String& selector); |
101 | 102 |
102 void ProcessFunction(const Function& function); | 103 void ProcessFunction(const Function& function); |
103 void CheckForNewDynamicFunctions(); | 104 void CheckForNewDynamicFunctions(); |
104 | 105 |
105 void DropUncompiledFunctions(); | 106 void DropUncompiledFunctions(); |
106 | 107 |
107 Thread* thread() const { return thread_; } | 108 Thread* thread() const { return thread_; } |
108 Zone* zone() const { return zone_; } | 109 Zone* zone() const { return zone_; } |
109 Isolate* isolate() const { return isolate_; } | 110 Isolate* isolate() const { return isolate_; } |
110 | 111 |
111 Thread* thread_; | 112 Thread* thread_; |
112 Zone* zone_; | 113 Zone* zone_; |
113 Isolate* isolate_; | 114 Isolate* isolate_; |
114 | 115 |
| 116 const bool reset_fields_; |
| 117 |
115 bool changed_; | 118 bool changed_; |
116 intptr_t function_count_; | 119 intptr_t function_count_; |
117 intptr_t class_count_; | 120 intptr_t class_count_; |
118 intptr_t selector_count_; | 121 intptr_t selector_count_; |
119 intptr_t dropped_function_count_; | 122 intptr_t dropped_function_count_; |
120 | 123 |
121 const GrowableObjectArray& libraries_; | 124 const GrowableObjectArray& libraries_; |
122 const GrowableObjectArray& pending_functions_; | 125 const GrowableObjectArray& pending_functions_; |
123 const GrowableObjectArray& collected_closures_; | 126 const GrowableObjectArray& collected_closures_; |
124 SymbolSet sent_selectors_; | 127 SymbolSet sent_selectors_; |
125 Error& error_; | 128 Error& error_; |
126 }; | 129 }; |
127 | 130 |
128 } // namespace dart | 131 } // namespace dart |
129 | 132 |
130 #endif // VM_PRECOMPILER_H_ | 133 #endif // VM_PRECOMPILER_H_ |
OLD | NEW |