| Index: src/x64/stub-cache-x64.cc
|
| diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
|
| index ef6f7583882016c5133b4706b3cf4047aab6bf79..6c83606f1dc83e5dd61dd365720238b09ff59151 100644
|
| --- a/src/x64/stub-cache-x64.cc
|
| +++ b/src/x64/stub-cache-x64.cc
|
| @@ -93,7 +93,6 @@ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
|
| __ IncrementCounter(counters->negative_lookups(), 1);
|
| __ IncrementCounter(counters->negative_lookups_miss(), 1);
|
|
|
| - Label done;
|
| __ movq(r0, FieldOperand(receiver, HeapObject::kMapOffset));
|
|
|
| const int kInterceptorOrAccessCheckNeededMask =
|
| @@ -117,62 +116,13 @@ static void GenerateDictionaryNegativeLookup(MacroAssembler* masm,
|
| Heap::kHashTableMapRootIndex);
|
| __ j(not_equal, miss_label);
|
|
|
| - // Compute the capacity mask.
|
| - const int kCapacityOffset =
|
| - StringDictionary::kHeaderSize +
|
| - StringDictionary::kCapacityIndex * kPointerSize;
|
| -
|
| - // Generate an unrolled loop that performs a few probes before
|
| - // giving up.
|
| - static const int kProbes = 4;
|
| - const int kElementsStartOffset =
|
| - StringDictionary::kHeaderSize +
|
| - StringDictionary::kElementsStartIndex * kPointerSize;
|
| -
|
| - // 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
|
| - // property. It's true even if some slots represent deleted properties
|
| - // (their names are the null value).
|
| - for (int i = 0; i < kProbes; i++) {
|
| - // r0 points to properties hash.
|
| - // Compute the masked index: (hash + i + i * i) & mask.
|
| - Register index = r1;
|
| - // Capacity is smi 2^n.
|
| - __ SmiToInteger32(index, FieldOperand(properties, kCapacityOffset));
|
| - __ decl(index);
|
| - __ and_(index,
|
| - Immediate(name->Hash() + 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);
|
| - __ movq(entity_name, Operand(properties, index, times_pointer_size,
|
| - kElementsStartOffset - kHeapObjectTag));
|
| - __ Cmp(entity_name, masm->isolate()->factory()->undefined_value());
|
| - // __ jmp(miss_label);
|
| - if (i != kProbes - 1) {
|
| - __ j(equal, &done);
|
| -
|
| - // Stop if found the property.
|
| - __ Cmp(entity_name, Handle<String>(name));
|
| - __ j(equal, miss_label);
|
| -
|
| - // Check if the entry name is not a symbol.
|
| - __ movq(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset));
|
| - __ testb(FieldOperand(entity_name, Map::kInstanceTypeOffset),
|
| - Immediate(kIsSymbolMask));
|
| - __ j(zero, miss_label);
|
| - } else {
|
| - // Give up probing if still not found the undefined value.
|
| - __ j(not_equal, miss_label);
|
| - }
|
| - }
|
| -
|
| + Label done;
|
| + StringDictionaryLookupStub::GenerateNegativeLookup(masm,
|
| + miss_label,
|
| + &done,
|
| + properties,
|
| + name,
|
| + r1);
|
| __ bind(&done);
|
| __ DecrementCounter(counters->negative_lookups_miss(), 1);
|
| }
|
|
|