| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3642 | 3642 |
| 3643 ldr(scratch, FieldMemOperand(scratch, token_offset)); | 3643 ldr(scratch, FieldMemOperand(scratch, token_offset)); |
| 3644 ldr(Tmp0(), FieldMemOperand(Tmp0(), token_offset)); | 3644 ldr(Tmp0(), FieldMemOperand(Tmp0(), token_offset)); |
| 3645 cmp(scratch, Tmp0()); | 3645 cmp(scratch, Tmp0()); |
| 3646 b(miss, ne); | 3646 b(miss, ne); |
| 3647 | 3647 |
| 3648 bind(&same_contexts); | 3648 bind(&same_contexts); |
| 3649 } | 3649 } |
| 3650 | 3650 |
| 3651 | 3651 |
| 3652 // Compute the hash code from the untagged key. This must be kept in sync with |
| 3653 // ComputeIntegerHash in utils.h and KeyedLoadGenericElementStub in |
| 3654 // code-stub-hydrogen.cc |
| 3652 void MacroAssembler::GetNumberHash(Register key, Register scratch) { | 3655 void MacroAssembler::GetNumberHash(Register key, Register scratch) { |
| 3653 ASSERT(!AreAliased(key, scratch)); | 3656 ASSERT(!AreAliased(key, scratch)); |
| 3654 | 3657 |
| 3655 // Xor original key with a seed. | 3658 // Xor original key with a seed. |
| 3656 LoadRoot(scratch, Heap::kHashSeedRootIndex); | 3659 LoadRoot(scratch, Heap::kHashSeedRootIndex); |
| 3657 Eor(key, key, Operand::UntagSmi(scratch)); | 3660 Eor(key, key, Operand::UntagSmi(scratch)); |
| 3658 | 3661 |
| 3659 // The algorithm uses 32-bit integer values. | 3662 // The algorithm uses 32-bit integer values. |
| 3660 key = key.W(); | 3663 key = key.W(); |
| 3661 scratch = scratch.W(); | 3664 scratch = scratch.W(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3696 SmiUntag(scratch0, key); | 3699 SmiUntag(scratch0, key); |
| 3697 GetNumberHash(scratch0, scratch1); | 3700 GetNumberHash(scratch0, scratch1); |
| 3698 | 3701 |
| 3699 // Compute the capacity mask. | 3702 // Compute the capacity mask. |
| 3700 Ldrsw(scratch1, | 3703 Ldrsw(scratch1, |
| 3701 UntagSmiFieldMemOperand(elements, | 3704 UntagSmiFieldMemOperand(elements, |
| 3702 SeededNumberDictionary::kCapacityOffset)); | 3705 SeededNumberDictionary::kCapacityOffset)); |
| 3703 Sub(scratch1, scratch1, 1); | 3706 Sub(scratch1, scratch1, 1); |
| 3704 | 3707 |
| 3705 // Generate an unrolled loop that performs a few probes before giving up. | 3708 // Generate an unrolled loop that performs a few probes before giving up. |
| 3706 static const int kProbes = 4; | 3709 for (int i = 0; i < kNumberDictionaryProbes; i++) { |
| 3707 for (int i = 0; i < kProbes; i++) { | |
| 3708 // Compute the masked index: (hash + i + i * i) & mask. | 3710 // Compute the masked index: (hash + i + i * i) & mask. |
| 3709 if (i > 0) { | 3711 if (i > 0) { |
| 3710 Add(scratch2, scratch0, SeededNumberDictionary::GetProbeOffset(i)); | 3712 Add(scratch2, scratch0, SeededNumberDictionary::GetProbeOffset(i)); |
| 3711 } else { | 3713 } else { |
| 3712 Mov(scratch2, scratch0); | 3714 Mov(scratch2, scratch0); |
| 3713 } | 3715 } |
| 3714 And(scratch2, scratch2, scratch1); | 3716 And(scratch2, scratch2, scratch1); |
| 3715 | 3717 |
| 3716 // Scale the index by multiplying by the element size. | 3718 // Scale the index by multiplying by the element size. |
| 3717 ASSERT(SeededNumberDictionary::kEntrySize == 3); | 3719 ASSERT(SeededNumberDictionary::kEntrySize == 3); |
| 3718 Add(scratch2, scratch2, Operand(scratch2, LSL, 1)); | 3720 Add(scratch2, scratch2, Operand(scratch2, LSL, 1)); |
| 3719 | 3721 |
| 3720 // Check if the key is identical to the name. | 3722 // Check if the key is identical to the name. |
| 3721 Add(scratch2, elements, Operand(scratch2, LSL, kPointerSizeLog2)); | 3723 Add(scratch2, elements, Operand(scratch2, LSL, kPointerSizeLog2)); |
| 3722 Ldr(scratch3, | 3724 Ldr(scratch3, |
| 3723 FieldMemOperand(scratch2, | 3725 FieldMemOperand(scratch2, |
| 3724 SeededNumberDictionary::kElementsStartOffset)); | 3726 SeededNumberDictionary::kElementsStartOffset)); |
| 3725 Cmp(key, scratch3); | 3727 Cmp(key, scratch3); |
| 3726 if (i != kProbes - 1) { | 3728 if (i != (kNumberDictionaryProbes - 1)) { |
| 3727 B(eq, &done); | 3729 B(eq, &done); |
| 3728 } else { | 3730 } else { |
| 3729 B(ne, miss); | 3731 B(ne, miss); |
| 3730 } | 3732 } |
| 3731 } | 3733 } |
| 3732 | 3734 |
| 3733 Bind(&done); | 3735 Bind(&done); |
| 3734 // Check that the value is a normal property. | 3736 // Check that the value is a normal property. |
| 3735 const int kDetailsOffset = | 3737 const int kDetailsOffset = |
| 3736 SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize; | 3738 SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize; |
| (...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4758 } | 4760 } |
| 4759 } | 4761 } |
| 4760 | 4762 |
| 4761 | 4763 |
| 4762 #undef __ | 4764 #undef __ |
| 4763 | 4765 |
| 4764 | 4766 |
| 4765 } } // namespace v8::internal | 4767 } } // namespace v8::internal |
| 4766 | 4768 |
| 4767 #endif // V8_TARGET_ARCH_A64 | 4769 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |