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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 19492007: Generate KeyedLoadDictionaryElementStub with Hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add V8_OVERRIDE Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 Label done; 1457 Label done;
1458 1458
1459 GetNumberHash(r0, r1); 1459 GetNumberHash(r0, r1);
1460 1460
1461 // Compute capacity mask. 1461 // Compute capacity mask.
1462 mov(r1, FieldOperand(elements, SeededNumberDictionary::kCapacityOffset)); 1462 mov(r1, FieldOperand(elements, SeededNumberDictionary::kCapacityOffset));
1463 shr(r1, kSmiTagSize); // convert smi to int 1463 shr(r1, kSmiTagSize); // convert smi to int
1464 dec(r1); 1464 dec(r1);
1465 1465
1466 // Generate an unrolled loop that performs a few probes before giving up. 1466 // Generate an unrolled loop that performs a few probes before giving up.
1467 const int kProbes = 4; 1467 for (int i = 0; i < kNumberDictionaryProbes; i++) {
1468 for (int i = 0; i < kProbes; i++) {
1469 // Use r2 for index calculations and keep the hash intact in r0. 1468 // Use r2 for index calculations and keep the hash intact in r0.
1470 mov(r2, r0); 1469 mov(r2, r0);
1471 // Compute the masked index: (hash + i + i * i) & mask. 1470 // Compute the masked index: (hash + i + i * i) & mask.
1472 if (i > 0) { 1471 if (i > 0) {
1473 add(r2, Immediate(SeededNumberDictionary::GetProbeOffset(i))); 1472 add(r2, Immediate(SeededNumberDictionary::GetProbeOffset(i)));
1474 } 1473 }
1475 and_(r2, r1); 1474 and_(r2, r1);
1476 1475
1477 // Scale the index by multiplying by the entry size. 1476 // Scale the index by multiplying by the entry size.
1478 ASSERT(SeededNumberDictionary::kEntrySize == 3); 1477 ASSERT(SeededNumberDictionary::kEntrySize == 3);
1479 lea(r2, Operand(r2, r2, times_2, 0)); // r2 = r2 * 3 1478 lea(r2, Operand(r2, r2, times_2, 0)); // r2 = r2 * 3
1480 1479
1481 // Check if the key matches. 1480 // Check if the key matches.
1482 cmp(key, FieldOperand(elements, 1481 cmp(key, FieldOperand(elements,
1483 r2, 1482 r2,
1484 times_pointer_size, 1483 times_pointer_size,
1485 SeededNumberDictionary::kElementsStartOffset)); 1484 SeededNumberDictionary::kElementsStartOffset));
1486 if (i != (kProbes - 1)) { 1485 if (i != (kNumberDictionaryProbes - 1)) {
1487 j(equal, &done); 1486 j(equal, &done);
1488 } else { 1487 } else {
1489 j(not_equal, miss); 1488 j(not_equal, miss);
1490 } 1489 }
1491 } 1490 }
1492 1491
1493 bind(&done); 1492 bind(&done);
1494 // Check that the value is a normal propety. 1493 // Check that the value is a normal propety.
1495 const int kDetailsOffset = 1494 const int kDetailsOffset =
1496 SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize; 1495 SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
(...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after
3546 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); 3545 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top));
3547 j(greater, no_memento_found); 3546 j(greater, no_memento_found);
3548 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), 3547 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize),
3549 Immediate(isolate()->factory()->allocation_memento_map())); 3548 Immediate(isolate()->factory()->allocation_memento_map()));
3550 } 3549 }
3551 3550
3552 3551
3553 } } // namespace v8::internal 3552 } } // namespace v8::internal
3554 3553
3555 #endif // V8_TARGET_ARCH_IA32 3554 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/hydrogen.cc ('K') | « src/ia32/code-stubs-ia32.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698