Index: src/heap/objects-visiting-inl.h |
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h |
index d1d52a4c7a7b0c548838d566fb2195364a4ceb7a..3ef51866b6341715e424292e44a6c68a06356cc8 100644 |
--- a/src/heap/objects-visiting-inl.h |
+++ b/src/heap/objects-visiting-inl.h |
@@ -136,6 +136,8 @@ |
table_.Register(kVisitFixedTypedArray, &DataObjectVisitor::Visit); |
table_.Register(kVisitFixedFloat64Array, &DataObjectVisitor::Visit); |
+ |
+ table_.Register(kVisitConstantPoolArray, &VisitConstantPoolArray); |
table_.Register(kVisitNativeContext, &VisitNativeContext); |
@@ -446,6 +448,34 @@ |
template <typename StaticVisitor> |
+void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( |
+ Map* map, HeapObject* object) { |
+ Heap* heap = map->GetHeap(); |
+ ConstantPoolArray* array = ConstantPoolArray::cast(object); |
+ ConstantPoolArray::Iterator code_iter(array, ConstantPoolArray::CODE_PTR); |
+ while (!code_iter.is_finished()) { |
+ Address code_entry = reinterpret_cast<Address>( |
+ array->RawFieldOfElementAt(code_iter.next_index())); |
+ StaticVisitor::VisitCodeEntry(heap, code_entry); |
+ } |
+ |
+ ConstantPoolArray::Iterator heap_iter(array, ConstantPoolArray::HEAP_PTR); |
+ while (!heap_iter.is_finished()) { |
+ Object** slot = array->RawFieldOfElementAt(heap_iter.next_index()); |
+ HeapObject* object = HeapObject::cast(*slot); |
+ heap->mark_compact_collector()->RecordSlot(slot, slot, object); |
+ bool is_weak_object = |
+ (array->get_weak_object_state() == |
+ ConstantPoolArray::WEAK_OBJECTS_IN_OPTIMIZED_CODE && |
+ Code::IsWeakObjectInOptimizedCode(object)); |
+ if (!is_weak_object) { |
+ StaticVisitor::MarkObject(heap, object); |
+ } |
+ } |
+} |
+ |
+ |
+template <typename StaticVisitor> |
void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(Map* map, |
HeapObject* object) { |
Heap* heap = map->GetHeap(); |
@@ -796,6 +826,7 @@ |
IteratePointer(v, kDeoptimizationDataOffset); |
IteratePointer(v, kTypeFeedbackInfoOffset); |
IterateNextCodeLink(v, kNextCodeLinkOffset); |
+ IteratePointer(v, kConstantPoolOffset); |
RelocIterator it(this, mode_mask); |
Isolate* isolate = this->GetIsolate(); |
@@ -832,6 +863,8 @@ |
reinterpret_cast<Object**>(this->address() + kTypeFeedbackInfoOffset)); |
StaticVisitor::VisitNextCodeLink( |
heap, reinterpret_cast<Object**>(this->address() + kNextCodeLinkOffset)); |
+ StaticVisitor::VisitPointer( |
+ heap, reinterpret_cast<Object**>(this->address() + kConstantPoolOffset)); |
RelocIterator it(this, mode_mask); |