OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/state-values-utils.h" | 5 #include "src/compiler/state-values-utils.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 } | 97 } |
98 return static_cast<int>(hash & 0x7fffffff); | 98 return static_cast<int>(hash & 0x7fffffff); |
99 } | 99 } |
100 | 100 |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 | 103 |
104 Node* StateValuesCache::GetValuesNodeFromCache(Node** nodes, size_t count) { | 104 Node* StateValuesCache::GetValuesNodeFromCache(Node** nodes, size_t count) { |
105 StateValuesKey key(count, nodes); | 105 StateValuesKey key(count, nodes); |
106 int hash = StateValuesHashKey(nodes, count); | 106 int hash = StateValuesHashKey(nodes, count); |
107 ZoneHashMap::Entry* lookup = hash_map_.LookupOrInsert(&key, hash); | 107 ZoneHashMap::Entry* lookup = |
| 108 hash_map_.LookupOrInsert(&key, hash, ZoneAllocationPolicy(zone())); |
108 DCHECK_NOT_NULL(lookup); | 109 DCHECK_NOT_NULL(lookup); |
109 Node* node; | 110 Node* node; |
110 if (lookup->value == nullptr) { | 111 if (lookup->value == nullptr) { |
111 int input_count = static_cast<int>(count); | 112 int input_count = static_cast<int>(count); |
112 node = graph()->NewNode(common()->StateValues(input_count), input_count, | 113 node = graph()->NewNode(common()->StateValues(input_count), input_count, |
113 nodes); | 114 nodes); |
114 NodeKey* new_key = new (zone()->New(sizeof(NodeKey))) NodeKey(node); | 115 NodeKey* new_key = new (zone()->New(sizeof(NodeKey))) NodeKey(node); |
115 lookup->key = new_key; | 116 lookup->key = new_key; |
116 lookup->value = node; | 117 lookup->value = node; |
117 } else { | 118 } else { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } else { | 308 } else { |
308 count++; | 309 count++; |
309 } | 310 } |
310 } | 311 } |
311 return count; | 312 return count; |
312 } | 313 } |
313 | 314 |
314 } // namespace compiler | 315 } // namespace compiler |
315 } // namespace internal | 316 } // namespace internal |
316 } // namespace v8 | 317 } // namespace v8 |
OLD | NEW |