Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index fc42fc7ecc43c263aef2dd187b5ef21dae588f73..038a4093e146aa95bc5665c44848714334db37ec 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -631,7 +631,7 @@ Object* JSObject::GetNormalizedProperty(LookupResult* result) { |
if (IsGlobalObject()) { |
value = JSGlobalPropertyCell::cast(value)->value(); |
} |
- ASSERT(!value->IsJSGlobalPropertyCell()); |
+ ASSERT(!value->IsJSGlobalPropertyCell() && !value->IsCell()); |
return value; |
} |
@@ -639,9 +639,8 @@ Object* JSObject::GetNormalizedProperty(LookupResult* result) { |
Object* JSObject::SetNormalizedProperty(LookupResult* result, Object* value) { |
ASSERT(!HasFastProperties()); |
if (IsGlobalObject()) { |
- JSGlobalPropertyCell* cell = |
- JSGlobalPropertyCell::cast( |
- property_dictionary()->ValueAt(result->GetDictionaryEntry())); |
+ JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( |
+ property_dictionary()->ValueAt(result->GetDictionaryEntry())); |
cell->set_value(value); |
} else { |
property_dictionary()->ValueAtPut(result->GetDictionaryEntry(), value); |
@@ -1567,8 +1566,12 @@ void HeapObject::HeapObjectShortPrint(StringStream* accumulator) { |
case FOREIGN_TYPE: |
accumulator->Add("<Foreign>"); |
break; |
- case JS_GLOBAL_PROPERTY_CELL_TYPE: |
+ case CELL_TYPE: |
accumulator->Add("Cell for "); |
+ Cell::cast(this)->value()->ShortPrint(accumulator); |
+ break; |
+ case PROPERTY_CELL_TYPE: |
+ accumulator->Add("PropertyCell for "); |
JSGlobalPropertyCell::cast(this)->value()->ShortPrint(accumulator); |
break; |
default: |
@@ -1661,7 +1664,10 @@ void HeapObject::IterateBody(InstanceType type, int object_size, |
case CODE_TYPE: |
reinterpret_cast<Code*>(this)->CodeIterateBody(v); |
break; |
- case JS_GLOBAL_PROPERTY_CELL_TYPE: |
+ case CELL_TYPE: |
+ Cell::BodyDescriptor::IterateBody(this, v); |
+ break; |
+ case PROPERTY_CELL_TYPE: |
JSGlobalPropertyCell::BodyDescriptor::IterateBody(this, v); |
break; |
case SYMBOL_TYPE: |
@@ -8905,8 +8911,8 @@ AllocationSiteInfo* AllocationSiteInfo::FindForJSObject(JSObject* object) { |
bool AllocationSiteInfo::GetElementsKindPayload(ElementsKind* kind) { |
ASSERT(kind != NULL); |
- if (payload()->IsJSGlobalPropertyCell()) { |
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(payload()); |
+ if (payload()->IsCell()) { |
+ Cell* cell = Cell::cast(payload()); |
Object* cell_contents = cell->value(); |
if (cell_contents->IsSmi()) { |
*kind = static_cast<ElementsKind>( |
@@ -9980,13 +9986,13 @@ void ObjectVisitor::VisitCodeEntry(Address entry_address) { |
} |
-void ObjectVisitor::VisitGlobalPropertyCell(RelocInfo* rinfo) { |
- ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); |
+void ObjectVisitor::VisitCell(RelocInfo* rinfo) { |
+ ASSERT(rinfo->rmode() == RelocInfo::CELL); |
Object* cell = rinfo->target_cell(); |
Object* old_cell = cell; |
VisitPointer(&cell); |
if (cell != old_cell) { |
- rinfo->set_target_cell(reinterpret_cast<JSGlobalPropertyCell*>(cell)); |
+ rinfo->set_target_cell(reinterpret_cast<Cell*>(cell)); |
} |
} |
@@ -10048,7 +10054,7 @@ void Code::CopyFrom(const CodeDesc& desc) { |
intptr_t delta = instruction_start() - desc.buffer; |
int mode_mask = RelocInfo::kCodeTargetMask | |
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
- RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | |
+ RelocInfo::ModeMask(RelocInfo::CELL) | |
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | |
RelocInfo::kApplyMask; |
// Needed to find target_object and runtime_entry on X64 |
@@ -10059,8 +10065,8 @@ void Code::CopyFrom(const CodeDesc& desc) { |
if (mode == RelocInfo::EMBEDDED_OBJECT) { |
Handle<Object> p = it.rinfo()->target_object_handle(origin); |
it.rinfo()->set_target_object(*p, SKIP_WRITE_BARRIER); |
- } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { |
- Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); |
+ } else if (mode == RelocInfo::CELL) { |
+ Handle<Cell> cell = it.rinfo()->target_cell_handle(); |
it.rinfo()->set_target_cell(*cell, SKIP_WRITE_BARRIER); |
} else if (RelocInfo::IsCodeTarget(mode)) { |
// rewrite code handles in inline cache targets to direct |
@@ -10246,7 +10252,7 @@ void Code::ClearTypeFeedbackCells(Heap* heap) { |
TypeFeedbackCells* type_feedback_cells = |
TypeFeedbackInfo::cast(raw_info)->type_feedback_cells(); |
for (int i = 0; i < type_feedback_cells->CellCount(); i++) { |
- JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i); |
+ Cell* cell = type_feedback_cells->GetCell(i); |
cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap)); |
} |
} |
@@ -12320,8 +12326,8 @@ MaybeObject* JSObject::UpdateAllocationSiteInfo(ElementsKind to_kind) { |
return payload->TransitionElementsKind(to_kind); |
} |
} |
- } else if (info->payload()->IsJSGlobalPropertyCell()) { |
- JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(info->payload()); |
+ } else if (info->payload()->IsCell()) { |
+ Cell* cell = Cell::cast(info->payload()); |
Object* cell_contents = cell->value(); |
if (cell_contents->IsSmi()) { |
ElementsKind kind = static_cast<ElementsKind>( |
@@ -15794,4 +15800,15 @@ void JSTypedArray::Neuter() { |
set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
} |
+ |
+Type* JSGlobalPropertyCell::type() { |
+ return static_cast<Type*>(type_raw()); |
+} |
+ |
+ |
+void JSGlobalPropertyCell::set_type(Type* type, WriteBarrierMode ignored) { |
+ set_type_raw(type, ignored); |
+} |
+ |
+ |
} } // namespace v8::internal |