Index: src/heap/objects-visiting-inl.h |
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h |
index 252b2fe5e2fb7b898bc6e21f86981465764b9930..b8c255e1f399e5e3889d3026ab53fa83a66ffa90 100644 |
--- a/src/heap/objects-visiting-inl.h |
+++ b/src/heap/objects-visiting-inl.h |
@@ -449,11 +449,11 @@ |
// optimized code. |
collector->code_flusher()->AddCandidate(shared); |
// Treat the reference to the code object weakly. |
- VisitSharedFunctionInfoWeakCode(map, object); |
+ VisitSharedFunctionInfoWeakCode(heap, object); |
return; |
} |
} |
- VisitSharedFunctionInfoStrongCode(map, object); |
+ VisitSharedFunctionInfoStrongCode(heap, object); |
} |
@@ -621,22 +621,38 @@ |
return true; |
} |
+ |
template <typename StaticVisitor> |
void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoStrongCode( |
- Map* map, HeapObject* object) { |
- FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptor, |
- void>::Visit(map, object); |
-} |
+ Heap* heap, HeapObject* object) { |
+ Object** start_slot = HeapObject::RawField( |
+ object, SharedFunctionInfo::BodyDescriptor::kStartOffset); |
+ Object** end_slot = HeapObject::RawField( |
+ object, SharedFunctionInfo::BodyDescriptor::kEndOffset); |
+ StaticVisitor::VisitPointers(heap, object, start_slot, end_slot); |
+} |
+ |
template <typename StaticVisitor> |
void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoWeakCode( |
- Map* map, HeapObject* object) { |
+ Heap* heap, HeapObject* object) { |
+ Object** name_slot = |
+ HeapObject::RawField(object, SharedFunctionInfo::kNameOffset); |
+ StaticVisitor::VisitPointer(heap, object, name_slot); |
+ |
// Skip visiting kCodeOffset as it is treated weakly here. |
- STATIC_ASSERT(SharedFunctionInfo::kCodeOffset < |
- SharedFunctionInfo::BodyDescriptorWeakCode::kStartOffset); |
- FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptorWeakCode, |
- void>::Visit(map, object); |
-} |
+ STATIC_ASSERT(SharedFunctionInfo::kNameOffset + kPointerSize == |
+ SharedFunctionInfo::kCodeOffset); |
+ STATIC_ASSERT(SharedFunctionInfo::kCodeOffset + kPointerSize == |
+ SharedFunctionInfo::kOptimizedCodeMapOffset); |
+ |
+ Object** start_slot = |
+ HeapObject::RawField(object, SharedFunctionInfo::kOptimizedCodeMapOffset); |
+ Object** end_slot = HeapObject::RawField( |
+ object, SharedFunctionInfo::BodyDescriptor::kEndOffset); |
+ StaticVisitor::VisitPointers(heap, object, start_slot, end_slot); |
+} |
+ |
template <typename StaticVisitor> |
void StaticMarkingVisitor<StaticVisitor>::VisitJSFunctionStrongCode( |