| 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 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 Label done; | 1559 Label done; |
| 1560 | 1560 |
| 1561 GetNumberHash(t0, t1); | 1561 GetNumberHash(t0, t1); |
| 1562 | 1562 |
| 1563 // Compute the capacity mask. | 1563 // Compute the capacity mask. |
| 1564 ldr(t1, FieldMemOperand(elements, SeededNumberDictionary::kCapacityOffset)); | 1564 ldr(t1, FieldMemOperand(elements, SeededNumberDictionary::kCapacityOffset)); |
| 1565 SmiUntag(t1); | 1565 SmiUntag(t1); |
| 1566 sub(t1, t1, Operand(1)); | 1566 sub(t1, t1, Operand(1)); |
| 1567 | 1567 |
| 1568 // Generate an unrolled loop that performs a few probes before giving up. | 1568 // Generate an unrolled loop that performs a few probes before giving up. |
| 1569 static const int kProbes = 4; | 1569 for (int i = 0; i < kNumberDictionaryProbes; i++) { |
| 1570 for (int i = 0; i < kProbes; i++) { | |
| 1571 // Use t2 for index calculations and keep the hash intact in t0. | 1570 // Use t2 for index calculations and keep the hash intact in t0. |
| 1572 mov(t2, t0); | 1571 mov(t2, t0); |
| 1573 // Compute the masked index: (hash + i + i * i) & mask. | 1572 // Compute the masked index: (hash + i + i * i) & mask. |
| 1574 if (i > 0) { | 1573 if (i > 0) { |
| 1575 add(t2, t2, Operand(SeededNumberDictionary::GetProbeOffset(i))); | 1574 add(t2, t2, Operand(SeededNumberDictionary::GetProbeOffset(i))); |
| 1576 } | 1575 } |
| 1577 and_(t2, t2, Operand(t1)); | 1576 and_(t2, t2, Operand(t1)); |
| 1578 | 1577 |
| 1579 // Scale the index by multiplying by the element size. | 1578 // Scale the index by multiplying by the element size. |
| 1580 ASSERT(SeededNumberDictionary::kEntrySize == 3); | 1579 ASSERT(SeededNumberDictionary::kEntrySize == 3); |
| 1581 add(t2, t2, Operand(t2, LSL, 1)); // t2 = t2 * 3 | 1580 add(t2, t2, Operand(t2, LSL, 1)); // t2 = t2 * 3 |
| 1582 | 1581 |
| 1583 // Check if the key is identical to the name. | 1582 // Check if the key is identical to the name. |
| 1584 add(t2, elements, Operand(t2, LSL, kPointerSizeLog2)); | 1583 add(t2, elements, Operand(t2, LSL, kPointerSizeLog2)); |
| 1585 ldr(ip, FieldMemOperand(t2, SeededNumberDictionary::kElementsStartOffset)); | 1584 ldr(ip, FieldMemOperand(t2, SeededNumberDictionary::kElementsStartOffset)); |
| 1586 cmp(key, Operand(ip)); | 1585 cmp(key, Operand(ip)); |
| 1587 if (i != kProbes - 1) { | 1586 if (i != kNumberDictionaryProbes - 1) { |
| 1588 b(eq, &done); | 1587 b(eq, &done); |
| 1589 } else { | 1588 } else { |
| 1590 b(ne, miss); | 1589 b(ne, miss); |
| 1591 } | 1590 } |
| 1592 } | 1591 } |
| 1593 | 1592 |
| 1594 bind(&done); | 1593 bind(&done); |
| 1595 // Check that the value is a normal property. | 1594 // Check that the value is a normal property. |
| 1596 // t2: elements + (index * kPointerSize) | 1595 // t2: elements + (index * kPointerSize) |
| 1597 const int kDetailsOffset = | 1596 const int kDetailsOffset = |
| (...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3960 void CodePatcher::EmitCondition(Condition cond) { | 3959 void CodePatcher::EmitCondition(Condition cond) { |
| 3961 Instr instr = Assembler::instr_at(masm_.pc_); | 3960 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3962 instr = (instr & ~kCondMask) | cond; | 3961 instr = (instr & ~kCondMask) | cond; |
| 3963 masm_.emit(instr); | 3962 masm_.emit(instr); |
| 3964 } | 3963 } |
| 3965 | 3964 |
| 3966 | 3965 |
| 3967 } } // namespace v8::internal | 3966 } } // namespace v8::internal |
| 3968 | 3967 |
| 3969 #endif // V8_TARGET_ARCH_ARM | 3968 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |