Commit 3dffe2e3 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] MC: Switch to instance-based visitor

Bug: 
Change-Id: Ie365e73656f9807043e801b4fb74d75c64259838
Reviewed-on: https://chromium-review.googlesource.com/552552
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46325}
parent 8b97f512
This diff is collapsed.
This diff is collapsed.
......@@ -11,7 +11,6 @@
namespace v8 {
namespace internal {
// We don't record weak slots during marking or scavenges. Instead we do it
// once when we complete mark-compact cycle. Note that write barrier has no
// effect if we are already in the middle of compacting mark-sweep cycle and we
......
......@@ -335,6 +335,43 @@ class NewSpaceVisitor : public HeapVisitor<int, ConcreteVisitor> {
}
};
template <typename ConcreteVisitor>
class MarkingVisitor : public HeapVisitor<int, ConcreteVisitor> {
public:
explicit MarkingVisitor(Heap* heap, MarkCompactCollector* collector)
: heap_(heap), collector_(collector) {}
V8_INLINE bool ShouldVisitMapPointer() { return false; }
V8_INLINE int VisitJSFunction(Map* map, JSFunction* object);
V8_INLINE int VisitWeakCell(Map* map, WeakCell* object);
V8_INLINE int VisitTransitionArray(Map* map, TransitionArray* object);
V8_INLINE int VisitNativeContext(Map* map, Context* object);
V8_INLINE int VisitJSWeakCollection(Map* map, JSWeakCollection* object);
V8_INLINE int VisitSharedFunctionInfo(Map* map, SharedFunctionInfo* object);
V8_INLINE int VisitBytecodeArray(Map* map, BytecodeArray* object);
V8_INLINE int VisitCode(Map* map, Code* object);
V8_INLINE int VisitMap(Map* map, Map* object);
V8_INLINE int VisitJSApiObject(Map* map, JSObject* object);
V8_INLINE int VisitAllocationSite(Map* map, AllocationSite* object);
// ObjectVisitor implementation.
V8_INLINE void VisitCodeEntry(JSFunction* host, Address entry_address) final;
V8_INLINE void VisitEmbeddedPointer(Code* host, RelocInfo* rinfo) final;
V8_INLINE void VisitCellPointer(Code* host, RelocInfo* rinfo) final;
V8_INLINE void VisitDebugTarget(Code* host, RelocInfo* rinfo) final;
V8_INLINE void VisitCodeTarget(Code* host, RelocInfo* rinfo) final;
V8_INLINE void VisitCodeAgeSequence(Code* host, RelocInfo* rinfo) final;
// Skip weak next code link.
V8_INLINE void VisitNextCodeLink(Code* host, Object** p) final {}
protected:
V8_INLINE void MarkMapContents(Map* map);
Heap* heap_;
MarkCompactCollector* collector_;
};
class WeakObjectRetainer;
// A weak list is single linked list where each element has a weak pointer to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment