| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_KERNEL_TO_IL_H_ | 5 #ifndef RUNTIME_VM_KERNEL_TO_IL_H_ |
| 6 #define RUNTIME_VM_KERNEL_TO_IL_H_ | 6 #define RUNTIME_VM_KERNEL_TO_IL_H_ |
| 7 | 7 |
| 8 #if !defined(DART_PRECOMPILED_RUNTIME) | 8 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 9 | 9 |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } else { | 74 } else { |
| 75 return pair->value; | 75 return pair->value; |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 inline Pair* LookupPair(const Key& key) { | 79 inline Pair* LookupPair(const Key& key) { |
| 80 return DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key); | 80 return DirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key); |
| 81 } | 81 } |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 template <typename K, typename V> |
| 85 class MallocMap |
| 86 : public MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> > { |
| 87 public: |
| 88 typedef typename RawPointerKeyValueTrait<K, V>::Key Key; |
| 89 typedef typename RawPointerKeyValueTrait<K, V>::Value Value; |
| 90 typedef typename RawPointerKeyValueTrait<K, V>::Pair Pair; |
| 91 |
| 92 inline void Insert(const Key& key, const Value& value) { |
| 93 Pair pair(key, value); |
| 94 MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Insert(pair); |
| 95 } |
| 96 |
| 97 inline V Lookup(const Key& key) { |
| 98 Pair* pair = |
| 99 MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup(key); |
| 100 if (pair == NULL) { |
| 101 return V(); |
| 102 } else { |
| 103 return pair->value; |
| 104 } |
| 105 } |
| 106 |
| 107 inline Pair* LookupPair(const Key& key) { |
| 108 return MallocDirectChainedHashMap<RawPointerKeyValueTrait<K, V> >::Lookup( |
| 109 key); |
| 110 } |
| 111 }; |
| 112 |
| 84 class BreakableBlock; | 113 class BreakableBlock; |
| 85 class CatchBlock; | 114 class CatchBlock; |
| 86 class FlowGraphBuilder; | 115 class FlowGraphBuilder; |
| 87 class SwitchBlock; | 116 class SwitchBlock; |
| 88 class TryCatchBlock; | 117 class TryCatchBlock; |
| 89 class TryFinallyBlock; | 118 class TryFinallyBlock; |
| 90 | 119 |
| 91 class Fragment { | 120 class Fragment { |
| 92 public: | 121 public: |
| 93 Instruction* entry; | 122 Instruction* entry; |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 namespace kernel { | 999 namespace kernel { |
| 971 | 1000 |
| 972 RawObject* EvaluateMetadata(TreeNode* const kernel_node); | 1001 RawObject* EvaluateMetadata(TreeNode* const kernel_node); |
| 973 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node); | 1002 RawObject* BuildParameterDescriptor(TreeNode* const kernel_node); |
| 974 | 1003 |
| 975 } // namespace kernel | 1004 } // namespace kernel |
| 976 } // namespace dart | 1005 } // namespace dart |
| 977 | 1006 |
| 978 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 1007 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 979 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ | 1008 #endif // RUNTIME_VM_KERNEL_TO_IL_H_ |
| OLD | NEW |