Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: src/objects.cc

Issue 16631002: Separate Cell and PropertyCell spaces (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge with ToT Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index fc42fc7ecc43c263aef2dd187b5ef21dae588f73..835fd424ed64afe1472d79899648b76855207e4e 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 JS_GLOBAL_PROPERTY_CELL_TYPE:
+ accumulator->Add("JsGlobalPropertyCell for ");
Michael Starzinger 2013/06/12 13:23:25 nit: Let's at least drop the "Js" prefix in this p
danno 2013/06/12 14:24:28 Done.
JSGlobalPropertyCell::cast(this)->value()->ShortPrint(accumulator);
break;
default:
@@ -1661,6 +1664,9 @@ void HeapObject::IterateBody(InstanceType type, int object_size,
case CODE_TYPE:
reinterpret_cast<Code*>(this)->CodeIterateBody(v);
break;
+ case CELL_TYPE:
+ Cell::BodyDescriptor::IterateBody(this, v);
+ break;
case JS_GLOBAL_PROPERTY_CELL_TYPE:
JSGlobalPropertyCell::BodyDescriptor::IterateBody(this, v);
break;
@@ -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>(
@@ -9986,7 +9992,7 @@ void ObjectVisitor::VisitGlobalPropertyCell(RelocInfo* rinfo) {
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));
}
}
@@ -10060,7 +10066,7 @@ void Code::CopyFrom(const CodeDesc& desc) {
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();
+ 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

Powered by Google App Engine
This is Rietveld 408576698