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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 9463012: Fix the negative lookup stub to handle deleted entries in a (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 10 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/ia32/code-stubs-ia32.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 6794 matching lines...) Expand 10 before | Expand all | Expand 10 after
6805 Label* miss, 6805 Label* miss,
6806 Label* done, 6806 Label* done,
6807 Register receiver, 6807 Register receiver,
6808 Register properties, 6808 Register properties,
6809 Handle<String> name, 6809 Handle<String> name,
6810 Register scratch0) { 6810 Register scratch0) {
6811 // If names of slots in range from 1 to kProbes - 1 for the hash value are 6811 // If names of slots in range from 1 to kProbes - 1 for the hash value are
6812 // not equal to the name and kProbes-th slot is not used (its name is the 6812 // not equal to the name and kProbes-th slot is not used (its name is the
6813 // undefined value), it guarantees the hash table doesn't contain the 6813 // undefined value), it guarantees the hash table doesn't contain the
6814 // property. It's true even if some slots represent deleted properties 6814 // property. It's true even if some slots represent deleted properties
6815 // (their names are the null value). 6815 // (their names are the hole value).
6816 for (int i = 0; i < kInlinedProbes; i++) { 6816 for (int i = 0; i < kInlinedProbes; i++) {
6817 // scratch0 points to properties hash. 6817 // scratch0 points to properties hash.
6818 // Compute the masked index: (hash + i + i * i) & mask. 6818 // Compute the masked index: (hash + i + i * i) & mask.
6819 Register index = scratch0; 6819 Register index = scratch0;
6820 // Capacity is smi 2^n. 6820 // Capacity is smi 2^n.
6821 __ ldr(index, FieldMemOperand(properties, kCapacityOffset)); 6821 __ ldr(index, FieldMemOperand(properties, kCapacityOffset));
6822 __ sub(index, index, Operand(1)); 6822 __ sub(index, index, Operand(1));
6823 __ and_(index, index, Operand( 6823 __ and_(index, index, Operand(
6824 Smi::FromInt(name->Hash() + StringDictionary::GetProbeOffset(i)))); 6824 Smi::FromInt(name->Hash() + StringDictionary::GetProbeOffset(i))));
6825 6825
6826 // Scale the index by multiplying by the entry size. 6826 // Scale the index by multiplying by the entry size.
6827 ASSERT(StringDictionary::kEntrySize == 3); 6827 ASSERT(StringDictionary::kEntrySize == 3);
6828 __ add(index, index, Operand(index, LSL, 1)); // index *= 3. 6828 __ add(index, index, Operand(index, LSL, 1)); // index *= 3.
6829 6829
6830 Register entity_name = scratch0; 6830 Register entity_name = scratch0;
6831 // Having undefined at this place means the name is not contained. 6831 // Having undefined at this place means the name is not contained.
6832 ASSERT_EQ(kSmiTagSize, 1); 6832 ASSERT_EQ(kSmiTagSize, 1);
6833 Register tmp = properties; 6833 Register tmp = properties;
6834 __ add(tmp, properties, Operand(index, LSL, 1)); 6834 __ add(tmp, properties, Operand(index, LSL, 1));
6835 __ ldr(entity_name, FieldMemOperand(tmp, kElementsStartOffset)); 6835 __ ldr(entity_name, FieldMemOperand(tmp, kElementsStartOffset));
6836 6836
6837 ASSERT(!tmp.is(entity_name)); 6837 ASSERT(!tmp.is(entity_name));
6838 __ LoadRoot(tmp, Heap::kUndefinedValueRootIndex); 6838 __ LoadRoot(tmp, Heap::kUndefinedValueRootIndex);
6839 __ cmp(entity_name, tmp); 6839 __ cmp(entity_name, tmp);
6840 __ b(eq, done); 6840 __ b(eq, done);
6841 6841
6842 if (i != kInlinedProbes - 1) { 6842 if (i != kInlinedProbes - 1) {
6843 // Load the hole ready for use below:
6844 __ LoadRoot(tmp, Heap::kTheHoleValueRootIndex);
6845
6843 // Stop if found the property. 6846 // Stop if found the property.
6844 __ cmp(entity_name, Operand(Handle<String>(name))); 6847 __ cmp(entity_name, Operand(Handle<String>(name)));
6845 __ b(eq, miss); 6848 __ b(eq, miss);
6846 6849
6850 Label the_hole;
6851 __ cmp(entity_name, tmp);
6852 __ b(eq, &the_hole);
6853
6847 // Check if the entry name is not a symbol. 6854 // Check if the entry name is not a symbol.
6848 __ ldr(entity_name, FieldMemOperand(entity_name, HeapObject::kMapOffset)); 6855 __ ldr(entity_name, FieldMemOperand(entity_name, HeapObject::kMapOffset));
6849 __ ldrb(entity_name, 6856 __ ldrb(entity_name,
6850 FieldMemOperand(entity_name, Map::kInstanceTypeOffset)); 6857 FieldMemOperand(entity_name, Map::kInstanceTypeOffset));
6851 __ tst(entity_name, Operand(kIsSymbolMask)); 6858 __ tst(entity_name, Operand(kIsSymbolMask));
6852 __ b(eq, miss); 6859 __ b(eq, miss);
6853 6860
6861 __ bind(&the_hole);
6862
6854 // Restore the properties. 6863 // Restore the properties.
6855 __ ldr(properties, 6864 __ ldr(properties,
6856 FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 6865 FieldMemOperand(receiver, JSObject::kPropertiesOffset));
6857 } 6866 }
6858 } 6867 }
6859 6868
6860 const int spill_mask = 6869 const int spill_mask =
6861 (lr.bit() | r6.bit() | r5.bit() | r4.bit() | r3.bit() | 6870 (lr.bit() | r6.bit() | r5.bit() | r4.bit() | r3.bit() |
6862 r2.bit() | r1.bit() | r0.bit()); 6871 r2.bit() | r1.bit() | r0.bit());
6863 6872
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
7371 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r2, 7380 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r2,
7372 &slow_elements); 7381 &slow_elements);
7373 __ Ret(); 7382 __ Ret();
7374 } 7383 }
7375 7384
7376 #undef __ 7385 #undef __
7377 7386
7378 } } // namespace v8::internal 7387 } } // namespace v8::internal
7379 7388
7380 #endif // V8_TARGET_ARCH_ARM 7389 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698