Index: src/heap/objects-visiting-inl.h |
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h |
index d9a584192e47765d2da38ace66f4a733e523a7a8..ddfae0e59587eb134989078cb89ed96ba57174f3 100644 |
--- a/src/heap/objects-visiting-inl.h |
+++ b/src/heap/objects-visiting-inl.h |
@@ -386,6 +386,9 @@ void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( |
template <typename StaticVisitor> |
void StaticMarkingVisitor<StaticVisitor>::VisitWeakCollection( |
Map* map, HeapObject* object) { |
+ typedef FlexibleBodyVisitor<StaticVisitor, |
+ JSWeakCollection::BodyDescriptorWeak, |
+ void> JSWeakCollectionBodyVisitor; |
Heap* heap = map->GetHeap(); |
JSWeakCollection* weak_collection = |
reinterpret_cast<JSWeakCollection*>(object); |
@@ -398,14 +401,7 @@ void StaticMarkingVisitor<StaticVisitor>::VisitWeakCollection( |
// Skip visiting the backing hash table containing the mappings and the |
// pointer to the other enqueued weak collections, both are post-processed. |
- StaticVisitor::VisitPointers( |
- heap, object, |
- HeapObject::RawField(object, JSWeakCollection::kPropertiesOffset), |
- HeapObject::RawField(object, JSWeakCollection::kTableOffset)); |
- STATIC_ASSERT(JSWeakCollection::kTableOffset + kPointerSize == |
- JSWeakCollection::kNextOffset); |
- STATIC_ASSERT(JSWeakCollection::kNextOffset + kPointerSize == |
- JSWeakCollection::kSize); |
+ JSWeakCollectionBodyVisitor::Visit(map, object); |
// Partially initialized weak collection is enqueued, but table is ignored. |
if (!weak_collection->table()->IsHashTable()) return; |
@@ -521,9 +517,7 @@ void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(Map* map, |
template <typename StaticVisitor> |
void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp(Map* map, |
HeapObject* object) { |
- typedef FlexibleBodyVisitor<StaticVisitor, JSRegExp::BodyDescriptor, void> |
- JSRegExpBodyVisitor; |
- JSRegExpBodyVisitor::Visit(map, object); |
+ JSObjectVisitor::Visit(map, object); |
} |