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

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

Issue 9174023: Split NumberDictionary into a randomly seeded and an unseeded (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/code-stubs.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 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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 // t0 - holds the untagged key on entry and holds the hash once computed. 1465 // t0 - holds the untagged key on entry and holds the hash once computed.
1466 // 1466 //
1467 // t1 - used to hold the capacity mask of the dictionary 1467 // t1 - used to hold the capacity mask of the dictionary
1468 // 1468 //
1469 // t2 - used for the index into the dictionary. 1469 // t2 - used for the index into the dictionary.
1470 Label done; 1470 Label done;
1471 1471
1472 GetNumberHash(t0, t1); 1472 GetNumberHash(t0, t1);
1473 1473
1474 // Compute the capacity mask. 1474 // Compute the capacity mask.
1475 ldr(t1, FieldMemOperand(elements, NumberDictionary::kCapacityOffset)); 1475 ldr(t1, FieldMemOperand(elements, SeededNumberDictionary::kCapacityOffset));
1476 mov(t1, Operand(t1, ASR, kSmiTagSize)); // convert smi to int 1476 mov(t1, Operand(t1, ASR, kSmiTagSize)); // convert smi to int
1477 sub(t1, t1, Operand(1)); 1477 sub(t1, t1, Operand(1));
1478 1478
1479 // Generate an unrolled loop that performs a few probes before giving up. 1479 // Generate an unrolled loop that performs a few probes before giving up.
1480 static const int kProbes = 4; 1480 static const int kProbes = 4;
1481 for (int i = 0; i < kProbes; i++) { 1481 for (int i = 0; i < kProbes; i++) {
1482 // Use t2 for index calculations and keep the hash intact in t0. 1482 // Use t2 for index calculations and keep the hash intact in t0.
1483 mov(t2, t0); 1483 mov(t2, t0);
1484 // Compute the masked index: (hash + i + i * i) & mask. 1484 // Compute the masked index: (hash + i + i * i) & mask.
1485 if (i > 0) { 1485 if (i > 0) {
1486 add(t2, t2, Operand(NumberDictionary::GetProbeOffset(i))); 1486 add(t2, t2, Operand(SeededNumberDictionary::GetProbeOffset(i)));
1487 } 1487 }
1488 and_(t2, t2, Operand(t1)); 1488 and_(t2, t2, Operand(t1));
1489 1489
1490 // Scale the index by multiplying by the element size. 1490 // Scale the index by multiplying by the element size.
1491 ASSERT(NumberDictionary::kEntrySize == 3); 1491 ASSERT(SeededNumberDictionary::kEntrySize == 3);
1492 add(t2, t2, Operand(t2, LSL, 1)); // t2 = t2 * 3 1492 add(t2, t2, Operand(t2, LSL, 1)); // t2 = t2 * 3
1493 1493
1494 // Check if the key is identical to the name. 1494 // Check if the key is identical to the name.
1495 add(t2, elements, Operand(t2, LSL, kPointerSizeLog2)); 1495 add(t2, elements, Operand(t2, LSL, kPointerSizeLog2));
1496 ldr(ip, FieldMemOperand(t2, NumberDictionary::kElementsStartOffset)); 1496 ldr(ip, FieldMemOperand(t2, SeededNumberDictionary::kElementsStartOffset));
1497 cmp(key, Operand(ip)); 1497 cmp(key, Operand(ip));
1498 if (i != kProbes - 1) { 1498 if (i != kProbes - 1) {
1499 b(eq, &done); 1499 b(eq, &done);
1500 } else { 1500 } else {
1501 b(ne, miss); 1501 b(ne, miss);
1502 } 1502 }
1503 } 1503 }
1504 1504
1505 bind(&done); 1505 bind(&done);
1506 // Check that the value is a normal property. 1506 // Check that the value is a normal property.
1507 // t2: elements + (index * kPointerSize) 1507 // t2: elements + (index * kPointerSize)
1508 const int kDetailsOffset = 1508 const int kDetailsOffset =
1509 NumberDictionary::kElementsStartOffset + 2 * kPointerSize; 1509 SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize;
1510 ldr(t1, FieldMemOperand(t2, kDetailsOffset)); 1510 ldr(t1, FieldMemOperand(t2, kDetailsOffset));
1511 tst(t1, Operand(Smi::FromInt(PropertyDetails::TypeField::kMask))); 1511 tst(t1, Operand(Smi::FromInt(PropertyDetails::TypeField::kMask)));
1512 b(ne, miss); 1512 b(ne, miss);
1513 1513
1514 // Get the value at the masked, scaled index and return. 1514 // Get the value at the masked, scaled index and return.
1515 const int kValueOffset = 1515 const int kValueOffset =
1516 NumberDictionary::kElementsStartOffset + kPointerSize; 1516 SeededNumberDictionary::kElementsStartOffset + kPointerSize;
1517 ldr(result, FieldMemOperand(t2, kValueOffset)); 1517 ldr(result, FieldMemOperand(t2, kValueOffset));
1518 } 1518 }
1519 1519
1520 1520
1521 void MacroAssembler::AllocateInNewSpace(int object_size, 1521 void MacroAssembler::AllocateInNewSpace(int object_size,
1522 Register result, 1522 Register result,
1523 Register scratch1, 1523 Register scratch1,
1524 Register scratch2, 1524 Register scratch2,
1525 Label* gc_required, 1525 Label* gc_required,
1526 AllocationFlags flags) { 1526 AllocationFlags flags) {
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after
3666 void CodePatcher::EmitCondition(Condition cond) { 3666 void CodePatcher::EmitCondition(Condition cond) {
3667 Instr instr = Assembler::instr_at(masm_.pc_); 3667 Instr instr = Assembler::instr_at(masm_.pc_);
3668 instr = (instr & ~kCondMask) | cond; 3668 instr = (instr & ~kCondMask) | cond;
3669 masm_.emit(instr); 3669 masm_.emit(instr);
3670 } 3670 }
3671 3671
3672 3672
3673 } } // namespace v8::internal 3673 } } // namespace v8::internal
3674 3674
3675 #endif // V8_TARGET_ARCH_ARM 3675 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698