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

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

Issue 2389963007: Revert of [heap] Simplify marking of JSFunction and SFI (Closed)
Patch Set: 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 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(
« 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