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

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

Issue 1074943002: Split TemplateHashMapImpl::Lookup into two methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm (and ppc) builds Created 5 years, 8 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/bootstrapper.cc ('k') | src/d8.h » ('j') | src/hashmap.h » ('J')
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 107 ZoneHashMap::Entry* lookup =
108 hash_map_.Lookup(&key, hash, true, ZoneAllocationPolicy(zone())); 108 hash_map_.LookupOrInsert(&key, hash, ZoneAllocationPolicy(zone()));
109 DCHECK_NOT_NULL(lookup); 109 DCHECK_NOT_NULL(lookup);
110 Node* node; 110 Node* node;
111 if (lookup->value == nullptr) { 111 if (lookup->value == nullptr) {
112 int input_count = static_cast<int>(count); 112 int input_count = static_cast<int>(count);
113 node = graph()->NewNode(common()->StateValues(input_count), input_count, 113 node = graph()->NewNode(common()->StateValues(input_count), input_count,
114 nodes); 114 nodes);
115 NodeKey* new_key = new (zone()->New(sizeof(NodeKey))) NodeKey(node); 115 NodeKey* new_key = new (zone()->New(sizeof(NodeKey))) NodeKey(node);
116 lookup->key = new_key; 116 lookup->key = new_key;
117 lookup->value = node; 117 lookup->value = node;
118 } else { 118 } else {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } else { 308 } else {
309 count++; 309 count++;
310 } 310 }
311 } 311 }
312 return count; 312 return count;
313 } 313 }
314 314
315 } // namespace compiler 315 } // namespace compiler
316 } // namespace internal 316 } // namespace internal
317 } // namespace v8 317 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/d8.h » ('j') | src/hashmap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698