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

Unified Diff: src/mark-compact.cc

Issue 301553003: Make incremental marker post-process JSWeakCollection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Hide some visitor functions. Created 6 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 | « src/incremental-marking.cc ('k') | src/objects-visiting.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 6b3b3db8d47f93e180d091fe51a17dc27b918e91..7e7a3439d286d7f02f1c05a544930833c60f78e3 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1472,44 +1472,6 @@ class MarkCompactMarkingVisitor
return true;
}
- static void VisitWeakCollection(Map* map, HeapObject* object) {
- MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector();
- JSWeakCollection* weak_collection =
- reinterpret_cast<JSWeakCollection*>(object);
-
- // Enqueue weak map in linked list of encountered weak maps.
- if (weak_collection->next() == Smi::FromInt(0)) {
- weak_collection->set_next(collector->encountered_weak_collections());
- collector->set_encountered_weak_collections(weak_collection);
- }
-
- // Skip visiting the backing hash table containing the mappings.
- int object_size = JSWeakCollection::BodyDescriptor::SizeOf(map, object);
- BodyVisitorBase<MarkCompactMarkingVisitor>::IteratePointers(
- map->GetHeap(),
- object,
- JSWeakCollection::BodyDescriptor::kStartOffset,
- JSWeakCollection::kTableOffset);
- BodyVisitorBase<MarkCompactMarkingVisitor>::IteratePointers(
- map->GetHeap(),
- object,
- JSWeakCollection::kTableOffset + kPointerSize,
- object_size);
-
- // Mark the backing hash table without pushing it on the marking stack.
- Object* table_object = weak_collection->table();
- if (!table_object->IsHashTable()) return;
- WeakHashTable* table = WeakHashTable::cast(table_object);
- Object** table_slot =
- HeapObject::RawField(weak_collection, JSWeakCollection::kTableOffset);
- MarkBit table_mark = Marking::MarkBitFrom(table);
- collector->RecordSlot(table_slot, table_slot, table);
- if (!table_mark.Get()) collector->SetMark(table, table_mark);
- // Recording the map slot can be skipped, because maps are not compacted.
- collector->MarkObject(table->map(), Marking::MarkBitFrom(table->map()));
- ASSERT(MarkCompactCollector::IsMarked(table->map()));
- }
-
private:
template<int id>
static inline void TrackObjectStatsAndVisit(Map* map, HeapObject* obj);
@@ -2816,7 +2778,7 @@ void MarkCompactCollector::ClearWeakCollections() {
}
}
weak_collection_obj = weak_collection->next();
- weak_collection->set_next(Smi::FromInt(0));
+ weak_collection->set_next(heap()->undefined_value());
}
set_encountered_weak_collections(Smi::FromInt(0));
}
« no previous file with comments | « src/incremental-marking.cc ('k') | src/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698