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

Unified Diff: src/objects-inl.h

Issue 10412030: Merging ContentArray into DescriptorArray (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merged patchset Created 8 years, 7 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
« src/mark-compact.cc ('K') | « src/objects-debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 30ed133657506be73917f131c4f3dbe844a75272..0620e0e876ed6cb7754d35f342bfc8ed5117efc9 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1925,6 +1925,14 @@ int DescriptorArray::SearchWithCache(String* name) {
}
+Object** DescriptorArray::GetKeySlot(int descriptor_number) {
+ ASSERT(descriptor_number < number_of_descriptors());
+ return HeapObject::RawField(
+ reinterpret_cast<HeapObject*>(this),
+ OffsetOfElementAt(ToKeyIndex(descriptor_number)));
+}
+
+
String* DescriptorArray::GetKey(int descriptor_number) {
ASSERT(descriptor_number < number_of_descriptors());
return String::cast(get(ToKeyIndex(descriptor_number)));
@@ -1933,32 +1941,34 @@ String* DescriptorArray::GetKey(int descriptor_number) {
Object** DescriptorArray::GetValueSlot(int descriptor_number) {
ASSERT(descriptor_number < number_of_descriptors());
- return GetContentArray()->data_start() + ToValueIndex(descriptor_number);
+ return HeapObject::RawField(
+ reinterpret_cast<HeapObject*>(this),
+ OffsetOfElementAt(ToValueIndex(descriptor_number)));
}
Object* DescriptorArray::GetValue(int descriptor_number) {
ASSERT(descriptor_number < number_of_descriptors());
- return GetContentArray()->get(ToValueIndex(descriptor_number));
+ return get(ToValueIndex(descriptor_number));
}
void DescriptorArray::SetNullValueUnchecked(int descriptor_number, Heap* heap) {
ASSERT(descriptor_number < number_of_descriptors());
- GetContentArray()->set_null_unchecked(heap, ToValueIndex(descriptor_number));
+ set_null_unchecked(heap, ToValueIndex(descriptor_number));
}
PropertyDetails DescriptorArray::GetDetails(int descriptor_number) {
ASSERT(descriptor_number < number_of_descriptors());
- Object* details = GetContentArray()->get(ToDetailsIndex(descriptor_number));
+ Object* details = get(ToDetailsIndex(descriptor_number));
return PropertyDetails(Smi::cast(details));
}
void DescriptorArray::SetDetailsUnchecked(int descriptor_number, Smi* value) {
ASSERT(descriptor_number < number_of_descriptors());
- GetContentArray()->set_unchecked(ToDetailsIndex(descriptor_number), value);
+ set_unchecked(ToDetailsIndex(descriptor_number), value);
}
@@ -2042,11 +2052,10 @@ void DescriptorArray::Set(int descriptor_number,
NoIncrementalWriteBarrierSet(this,
ToKeyIndex(descriptor_number),
desc->GetKey());
- FixedArray* content_array = GetContentArray();
- NoIncrementalWriteBarrierSet(content_array,
+ NoIncrementalWriteBarrierSet(this,
ToValueIndex(descriptor_number),
desc->GetValue());
- NoIncrementalWriteBarrierSet(content_array,
+ NoIncrementalWriteBarrierSet(this,
ToDetailsIndex(descriptor_number),
desc->GetDetails().AsSmi());
}
@@ -2055,11 +2064,10 @@ void DescriptorArray::Set(int descriptor_number,
void DescriptorArray::NoIncrementalWriteBarrierSwapDescriptors(
int first, int second) {
NoIncrementalWriteBarrierSwap(this, ToKeyIndex(first), ToKeyIndex(second));
- FixedArray* content_array = GetContentArray();
- NoIncrementalWriteBarrierSwap(content_array,
+ NoIncrementalWriteBarrierSwap(this,
ToValueIndex(first),
ToValueIndex(second));
- NoIncrementalWriteBarrierSwap(content_array,
+ NoIncrementalWriteBarrierSwap(this,
ToDetailsIndex(first),
ToDetailsIndex(second));
}
@@ -2070,7 +2078,6 @@ DescriptorArray::WhitenessWitness::WhitenessWitness(DescriptorArray* array)
marking_->EnterNoMarkingScope();
if (array->number_of_descriptors() > 0) {
ASSERT(Marking::Color(array) == Marking::WHITE_OBJECT);
- ASSERT(Marking::Color(array->GetContentArray()) == Marking::WHITE_OBJECT);
}
}
« src/mark-compact.cc ('K') | « src/objects-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698