1031
1031
__ mov(r3, Operand(r2, ASR, KeyedLookupCache::kMapHashShift));
1032
1032
__ ldr(r4, FieldMemOperand(r0, String::kHashFieldOffset));
1033
1033
__ eor(r3, r3, Operand(r4, ASR, String::kHashShift));
1034
__ And(r3, r3, Operand(KeyedLookupCache::kCapacityMask));
1034
int mask = KeyedLookupCache::kCapacityMask & KeyedLookupCache::kHashMask;
1035
__ And(r3, r3, Operand(mask));
1036
1037
// Load the key (consisting of map and symbol) from the cache and
1037
1038
// check for match.
1039
Label load_in_object_property;
1040
static const int kEntriesPerBucket = KeyedLookupCache::kEntriesPerBucket;
1041
Label hit_on_nth_entry[kEntriesPerBucket];
1038
1042
ExternalReference cache_keys =
1039
1043
ExternalReference::keyed_lookup_cache_keys(isolate);
1040
1045
__ mov(r4, Operand(cache_keys));
1041
1046
__ add(r4, r4, Operand(r3, LSL, kPointerSizeLog2 + 1));
1042
__ ldr(r5, MemOperand(r4, kPointerSize, PostIndex)); // Move r4 to symbol.
1048
for (int i = 0; i < kEntriesPerBucket - 1; i++) {
1049
Label try_next_entry;
1050
// Load map and move r4 to next entry.
1051
__ ldr(r5, MemOperand(r4, kPointerSize * 2, PostIndex));
1053
__ b(ne, &try_next_entry);
1054
__ ldr(r5, MemOperand(r4, -kPointerSize)); // Load symbol
1056
__ b(eq, &hit_on_nth_entry[i]);
1057
__ bind(&try_next_entry);
1060
// Last entry: Load map and move r4 to symbol.
1061
__ ldr(r5, MemOperand(r4, kPointerSize, PostIndex));
1043
1062
__ cmp(r2, r5);
1044
1063
__ b(ne, &slow);
1045
1064
__ ldr(r5, MemOperand(r4));
1053
1072
// r3 : lookup cache index
1054
1073
ExternalReference cache_field_offsets =
1055
1074
ExternalReference::keyed_lookup_cache_field_offsets(isolate);
1056
__ mov(r4, Operand(cache_field_offsets));
1057
__ ldr(r5, MemOperand(r4, r3, LSL, kPointerSizeLog2));
1058
__ ldrb(r6, FieldMemOperand(r2, Map::kInObjectPropertiesOffset));
1059
__ sub(r5, r5, r6, SetCC);
1060
__ b(ge, &property_array_property);
1076
// Hit on nth entry.
1077
for (int i = kEntriesPerBucket - 1; i >= 0; i--) {
1078
__ bind(&hit_on_nth_entry[i]);
1079
__ mov(r4, Operand(cache_field_offsets));
1081
__ add(r3, r3, Operand(i));
1083
__ ldr(r5, MemOperand(r4, r3, LSL, kPointerSizeLog2));
1084
__ ldrb(r6, FieldMemOperand(r2, Map::kInObjectPropertiesOffset));
1085
__ sub(r5, r5, r6, SetCC);
1086
__ b(ge, &property_array_property);
1088
__ jmp(&load_in_object_property);
1062
1092
// Load in-object property.
1093
__ bind(&load_in_object_property);
1063
1094
__ ldrb(r6, FieldMemOperand(r2, Map::kInstanceSizeOffset));
1064
1095
__ add(r6, r6, r5); // Index from start of object.
1065
1096
__ sub(r1, r1, Operand(kHeapObjectTag)); // Remove the heap tag.
1469
1500
// -- lr : return address
1470
1501
// -----------------------------------
1472
// This accepts as a receiver anything JSObject::SetElementsLength accepts
1473
// (currently anything except for external and pixel arrays which means
1474
// anything with elements of FixedArray type.), but currently is restricted
1476
// Value must be a number, but only smis are accepted as the most common case.
1503
// This accepts as a receiver anything JSArray::SetElementsLength accepts
1504
// (currently anything except for external arrays which means anything with
1505
// elements of FixedArray type). Value must be a number, but only smis are
1506
// accepted as the most common case.
1495
1525
__ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE);
1496
1526
__ b(ne, &miss);
1528
// Check that the array has fast properties, otherwise the length
1529
// property might have been redefined.
1530
__ ldr(scratch, FieldMemOperand(receiver, JSArray::kPropertiesOffset));
1531
__ ldr(scratch, FieldMemOperand(scratch, FixedArray::kMapOffset));
1532
__ CompareRoot(scratch, Heap::kHashTableMapRootIndex);
1498
1535
// Check that value is a smi.
1499
1536
__ JumpIfNotSmi(value, &miss);
1587
1624
rewritten = stub.GetCode();
1589
1626
ICCompareStub stub(op_, state);
1627
if (state == KNOWN_OBJECTS) {
1628
stub.set_known_map(Handle<Map>(Handle<JSObject>::cast(x)->map()));
1590
1630
rewritten = stub.GetCode();
1592
1632
set_target(*rewritten);