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 6805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6816 Label* done, | 6816 Label* done, |
6817 Register properties, | 6817 Register properties, |
6818 Handle<String> name, | 6818 Handle<String> name, |
6819 Register r0) { | 6819 Register r0) { |
6820 ASSERT(name->IsSymbol()); | 6820 ASSERT(name->IsSymbol()); |
6821 | 6821 |
6822 // If names of slots in range from 1 to kProbes - 1 for the hash value are | 6822 // If names of slots in range from 1 to kProbes - 1 for the hash value are |
6823 // not equal to the name and kProbes-th slot is not used (its name is the | 6823 // not equal to the name and kProbes-th slot is not used (its name is the |
6824 // undefined value), it guarantees the hash table doesn't contain the | 6824 // undefined value), it guarantees the hash table doesn't contain the |
6825 // property. It's true even if some slots represent deleted properties | 6825 // property. It's true even if some slots represent deleted properties |
6826 // (their names are the null value). | 6826 // (their names are the hole value). |
6827 for (int i = 0; i < kInlinedProbes; i++) { | 6827 for (int i = 0; i < kInlinedProbes; i++) { |
6828 // Compute the masked index: (hash + i + i * i) & mask. | 6828 // Compute the masked index: (hash + i + i * i) & mask. |
6829 Register index = r0; | 6829 Register index = r0; |
6830 // Capacity is smi 2^n. | 6830 // Capacity is smi 2^n. |
6831 __ mov(index, FieldOperand(properties, kCapacityOffset)); | 6831 __ mov(index, FieldOperand(properties, kCapacityOffset)); |
6832 __ dec(index); | 6832 __ dec(index); |
6833 __ and_(index, | 6833 __ and_(index, |
6834 Immediate(Smi::FromInt(name->Hash() + | 6834 Immediate(Smi::FromInt(name->Hash() + |
6835 StringDictionary::GetProbeOffset(i)))); | 6835 StringDictionary::GetProbeOffset(i)))); |
6836 | 6836 |
6837 // Scale the index by multiplying by the entry size. | 6837 // Scale the index by multiplying by the entry size. |
6838 ASSERT(StringDictionary::kEntrySize == 3); | 6838 ASSERT(StringDictionary::kEntrySize == 3); |
6839 __ lea(index, Operand(index, index, times_2, 0)); // index *= 3. | 6839 __ lea(index, Operand(index, index, times_2, 0)); // index *= 3. |
6840 Register entity_name = r0; | 6840 Register entity_name = r0; |
6841 // Having undefined at this place means the name is not contained. | 6841 // Having undefined at this place means the name is not contained. |
6842 ASSERT_EQ(kSmiTagSize, 1); | 6842 ASSERT_EQ(kSmiTagSize, 1); |
6843 __ mov(entity_name, Operand(properties, index, times_half_pointer_size, | 6843 __ mov(entity_name, Operand(properties, index, times_half_pointer_size, |
6844 kElementsStartOffset - kHeapObjectTag)); | 6844 kElementsStartOffset - kHeapObjectTag)); |
6845 __ cmp(entity_name, masm->isolate()->factory()->undefined_value()); | 6845 __ cmp(entity_name, masm->isolate()->factory()->undefined_value()); |
6846 __ j(equal, done); | 6846 __ j(equal, done); |
6847 | 6847 |
6848 // Stop if found the property. | 6848 // Stop if found the property. |
6849 __ cmp(entity_name, Handle<String>(name)); | 6849 __ cmp(entity_name, Handle<String>(name)); |
6850 __ j(equal, miss); | 6850 __ j(equal, miss); |
6851 | 6851 |
| 6852 Label the_hole; |
| 6853 // Check for the hole and skip. |
| 6854 __ cmp(entity_name, masm->isolate()->factory()->the_hole_value()); |
| 6855 __ j(equal, &the_hole, Label::kNear); |
| 6856 |
6852 // Check if the entry name is not a symbol. | 6857 // Check if the entry name is not a symbol. |
6853 __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); | 6858 __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); |
6854 __ test_b(FieldOperand(entity_name, Map::kInstanceTypeOffset), | 6859 __ test_b(FieldOperand(entity_name, Map::kInstanceTypeOffset), |
6855 kIsSymbolMask); | 6860 kIsSymbolMask); |
6856 __ j(zero, miss); | 6861 __ j(zero, miss); |
| 6862 __ bind(&the_hole); |
6857 } | 6863 } |
6858 | 6864 |
6859 StringDictionaryLookupStub stub(properties, | 6865 StringDictionaryLookupStub stub(properties, |
6860 r0, | 6866 r0, |
6861 r0, | 6867 r0, |
6862 StringDictionaryLookupStub::NEGATIVE_LOOKUP); | 6868 StringDictionaryLookupStub::NEGATIVE_LOOKUP); |
6863 __ push(Immediate(Handle<Object>(name))); | 6869 __ push(Immediate(Handle<Object>(name))); |
6864 __ push(Immediate(name->Hash())); | 6870 __ push(Immediate(name->Hash())); |
6865 __ CallStub(&stub); | 6871 __ CallStub(&stub); |
6866 __ test(r0, r0); | 6872 __ test(r0, r0); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7379 false); | 7385 false); |
7380 __ pop(edx); | 7386 __ pop(edx); |
7381 __ ret(0); | 7387 __ ret(0); |
7382 } | 7388 } |
7383 | 7389 |
7384 #undef __ | 7390 #undef __ |
7385 | 7391 |
7386 } } // namespace v8::internal | 7392 } } // namespace v8::internal |
7387 | 7393 |
7388 #endif // V8_TARGET_ARCH_IA32 | 7394 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |