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

Unified Diff: src/mark-compact.cc

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
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index d1be73561e7a00259446f2f0bceb7c68a667e672..16a3f4c7eab0514e99c959c482b33db744a15b07 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1867,25 +1867,39 @@ void Marker<T>::MarkDescriptorArray(DescriptorArray* descriptors) {
// Empty descriptor array is marked as a root before any maps are marked.
ASSERT(descriptors != descriptors->GetHeap()->empty_descriptor_array());
- // The DescriptorArray contains a pointer to its contents array, but the
- // contents array will be marked black and hence not be visited again.
- if (!base_marker()->MarkObjectAndPush(descriptors)) return;
- FixedArray* contents = FixedArray::cast(
- descriptors->get(DescriptorArray::kContentArrayIndex));
- ASSERT(Marking::IsWhite(Marking::MarkBitFrom(contents)));
- base_marker()->MarkObjectWithoutPush(contents);
+ if (!base_marker()->MarkObjectWithoutPush(descriptors)) return;
+ Object** descriptor_start = descriptors->data_start();
+
+ if (descriptors->HasEnumCache()) {
Michael Starzinger 2012/06/01 14:03:15 It's important that we don't forget to mark every
Toon Verwaest 2012/06/04 07:30:45 Done.
+ Object** enum_cache_slot = descriptors->GetEnumCacheSlot();
+ Object* enum_cache = *enum_cache_slot;
+ base_marker()->MarkObjectAndPush(
+ reinterpret_cast<HeapObject*>(enum_cache));
+ mark_compact_collector()->RecordSlot(descriptor_start,
+ enum_cache_slot,
+ enum_cache);
+ }
// If the descriptor contains a transition (value is a Map), we don't mark the
// value as live. It might be set to the NULL_DESCRIPTOR in
// ClearNonLiveTransitions later.
for (int i = 0; i < descriptors->number_of_descriptors(); ++i) {
- PropertyDetails details(descriptors->GetDetails(i));
- Object** slot = descriptors->GetValueSlot(i);
+ Object** key_slot = descriptors->GetKeySlot(i);
+ Object* key = *key_slot;
+ if (key->IsHeapObject()) {
+ base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(key));
+ mark_compact_collector()->RecordSlot(descriptor_start, key_slot, key);
+ }
+
+ Object** value_slot = descriptors->GetValueSlot(i);
+ if (!(*value_slot)->IsHeapObject()) continue;
+ HeapObject* value = HeapObject::cast(*value_slot);
- if (!(*slot)->IsHeapObject()) continue;
- HeapObject* value = HeapObject::cast(*slot);
+ mark_compact_collector()->RecordSlot(descriptor_start,
+ value_slot,
+ *value_slot);
Michael Starzinger 2012/06/01 14:03:15 Just pass "value" as the third parameter here.
Toon Verwaest 2012/06/04 07:30:45 Done.
- mark_compact_collector()->RecordSlot(slot, slot, *slot);
+ PropertyDetails details(descriptors->GetDetails(i));
switch (details.type()) {
case NORMAL:
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698