Index: src/objects-visiting-inl.h |
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h |
index bea201a6f334b68df21969d1089c23625030a6dd..f46adcc78d3dccd822c15dd48f7b493e663a97ab 100644 |
--- a/src/objects-visiting-inl.h |
+++ b/src/objects-visiting-inl.h |
@@ -498,8 +498,14 @@ void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( |
} |
for (int i = 0; i < constant_pool->count_of_heap_ptr_entries(); i++) { |
int index = constant_pool->first_heap_ptr_index() + i; |
- StaticVisitor::VisitPointer(heap, |
- constant_pool->RawFieldOfElementAt(index)); |
+ Object** slot = constant_pool->RawFieldOfElementAt(index); |
+ HeapObject* object = HeapObject::cast(*slot); |
+ heap->mark_compact_collector()->RecordSlot(slot, slot, object); |
+ if (!(constant_pool->get_weak_object_state() == |
+ ConstantPoolArray::WEAK_OBJECTS_IN_OPTIMIZED_CODE && |
+ Code::IsWeakObjectInOptimizedCode(object))) { |
+ StaticVisitor::MarkObject(heap, object); |
+ } |
} |
} |