< prev index next >

src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp

Print this page

28 #include "gc/g1/g1FullCollector.hpp"
29 #include "gc/g1/g1FullGCMarker.hpp"
30 #include "gc/g1/g1FullGCMarkTask.hpp"
31 #include "gc/g1/g1FullGCOopClosures.inline.hpp"
32 #include "gc/shared/gcTraceTime.inline.hpp"
33 #include "gc/shared/referenceProcessor.hpp"
34 #include "memory/iterator.inline.hpp"
35 
36 G1FullGCMarkTask::G1FullGCMarkTask(G1FullCollector* collector) :
37     G1FullGCTask("G1 Parallel Marking Task", collector),
38     _root_processor(G1CollectedHeap::heap(), collector->workers()),
39     _terminator(collector->workers(), collector->array_queue_set()) {
40   // Need cleared claim bits for the roots processing
41   ClassLoaderDataGraph::clear_claimed_marks();
42 }
43 
44 void G1FullGCMarkTask::work(uint worker_id) {
45   Ticks start = Ticks::now();
46   ResourceMark rm;
47   G1FullGCMarker* marker = collector()->marker(worker_id);
48   MarkingCodeBlobClosure code_closure(marker->mark_closure(), !CodeBlobToOopClosure::FixRelocations);
49 
50   if (ClassUnloading) {
51     _root_processor.process_strong_roots(marker->mark_closure(),
52                                          marker->cld_closure(),
53                                          &code_closure);
54   } else {
55     _root_processor.process_all_roots(marker->mark_closure(),
56                                       marker->cld_closure(),
57                                       &code_closure);
58   }
59 
60   // Mark stack is populated, now process and drain it.
61   marker->complete_marking(collector()->oop_queue_set(), collector()->array_queue_set(), &_terminator);
62   marker->flush_mark_stats_cache();
63 
64   // This is the point where the entire marking should have completed.
65   assert(marker->oop_stack()->is_empty(), "Marking should have completed");
66   assert(marker->objarray_stack()->is_empty(), "Array marking should have completed");
67   log_task("Marking task", worker_id, start);
68 }

28 #include "gc/g1/g1FullCollector.hpp"
29 #include "gc/g1/g1FullGCMarker.hpp"
30 #include "gc/g1/g1FullGCMarkTask.hpp"
31 #include "gc/g1/g1FullGCOopClosures.inline.hpp"
32 #include "gc/shared/gcTraceTime.inline.hpp"
33 #include "gc/shared/referenceProcessor.hpp"
34 #include "memory/iterator.inline.hpp"
35 
36 G1FullGCMarkTask::G1FullGCMarkTask(G1FullCollector* collector) :
37     G1FullGCTask("G1 Parallel Marking Task", collector),
38     _root_processor(G1CollectedHeap::heap(), collector->workers()),
39     _terminator(collector->workers(), collector->array_queue_set()) {
40   // Need cleared claim bits for the roots processing
41   ClassLoaderDataGraph::clear_claimed_marks();
42 }
43 
44 void G1FullGCMarkTask::work(uint worker_id) {
45   Ticks start = Ticks::now();
46   ResourceMark rm;
47   G1FullGCMarker* marker = collector()->marker(worker_id);
48   MarkingCodeBlobClosure code_closure(marker->mark_closure(), !CodeBlobToOopClosure::FixRelocations, true /* keepalive nmethods */);
49 
50   if (ClassUnloading) {
51     _root_processor.process_strong_roots(marker->mark_closure(),
52                                          marker->cld_closure(),
53                                          &code_closure);
54   } else {
55     _root_processor.process_all_roots(marker->mark_closure(),
56                                       marker->cld_closure(),
57                                       &code_closure);
58   }
59 
60   // Mark stack is populated, now process and drain it.
61   marker->complete_marking(collector()->oop_queue_set(), collector()->array_queue_set(), &_terminator);
62   marker->flush_mark_stats_cache();
63 
64   // This is the point where the entire marking should have completed.
65   assert(marker->oop_stack()->is_empty(), "Marking should have completed");
66   assert(marker->objarray_stack()->is_empty(), "Array marking should have completed");
67   log_task("Marking task", worker_id, start);
68 }
< prev index next >