~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to src/arm/ic-arm.cc

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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));
1035
1036
 
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);
 
1044
 
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.
 
1047
 
 
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));
 
1052
    __ cmp(r2, r5);
 
1053
    __ b(ne, &try_next_entry);
 
1054
    __ ldr(r5, MemOperand(r4, -kPointerSize));  // Load symbol
 
1055
    __ cmp(r0, r5);
 
1056
    __ b(eq, &hit_on_nth_entry[i]);
 
1057
    __ bind(&try_next_entry);
 
1058
  }
 
1059
 
 
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);
 
1075
 
 
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));
 
1080
    if (i != 0) {
 
1081
      __ add(r3, r3, Operand(i));
 
1082
    }
 
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);
 
1087
    if (i != 0) {
 
1088
      __ jmp(&load_in_object_property);
 
1089
    }
 
1090
  }
1061
1091
 
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
  // -----------------------------------
1471
1502
  //
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
1475
 
  // to JSArray.
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.
1477
1507
 
1478
1508
  Label miss;
1479
1509
 
1495
1525
  __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE);
1496
1526
  __ b(ne, &miss);
1497
1527
 
 
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);
 
1533
  __ b(eq, &miss);
 
1534
 
1498
1535
  // Check that value is a smi.
1499
1536
  __ JumpIfNotSmi(value, &miss);
1500
1537
 
1587
1624
    rewritten = stub.GetCode();
1588
1625
  } else {
1589
1626
    ICCompareStub stub(op_, state);
 
1627
    if (state == KNOWN_OBJECTS) {
 
1628
      stub.set_known_map(Handle<Map>(Handle<JSObject>::cast(x)->map()));
 
1629
    }
1590
1630
    rewritten = stub.GetCode();
1591
1631
  }
1592
1632
  set_target(*rewritten);