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

Side by Side Diff: src/crankshaft/hydrogen-bce.cc

Issue 2369963002: [base] Remove PointersMatch, making a separate std::equals hashmap (Closed)
Patch Set: Fix the other simulators Created 4 years, 2 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/crankshaft/hydrogen-bce.h ('k') | src/d8.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/crankshaft/hydrogen-bce.h" 5 #include "src/crankshaft/hydrogen-bce.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 10
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 DISALLOW_COPY_AND_ASSIGN(BoundsCheckBbData); 300 DISALLOW_COPY_AND_ASSIGN(BoundsCheckBbData);
301 }; 301 };
302 302
303 303
304 static bool BoundsCheckKeyMatch(void* key1, void* key2) { 304 static bool BoundsCheckKeyMatch(void* key1, void* key2) {
305 BoundsCheckKey* k1 = static_cast<BoundsCheckKey*>(key1); 305 BoundsCheckKey* k1 = static_cast<BoundsCheckKey*>(key1);
306 BoundsCheckKey* k2 = static_cast<BoundsCheckKey*>(key2); 306 BoundsCheckKey* k2 = static_cast<BoundsCheckKey*>(key2);
307 return k1->IndexBase() == k2->IndexBase() && k1->Length() == k2->Length(); 307 return k1->IndexBase() == k2->IndexBase() && k1->Length() == k2->Length();
308 } 308 }
309 309
310
311 BoundsCheckTable::BoundsCheckTable(Zone* zone) 310 BoundsCheckTable::BoundsCheckTable(Zone* zone)
312 : ZoneHashMap(BoundsCheckKeyMatch, ZoneHashMap::kDefaultHashMapCapacity, 311 : CustomMatcherZoneHashMap(BoundsCheckKeyMatch,
313 ZoneAllocationPolicy(zone)) { } 312 ZoneHashMap::kDefaultHashMapCapacity,
314 313 ZoneAllocationPolicy(zone)) {}
315 314
316 BoundsCheckBbData** BoundsCheckTable::LookupOrInsert(BoundsCheckKey* key, 315 BoundsCheckBbData** BoundsCheckTable::LookupOrInsert(BoundsCheckKey* key,
317 Zone* zone) { 316 Zone* zone) {
318 return reinterpret_cast<BoundsCheckBbData**>(&( 317 return reinterpret_cast<BoundsCheckBbData**>(
319 ZoneHashMap::LookupOrInsert(key, key->Hash(), ZoneAllocationPolicy(zone)) 318 &(CustomMatcherZoneHashMap::LookupOrInsert(key, key->Hash(),
320 ->value)); 319 ZoneAllocationPolicy(zone))
320 ->value));
321 } 321 }
322 322
323 323
324 void BoundsCheckTable::Insert(BoundsCheckKey* key, 324 void BoundsCheckTable::Insert(BoundsCheckKey* key,
325 BoundsCheckBbData* data, 325 BoundsCheckBbData* data,
326 Zone* zone) { 326 Zone* zone) {
327 ZoneHashMap::LookupOrInsert(key, key->Hash(), ZoneAllocationPolicy(zone)) 327 CustomMatcherZoneHashMap::LookupOrInsert(key, key->Hash(),
328 ZoneAllocationPolicy(zone))
328 ->value = data; 329 ->value = data;
329 } 330 }
330 331
331 332
332 void BoundsCheckTable::Delete(BoundsCheckKey* key) { 333 void BoundsCheckTable::Delete(BoundsCheckKey* key) {
333 Remove(key, key->Hash()); 334 Remove(key, key->Hash());
334 } 335 }
335 336
336 337
337 class HBoundsCheckEliminationState { 338 class HBoundsCheckEliminationState {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone()); 469 table_.Insert(data->Key(), data->FatherInDominatorTree(), zone());
469 } else { 470 } else {
470 table_.Delete(data->Key()); 471 table_.Delete(data->Key());
471 } 472 }
472 data = data->NextInBasicBlock(); 473 data = data->NextInBasicBlock();
473 } 474 }
474 } 475 }
475 476
476 } // namespace internal 477 } // namespace internal
477 } // namespace v8 478 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-bce.h ('k') | src/d8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698