Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: src/heap/objects-visiting-inl.h

Issue 2389183002: [heap] Simplify marking of JSFunction and SFI (Closed)
Patch Set: Re-add comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting-inl.h
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h
index b8c255e1f399e5e3889d3026ab53fa83a66ffa90..252b2fe5e2fb7b898bc6e21f86981465764b9930 100644
--- a/src/heap/objects-visiting-inl.h
+++ b/src/heap/objects-visiting-inl.h
@@ -449,11 +449,11 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
// optimized code.
collector->code_flusher()->AddCandidate(shared);
// Treat the reference to the code object weakly.
- VisitSharedFunctionInfoWeakCode(heap, object);
+ VisitSharedFunctionInfoWeakCode(map, object);
return;
}
}
- VisitSharedFunctionInfoStrongCode(heap, object);
+ VisitSharedFunctionInfoStrongCode(map, object);
}
@@ -621,39 +621,23 @@ bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(
return true;
}
-
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoStrongCode(
- 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);
+ Map* map, HeapObject* object) {
+ FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptor,
+ void>::Visit(map, object);
}
-
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoWeakCode(
- Heap* heap, HeapObject* object) {
- Object** name_slot =
- HeapObject::RawField(object, SharedFunctionInfo::kNameOffset);
- StaticVisitor::VisitPointer(heap, object, name_slot);
-
+ Map* map, HeapObject* object) {
// Skip visiting kCodeOffset as it is treated weakly here.
- 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);
+ STATIC_ASSERT(SharedFunctionInfo::kCodeOffset <
+ SharedFunctionInfo::BodyDescriptorWeakCode::kStartOffset);
+ FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptorWeakCode,
+ void>::Visit(map, object);
}
-
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitJSFunctionStrongCode(
Map* map, HeapObject* object) {
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698