From b632a4be86bf08cbd4bf03691b4e064016e1f2e7 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Mon, 24 Jun 2013 12:39:02 +0000 Subject: [PATCH] Deprecate one virtual marking visitor for mark-compact GC. R=hpayer@google.com Review URL: https://codereview.chromium.org/17546005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15286 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mark-compact.cc | 26 +++----------------------- src/mark-compact.h | 2 +- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/mark-compact.cc b/src/mark-compact.cc index c06bfd7f73..54f1396d2c 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -1713,23 +1713,6 @@ VisitorDispatchTable MarkCompactMarkingVisitor::non_count_table_; -class MarkingVisitor : public ObjectVisitor { - public: - explicit MarkingVisitor(Heap* heap) : heap_(heap) { } - - void VisitPointer(Object** p) { - MarkCompactMarkingVisitor::VisitPointer(heap_, p); - } - - void VisitPointers(Object** start, Object** end) { - MarkCompactMarkingVisitor::VisitPointers(heap_, start, end); - } - - private: - Heap* heap_; -}; - - class CodeMarkingVisitor : public ThreadVisitor { public: explicit CodeMarkingVisitor(MarkCompactCollector* collector) @@ -2038,14 +2021,13 @@ bool MarkCompactCollector::IsUnmarkedHeapObjectWithHeap(Heap* heap, } -void MarkCompactCollector::MarkStringTable() { +void MarkCompactCollector::MarkStringTable(RootMarkingVisitor* visitor) { StringTable* string_table = heap()->string_table(); // Mark the string table itself. MarkBit string_table_mark = Marking::MarkBitFrom(string_table); SetMark(string_table, string_table_mark); // Explicitly mark the prefix. - MarkingVisitor marker(heap()); - string_table->IteratePrefix(&marker); + string_table->IteratePrefix(visitor); ProcessMarkingDeque(); } @@ -2056,7 +2038,7 @@ void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) { heap()->IterateStrongRoots(visitor, VISIT_ONLY_STRONG); // Handle the string table specially. - MarkStringTable(); + MarkStringTable(visitor); // There may be overflowed objects in the heap. Visit them now. while (marking_deque_.overflowed()) { @@ -3291,11 +3273,9 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() { bool code_slots_filtering_required; { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP_NEWSPACE); code_slots_filtering_required = MarkInvalidatedCode(); - EvacuateNewSpace(); } - { GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_EVACUATE_PAGES); EvacuatePages(); } diff --git a/src/mark-compact.h b/src/mark-compact.h index 873534c2fa..85c30083fe 100644 --- a/src/mark-compact.h +++ b/src/mark-compact.h @@ -835,7 +835,7 @@ class MarkCompactCollector { // Mark the string table specially. References to internalized strings from // the string table are weak. - void MarkStringTable(); + void MarkStringTable(RootMarkingVisitor* visitor); // Mark objects in implicit references groups if their parent object // is marked.