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 RUNTIME_VM_PRECOMPILER_H_ | 5 #ifndef RUNTIME_VM_PRECOMPILER_H_ |
6 #define RUNTIME_VM_PRECOMPILER_H_ | 6 #define RUNTIME_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/hash_table.h" | 10 #include "vm/hash_table.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 static inline intptr_t Hashcode(Key key) { return key->Hash(); } | 72 static inline intptr_t Hashcode(Key key) { return key->Hash(); } |
73 | 73 |
74 static inline bool IsKeyEqual(Pair pair, Key key) { | 74 static inline bool IsKeyEqual(Pair pair, Key key) { |
75 return pair->raw() == key->raw(); | 75 return pair->raw() == key->raw(); |
76 } | 76 } |
77 }; | 77 }; |
78 | 78 |
79 typedef DirectChainedHashMap<SymbolKeyValueTrait> SymbolSet; | 79 typedef DirectChainedHashMap<SymbolKeyValueTrait> SymbolSet; |
80 | 80 |
81 class StackmapKeyValueTrait { | 81 class StackMapKeyValueTrait { |
82 public: | 82 public: |
83 // Typedefs needed for the DirectChainedHashMap template. | 83 // Typedefs needed for the DirectChainedHashMap template. |
84 typedef const Stackmap* Key; | 84 typedef const StackMap* Key; |
85 typedef const Stackmap* Value; | 85 typedef const StackMap* Value; |
86 typedef const Stackmap* Pair; | 86 typedef const StackMap* Pair; |
87 | 87 |
88 static Key KeyOf(Pair kv) { return kv; } | 88 static Key KeyOf(Pair kv) { return kv; } |
89 | 89 |
90 static Value ValueOf(Pair kv) { return kv; } | 90 static Value ValueOf(Pair kv) { return kv; } |
91 | 91 |
92 static inline intptr_t Hashcode(Key key) { return key->PcOffset(); } | 92 static inline intptr_t Hashcode(Key key) { return key->PcOffset(); } |
93 | 93 |
94 static inline bool IsKeyEqual(Pair pair, Key key) { | 94 static inline bool IsKeyEqual(Pair pair, Key key) { |
95 return pair->Equals(*key); | 95 return pair->Equals(*key); |
96 } | 96 } |
97 }; | 97 }; |
98 | 98 |
99 typedef DirectChainedHashMap<StackmapKeyValueTrait> StackmapSet; | 99 typedef DirectChainedHashMap<StackMapKeyValueTrait> StackMapSet; |
100 | 100 |
101 | 101 |
102 class ArrayKeyValueTrait { | 102 class ArrayKeyValueTrait { |
103 public: | 103 public: |
104 // Typedefs needed for the DirectChainedHashMap template. | 104 // Typedefs needed for the DirectChainedHashMap template. |
105 typedef const Array* Key; | 105 typedef const Array* Key; |
106 typedef const Array* Value; | 106 typedef const Array* Value; |
107 typedef const Array* Pair; | 107 typedef const Array* Pair; |
108 | 108 |
109 static Key KeyOf(Pair kv) { return kv; } | 109 static Key KeyOf(Pair kv) { return kv; } |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 void TraceTypesFromRetainedClasses(); | 386 void TraceTypesFromRetainedClasses(); |
387 void DropTypes(); | 387 void DropTypes(); |
388 void DropTypeArguments(); | 388 void DropTypeArguments(); |
389 void DropScriptData(); | 389 void DropScriptData(); |
390 void DropClasses(); | 390 void DropClasses(); |
391 void DropLibraries(); | 391 void DropLibraries(); |
392 | 392 |
393 void BindStaticCalls(); | 393 void BindStaticCalls(); |
394 void SwitchICCalls(); | 394 void SwitchICCalls(); |
395 void ShareMegamorphicBuckets(); | 395 void ShareMegamorphicBuckets(); |
396 void DedupStackmaps(); | 396 void DedupStackMaps(); |
397 void DedupLists(); | 397 void DedupLists(); |
398 void DedupInstructions(); | 398 void DedupInstructions(); |
399 void ResetPrecompilerState(); | 399 void ResetPrecompilerState(); |
400 | 400 |
401 void CollectDynamicFunctionNames(); | 401 void CollectDynamicFunctionNames(); |
402 | 402 |
403 void PrecompileStaticInitializers(); | 403 void PrecompileStaticInitializers(); |
404 void PrecompileConstructors(); | 404 void PrecompileConstructors(); |
405 | 405 |
406 template <typename T> | 406 template <typename T> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } | 481 } |
482 static RawObject* NewKey(const Function& function) { return function.raw(); } | 482 static RawObject* NewKey(const Function& function) { return function.raw(); } |
483 }; | 483 }; |
484 | 484 |
485 typedef UnorderedHashSet<FunctionsTraits> UniqueFunctionsSet; | 485 typedef UnorderedHashSet<FunctionsTraits> UniqueFunctionsSet; |
486 | 486 |
487 | 487 |
488 } // namespace dart | 488 } // namespace dart |
489 | 489 |
490 #endif // RUNTIME_VM_PRECOMPILER_H_ | 490 #endif // RUNTIME_VM_PRECOMPILER_H_ |
OLD | NEW |