Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: src/compiler/state-values-utils.cc

Issue 2351393003: [base] Revert "Move hashmap allocator to a field" (Closed)
Patch Set: Whoops, patch sets should build Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/base/hashmap.h ('k') | src/crankshaft/hydrogen-bce.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/base/hashmap.h ('k') | src/crankshaft/hydrogen-bce.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698