Chromium Code Reviews| Index: src/hydrogen-instructions.cc |
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
| index 44a6dde00e470c45acb2b214648a0998c662a28e..e104e6b56d0afeda1982dc1b7ccbccce290e945c 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,58 @@ 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->has_elements()) { |
| 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: |
|
Igor Sheludko
2014/06/05 09:04:30
While we are here, does it make sense to merge com
Jakob Kummerow
2014/06/05 14:33:31
Done.
|
| - return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET, |
| + Representation::Tagged()); |
| case AllocationSite::kNestedSiteOffset: |
| - return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET, |
| + Representation::Tagged()); |
| case AllocationSite::kPretenureDataOffset: |
| - return HObjectAccess(kInobject, offset, Representation::Smi()); |
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET, |
| + Representation::Smi()); |
| case AllocationSite::kPretenureCreateCountOffset: |
| - return HObjectAccess(kInobject, offset, Representation::Smi()); |
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET, |
| + Representation::Smi()); |
| case AllocationSite::kDependentCodeOffset: |
| - return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET, |
| + Representation::Tagged()); |
| case AllocationSite::kWeakNextOffset: |
| - return HObjectAccess(kInobject, offset, Representation::Tagged()); |
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET, |
| + Representation::Tagged()); |
| default: |
| UNREACHABLE(); |
| } |
| - return HObjectAccess(kInobject, offset); |
| + return HObjectAccess(kInobject, offset, FOR_ALLOCATION_SITE_OFFSET); |
| } |
| @@ -4659,30 +4670,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 +4724,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())); |
| } |