535
534
__ mov(edi, FieldOperand(eax, String::kHashFieldOffset));
536
535
__ shr(edi, String::kHashShift);
537
536
__ xor_(ecx, edi);
538
__ and_(ecx, KeyedLookupCache::kCapacityMask);
537
__ and_(ecx, KeyedLookupCache::kCapacityMask & KeyedLookupCache::kHashMask);
540
539
// Load the key (consisting of map and symbol) from the cache and
541
540
// check for match.
541
Label load_in_object_property;
542
static const int kEntriesPerBucket = KeyedLookupCache::kEntriesPerBucket;
543
Label hit_on_nth_entry[kEntriesPerBucket];
542
544
ExternalReference cache_keys =
543
545
ExternalReference::keyed_lookup_cache_keys(masm->isolate());
547
for (int i = 0; i < kEntriesPerBucket - 1; i++) {
548
Label try_next_entry;
550
__ shl(edi, kPointerSizeLog2 + 1);
552
__ add(edi, Immediate(kPointerSize * i * 2));
554
__ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys));
555
__ j(not_equal, &try_next_entry);
556
__ add(edi, Immediate(kPointerSize));
557
__ cmp(eax, Operand::StaticArray(edi, times_1, cache_keys));
558
__ j(equal, &hit_on_nth_entry[i]);
559
__ bind(&try_next_entry);
562
__ lea(edi, Operand(ecx, 1));
545
563
__ shl(edi, kPointerSizeLog2 + 1);
564
__ add(edi, Immediate(kPointerSize * (kEntriesPerBucket - 1) * 2));
546
565
__ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys));
547
566
__ j(not_equal, &slow);
548
567
__ add(edi, Immediate(kPointerSize));
556
575
// ecx : lookup cache index
557
576
ExternalReference cache_field_offsets =
558
577
ExternalReference::keyed_lookup_cache_field_offsets(masm->isolate());
560
Operand::StaticArray(ecx, times_pointer_size, cache_field_offsets));
561
__ movzx_b(ecx, FieldOperand(ebx, Map::kInObjectPropertiesOffset));
563
__ j(above_equal, &property_array_property);
580
for (int i = kEntriesPerBucket - 1; i >= 0; i--) {
581
__ bind(&hit_on_nth_entry[i]);
583
__ add(ecx, Immediate(i));
586
Operand::StaticArray(ecx, times_pointer_size, cache_field_offsets));
587
__ movzx_b(ecx, FieldOperand(ebx, Map::kInObjectPropertiesOffset));
589
__ j(above_equal, &property_array_property);
591
__ jmp(&load_in_object_property);
565
595
// Load in-object property.
596
__ bind(&load_in_object_property);
566
597
__ movzx_b(ecx, FieldOperand(ebx, Map::kInstanceSizeOffset));
567
598
__ add(ecx, edi);
568
599
__ mov(eax, FieldOperand(edx, ecx, times_pointer_size, 0));
1374
1405
// -- esp[0] : return address
1375
1406
// -----------------------------------
1377
// This accepts as a receiver anything JSObject::SetElementsLength accepts
1408
// This accepts as a receiver anything JSArray::SetElementsLength accepts
1378
1409
// (currently anything except for external arrays which means anything with
1379
// elements of FixedArray type.), but currently is restricted to JSArray.
1380
// Value must be a number, but only smis are accepted as the most common case.
1410
// elements of FixedArray type). Value must be a number, but only smis are
1411
// accepted as the most common case.
1399
1430
__ CmpObjectType(scratch, FIXED_ARRAY_TYPE, scratch);
1400
1431
__ j(not_equal, &miss);
1433
// Check that the array has fast properties, otherwise the length
1434
// property might have been redefined.
1435
__ mov(scratch, FieldOperand(receiver, JSArray::kPropertiesOffset));
1436
__ CompareRoot(FieldOperand(scratch, FixedArray::kMapOffset),
1437
Heap::kHashTableMapRootIndex);
1402
1440
// Check that value is a smi.
1403
1441
__ JumpIfNotSmi(value, &miss);
1625
1663
rewritten = stub.GetCode();
1627
1665
ICCompareStub stub(op_, state);
1666
if (state == KNOWN_OBJECTS) {
1667
stub.set_known_map(Handle<Map>(Handle<JSObject>::cast(x)->map()));
1628
1669
rewritten = stub.GetCode();
1630
1671
set_target(*rewritten);