| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return false; | 89 return false; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 return true; | 92 return true; |
| 93 } | 93 } |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 typedef DirectChainedHashMap<ArrayKeyValueTrait> ArraySet; | 96 typedef DirectChainedHashMap<ArrayKeyValueTrait> ArraySet; |
| 97 | 97 |
| 98 | 98 |
| 99 class InstructionsKeyValueTrait { |
| 100 public: |
| 101 // Typedefs needed for the DirectChainedHashMap template. |
| 102 typedef const Instructions* Key; |
| 103 typedef const Instructions* Value; |
| 104 typedef const Instructions* Pair; |
| 105 |
| 106 static Key KeyOf(Pair kv) { return kv; } |
| 107 |
| 108 static Value ValueOf(Pair kv) { return kv; } |
| 109 |
| 110 static inline intptr_t Hashcode(Key key) { |
| 111 return key->size(); |
| 112 } |
| 113 |
| 114 static inline bool IsKeyEqual(Pair pair, Key key) { |
| 115 return pair->Equals(*key); |
| 116 } |
| 117 }; |
| 118 |
| 119 typedef DirectChainedHashMap<InstructionsKeyValueTrait> InstructionsSet; |
| 120 |
| 121 |
| 99 class FunctionKeyValueTrait { | 122 class FunctionKeyValueTrait { |
| 100 public: | 123 public: |
| 101 // Typedefs needed for the DirectChainedHashMap template. | 124 // Typedefs needed for the DirectChainedHashMap template. |
| 102 typedef const Function* Key; | 125 typedef const Function* Key; |
| 103 typedef const Function* Value; | 126 typedef const Function* Value; |
| 104 typedef const Function* Pair; | 127 typedef const Function* Pair; |
| 105 | 128 |
| 106 static Key KeyOf(Pair kv) { return kv; } | 129 static Key KeyOf(Pair kv) { return kv; } |
| 107 | 130 |
| 108 static Value ValueOf(Pair kv) { return kv; } | 131 static Value ValueOf(Pair kv) { return kv; } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 bool IsSent(const String& selector); | 200 bool IsSent(const String& selector); |
| 178 | 201 |
| 179 void ProcessFunction(const Function& function); | 202 void ProcessFunction(const Function& function); |
| 180 void CheckForNewDynamicFunctions(); | 203 void CheckForNewDynamicFunctions(); |
| 181 | 204 |
| 182 void DropFunctions(); | 205 void DropFunctions(); |
| 183 void DropFields(); | 206 void DropFields(); |
| 184 void BindStaticCalls(); | 207 void BindStaticCalls(); |
| 185 void DedupStackmaps(); | 208 void DedupStackmaps(); |
| 186 void DedupStackmapLists(); | 209 void DedupStackmapLists(); |
| 210 void DedupInstructions(); |
| 187 void ResetPrecompilerState(); | 211 void ResetPrecompilerState(); |
| 188 | 212 |
| 189 void CollectDynamicFunctionNames(); | 213 void CollectDynamicFunctionNames(); |
| 190 | 214 |
| 191 class FunctionVisitor : public ValueObject { | 215 class FunctionVisitor : public ValueObject { |
| 192 public: | 216 public: |
| 193 virtual ~FunctionVisitor() {} | 217 virtual ~FunctionVisitor() {} |
| 194 virtual void VisitFunction(const Function& function) = 0; | 218 virtual void VisitFunction(const Function& function) = 0; |
| 195 }; | 219 }; |
| 196 | 220 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 219 const GrowableObjectArray& pending_functions_; | 243 const GrowableObjectArray& pending_functions_; |
| 220 SymbolSet sent_selectors_; | 244 SymbolSet sent_selectors_; |
| 221 FunctionSet enqueued_functions_; | 245 FunctionSet enqueued_functions_; |
| 222 FieldSet fields_to_retain_; | 246 FieldSet fields_to_retain_; |
| 223 Error& error_; | 247 Error& error_; |
| 224 }; | 248 }; |
| 225 | 249 |
| 226 } // namespace dart | 250 } // namespace dart |
| 227 | 251 |
| 228 #endif // VM_PRECOMPILER_H_ | 252 #endif // VM_PRECOMPILER_H_ |
| OLD | NEW |