Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index c6251157f28c373895feecbaba9e609023203ef9..92f26fc27b3cf9e7ee17bd6b7aaadddf14b40484 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -118,7 +118,6 @@ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
__ IncrementCounter(counters->negative_lookups(), 1); |
__ IncrementCounter(counters->negative_lookups_miss(), 1); |
- Label done; |
__ mov(r0, FieldOperand(receiver, HeapObject::kMapOffset)); |
const int kInterceptorOrAccessCheckNeededMask = |
@@ -154,6 +153,8 @@ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
StringDictionary::kHeaderSize + |
StringDictionary::kElementsStartIndex * kPointerSize; |
+ Label done; |
+ |
// If names of slots in range from 1 to kProbes - 1 for the hash value are |
// not equal to the name and kProbes-th slot is not used (its name is the |
// undefined value), it guarantees the hash table doesn't contain the |
@@ -167,37 +168,40 @@ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
__ mov(index, FieldOperand(properties, kCapacityOffset)); |
__ dec(index); |
__ and_(Operand(index), |
- Immediate(Smi::FromInt(name->Hash() + |
+ Immediate(Smi::FromInt(name->Hash() + |
Mads Ager (chromium)
2011/05/04 15:03:21
Accidental edit?
|
StringDictionary::GetProbeOffset(i)))); |
// Scale the index by multiplying by the entry size. |
ASSERT(StringDictionary::kEntrySize == 3); |
__ lea(index, Operand(index, index, times_2, 0)); // index *= 3. |
- |
Register entity_name = r1; |
// Having undefined at this place means the name is not contained. |
ASSERT_EQ(kSmiTagSize, 1); |
__ mov(entity_name, Operand(properties, index, times_half_pointer_size, |
kElementsStartOffset - kHeapObjectTag)); |
__ cmp(entity_name, masm->isolate()->factory()->undefined_value()); |
- if (i != kProbes - 1) { |
- __ j(equal, &done, taken); |
- |
- // Stop if found the property. |
- __ cmp(entity_name, Handle<String>(name)); |
- __ j(equal, miss_label, not_taken); |
- |
- // Check if the entry name is not a symbol. |
- __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); |
- __ test_b(FieldOperand(entity_name, Map::kInstanceTypeOffset), |
- kIsSymbolMask); |
- __ j(zero, miss_label, not_taken); |
- } else { |
- // Give up probing if still not found the undefined value. |
- __ j(not_equal, miss_label, not_taken); |
- } |
- } |
- |
+ __ j(equal, &done, taken); |
+ |
+ // Stop if found the property. |
+ __ cmp(entity_name, Handle<String>(name)); |
+ __ j(equal, miss_label, not_taken); |
+ |
+ // Check if the entry name is not a symbol. |
+ __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); |
+ __ test_b(FieldOperand(entity_name, Map::kInstanceTypeOffset), |
+ kIsSymbolMask); |
+ __ j(zero, miss_label, not_taken); |
+ } |
+ |
+ StringDictionaryLookupStub stub(properties, |
+ r1, |
+ r1, |
+ StringDictionaryLookupStub::NEGATIVE_LOOKUP); |
+ __ push(Immediate(Handle<Object>(name))); |
+ __ push(Immediate(name->Hash())); |
+ __ CallStub(&stub); |
+ __ test(r1, Operand(r1)); |
+ __ j(not_zero, miss_label); |
__ bind(&done); |
__ DecrementCounter(counters->negative_lookups_miss(), 1); |
} |