| OLD | NEW |
| 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 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 Label done; | 1616 Label done; |
| 1617 | 1617 |
| 1618 GetNumberHash(t0, t1); | 1618 GetNumberHash(t0, t1); |
| 1619 | 1619 |
| 1620 // Compute the capacity mask. | 1620 // Compute the capacity mask. |
| 1621 ldr(t1, FieldMemOperand(elements, SeededNumberDictionary::kCapacityOffset)); | 1621 ldr(t1, FieldMemOperand(elements, SeededNumberDictionary::kCapacityOffset)); |
| 1622 SmiUntag(t1); | 1622 SmiUntag(t1); |
| 1623 sub(t1, t1, Operand(1)); | 1623 sub(t1, t1, Operand(1)); |
| 1624 | 1624 |
| 1625 // Generate an unrolled loop that performs a few probes before giving up. | 1625 // Generate an unrolled loop that performs a few probes before giving up. |
| 1626 static const int kProbes = 4; | 1626 for (int i = 0; i < kNumberDictionaryProbes; i++) { |
| 1627 for (int i = 0; i < kProbes; i++) { | |
| 1628 // Use t2 for index calculations and keep the hash intact in t0. | 1627 // Use t2 for index calculations and keep the hash intact in t0. |
| 1629 mov(t2, t0); | 1628 mov(t2, t0); |
| 1630 // Compute the masked index: (hash + i + i * i) & mask. | 1629 // Compute the masked index: (hash + i + i * i) & mask. |
| 1631 if (i > 0) { | 1630 if (i > 0) { |
| 1632 add(t2, t2, Operand(SeededNumberDictionary::GetProbeOffset(i))); | 1631 add(t2, t2, Operand(SeededNumberDictionary::GetProbeOffset(i))); |
| 1633 } | 1632 } |
| 1634 and_(t2, t2, Operand(t1)); | 1633 and_(t2, t2, Operand(t1)); |
| 1635 | 1634 |
| 1636 // Scale the index by multiplying by the element size. | 1635 // Scale the index by multiplying by the element size. |
| 1637 ASSERT(SeededNumberDictionary::kEntrySize == 3); | 1636 ASSERT(SeededNumberDictionary::kEntrySize == 3); |
| 1638 add(t2, t2, Operand(t2, LSL, 1)); // t2 = t2 * 3 | 1637 add(t2, t2, Operand(t2, LSL, 1)); // t2 = t2 * 3 |
| 1639 | 1638 |
| 1640 // Check if the key is identical to the name. | 1639 // Check if the key is identical to the name. |
| 1641 add(t2, elements, Operand(t2, LSL, kPointerSizeLog2)); | 1640 add(t2, elements, Operand(t2, LSL, kPointerSizeLog2)); |
| 1642 ldr(ip, FieldMemOperand(t2, SeededNumberDictionary::kElementsStartOffset)); | 1641 ldr(ip, FieldMemOperand(t2, SeededNumberDictionary::kElementsStartOffset)); |
| 1643 cmp(key, Operand(ip)); | 1642 cmp(key, Operand(ip)); |
| 1644 if (i != kProbes - 1) { | 1643 if (i != kNumberDictionaryProbes - 1) { |
| 1645 b(eq, &done); | 1644 b(eq, &done); |
| 1646 } else { | 1645 } else { |
| 1647 b(ne, miss); | 1646 b(ne, miss); |
| 1648 } | 1647 } |
| 1649 } | 1648 } |
| 1650 | 1649 |
| 1651 bind(&done); | 1650 bind(&done); |
| 1652 // Check that the value is a normal property. | 1651 // Check that the value is a normal property. |
| 1653 // t2: elements + (index * kPointerSize) | 1652 // t2: elements + (index * kPointerSize) |
| 1654 const int kDetailsOffset = | 1653 const int kDetailsOffset = |
| (...skipping 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3991 void CodePatcher::EmitCondition(Condition cond) { | 3990 void CodePatcher::EmitCondition(Condition cond) { |
| 3992 Instr instr = Assembler::instr_at(masm_.pc_); | 3991 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3993 instr = (instr & ~kCondMask) | cond; | 3992 instr = (instr & ~kCondMask) | cond; |
| 3994 masm_.emit(instr); | 3993 masm_.emit(instr); |
| 3995 } | 3994 } |
| 3996 | 3995 |
| 3997 | 3996 |
| 3998 } } // namespace v8::internal | 3997 } } // namespace v8::internal |
| 3999 | 3998 |
| 4000 #endif // V8_TARGET_ARCH_ARM | 3999 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |