| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index 44a6dde00e470c45acb2b214648a0998c662a28e..fb955913af603919b0fddbf34af464e8e9d78534 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -4015,6 +4015,7 @@ void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) {
|
| HObjectAccess access =
|
| HObjectAccess::ForMapAndOffset(isolate()->factory()->free_space_map(),
|
| FreeSpace::kSizeOffset,
|
| + HObjectAccess::FOR_FIELD,
|
| Representation::Smi());
|
| HStoreNamedField* store_size = HStoreNamedField::New(zone, context(),
|
| free_space_instr, access, filler_size);
|
| @@ -4609,48 +4610,50 @@ HObjectAccess HObjectAccess::ForFixedArrayHeader(int offset) {
|
| ASSERT(offset >= 0);
|
| ASSERT(offset < FixedArray::kHeaderSize);
|
| if (offset == FixedArray::kLengthOffset) return ForFixedArrayLength();
|
| - return HObjectAccess(kInobject, offset);
|
| + return HObjectAccess(kInobject, offset, FOR_FIXED_ARRAY_HEADER);
|
| }
|
|
|
|
|
| HObjectAccess HObjectAccess::ForMapAndOffset(Handle<Map> map, int offset,
|
| - Representation representation) {
|
| + Purpose purpose, Representation representation) {
|
| ASSERT(offset >= 0);
|
| Portion portion = kInobject;
|
|
|
| - if (offset == JSObject::kElementsOffset) {
|
| + if (offset == JSObject::kElementsOffset &&
|
| + !map.is_null() && map->IsJSObjectMap()) {
|
| portion = kElementsPointer;
|
| + purpose = FOR_ELEMENTS_POINTER;
|
| } else if (offset == JSObject::kMapOffset) {
|
| portion = kMaps;
|
| + purpose = FOR_MAP;
|
| }
|
| bool existing_inobject_property = true;
|
| if (!map.is_null()) {
|
| existing_inobject_property = (offset <
|
| map->instance_size() - map->unused_property_fields() * kPointerSize);
|
| }
|
| - return HObjectAccess(portion, offset, representation, Handle<String>::null(),
|
| - false, existing_inobject_property);
|
| + return HObjectAccess(portion, offset, purpose, representation,
|
| + Handle<String>::null(), false,
|
| + existing_inobject_property);
|
| }
|
|
|
|
|
| HObjectAccess HObjectAccess::ForAllocationSiteOffset(int offset) {
|
| switch (offset) {
|
| - case AllocationSite::kTransitionInfoOffset:
|
| - return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| + case AllocationSite::kDependentCodeOffset:
|
| case AllocationSite::kNestedSiteOffset:
|
| - return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| + case AllocationSite::kTransitionInfoOffset:
|
| + case AllocationSite::kWeakNextOffset:
|
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET,
|
| + Representation::Tagged());
|
| case AllocationSite::kPretenureDataOffset:
|
| - return HObjectAccess(kInobject, offset, Representation::Smi());
|
| case AllocationSite::kPretenureCreateCountOffset:
|
| - return HObjectAccess(kInobject, offset, Representation::Smi());
|
| - case AllocationSite::kDependentCodeOffset:
|
| - return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| - case AllocationSite::kWeakNextOffset:
|
| - return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET,
|
| + Representation::Smi());
|
| default:
|
| UNREACHABLE();
|
| }
|
| - return HObjectAccess(kInobject, offset);
|
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET);
|
| }
|
|
|
|
|
| @@ -4659,30 +4662,35 @@ HObjectAccess HObjectAccess::ForContextSlot(int index) {
|
| Portion portion = kInobject;
|
| int offset = Context::kHeaderSize + index * kPointerSize;
|
| ASSERT_EQ(offset, Context::SlotOffset(index) + kHeapObjectTag);
|
| - return HObjectAccess(portion, offset, Representation::Tagged());
|
| + return HObjectAccess(portion, offset, FOR_CONTEXT_SLOT,
|
| + Representation::Tagged());
|
| }
|
|
|
|
|
| HObjectAccess HObjectAccess::ForJSArrayOffset(int offset) {
|
| ASSERT(offset >= 0);
|
| Portion portion = kInobject;
|
| + Purpose purpose = FOR_JSARRAY_OFFSET;
|
|
|
| if (offset == JSObject::kElementsOffset) {
|
| portion = kElementsPointer;
|
| + purpose = FOR_ELEMENTS_POINTER;
|
| } else if (offset == JSArray::kLengthOffset) {
|
| portion = kArrayLengths;
|
| + purpose = FOR_ARRAY_LENGTH;
|
| } else if (offset == JSObject::kMapOffset) {
|
| portion = kMaps;
|
| + purpose = FOR_MAP;
|
| }
|
| - return HObjectAccess(portion, offset);
|
| + return HObjectAccess(portion, offset, purpose);
|
| }
|
|
|
|
|
| HObjectAccess HObjectAccess::ForBackingStoreOffset(int offset,
|
| Representation representation) {
|
| ASSERT(offset >= 0);
|
| - return HObjectAccess(kBackingStore, offset, representation,
|
| - Handle<String>::null(), false, false);
|
| + return HObjectAccess(kBackingStore, offset, FOR_BACKING_STORE_OFFSET,
|
| + representation, Handle<String>::null(), false, false);
|
| }
|
|
|
|
|
| @@ -4708,19 +4716,20 @@ HObjectAccess HObjectAccess::ForField(Handle<Map> map,
|
| // Negative property indices are in-object properties, indexed
|
| // from the end of the fixed part of the object.
|
| int offset = (index * kPointerSize) + map->instance_size();
|
| - return HObjectAccess(kInobject, offset, representation, name, false, true);
|
| + return HObjectAccess(kInobject, offset, FOR_FIELD, representation, name,
|
| + false, true);
|
| } else {
|
| // Non-negative property indices are in the properties array.
|
| int offset = (index * kPointerSize) + FixedArray::kHeaderSize;
|
| - return HObjectAccess(kBackingStore, offset, representation, name,
|
| - false, false);
|
| + return HObjectAccess(kBackingStore, offset, FOR_BACKING_STORE_OFFSET,
|
| + representation, name, false, false);
|
| }
|
| }
|
|
|
|
|
| HObjectAccess HObjectAccess::ForCellPayload(Isolate* isolate) {
|
| return HObjectAccess(
|
| - kInobject, Cell::kValueOffset, Representation::Tagged(),
|
| + kInobject, Cell::kValueOffset, FOR_CELL_PAYLOAD, Representation::Tagged(),
|
| Handle<String>(isolate->heap()->cell_value_string()));
|
| }
|
|
|
|
|