Index: src/objects-visiting-inl.h |
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h |
index 010f3068a9e3ce1b7e493cb513e3c8df9fef3562..d4a5685d5a147ba833eb01e122ed724830d1716b 100644 |
--- a/src/objects-visiting-inl.h |
+++ b/src/objects-visiting-inl.h |
@@ -489,16 +489,16 @@ void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray( |
Map* map, HeapObject* object) { |
Heap* heap = map->GetHeap(); |
ConstantPoolArray* constant_pool = ConstantPoolArray::cast(object); |
- if (constant_pool->count_of_ptr_entries() > 0) { |
- int first_ptr_offset = constant_pool->OffsetOfElementAt( |
- constant_pool->first_ptr_index()); |
- int last_ptr_offset = constant_pool->OffsetOfElementAt( |
- constant_pool->first_ptr_index() + |
- constant_pool->count_of_ptr_entries() - 1); |
- StaticVisitor::VisitPointers( |
- heap, |
- HeapObject::RawField(object, first_ptr_offset), |
- HeapObject::RawField(object, last_ptr_offset)); |
+ for (int i = 0; i < constant_pool->count_of_code_ptr_entries(); i++) { |
+ int index = constant_pool->first_code_ptr_index() + i; |
+ Address code_entry = |
+ reinterpret_cast<Address>(constant_pool->RawFieldOfElementAt(index)); |
+ StaticVisitor::VisitCodeEntry(heap, code_entry); |
+ } |
+ 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)); |
} |
} |