< prev index next >
src/share/vm/gc/g1/g1CollectedHeap.cpp
Print this page
rev 13328 : [mq]: webrev.0b
rev 13329 : [mq]: webrev.1
rev 13330 : imported patch webrev.2
rev 13331 : imported patch webrev.3b
rev 13332 : [mq]: webrev.4
@@ -1258,11 +1258,11 @@
}
assert(num_free_regions() == 0, "we should not have added any free regions");
rebuild_region_sets(false /* free_list_only */);
- ReferenceProcessorPhaseTimes pt(NULL, ref_processor_stw()->num_q(), ref_processor_stw()->processing_is_mt());
+ ReferenceProcessorPhaseTimes pt(NULL, ref_processor_stw()->num_q());
// Enqueue any discovered reference objects that have
// not been removed from the discovered lists.
ref_processor_stw()->enqueue_discovered_references(NULL, &pt);
@@ -1669,11 +1669,13 @@
// Public methods.
G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* collector_policy) :
CollectedHeap(),
_collector_policy(collector_policy),
- _g1_policy(create_g1_policy()),
+ _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
+ _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()),
+ _g1_policy(create_g1_policy(_gc_timer_stw)),
_collection_set(this, _g1_policy),
_dirty_card_queue_set(false),
_is_alive_closure_cm(this),
_is_alive_closure_stw(this),
_ref_processor_cm(NULL),
@@ -1696,13 +1698,11 @@
_survivor_evac_stats("Young", YoungPLABSize, PLABWeight),
_old_evac_stats("Old", OldPLABSize, PLABWeight),
_expand_heap_after_alloc_failure(true),
_old_marking_cycles_started(0),
_old_marking_cycles_completed(0),
- _in_cset_fast_test(),
- _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
- _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()) {
+ _in_cset_fast_test() {
_workers = new WorkGang("GC Thread", ParallelGCThreads,
/* are_GC_task_threads */true,
/* are_ConcurrentGC_threads */false);
_workers->initialize_workers();
@@ -2052,13 +2052,10 @@
true,
// Reference discovery is atomic
&_is_alive_closure_stw);
// is alive closure
// (for efficiency/performance)
- _ref_phase_times = new ReferenceProcessorPhaseTimes(_gc_timer_stw,
- ParallelGCThreads,
- mt_processing);
}
CollectorPolicy* G1CollectedHeap::collector_policy() const {
return _collector_policy;
}
@@ -4320,20 +4317,20 @@
G1STWDrainQueueClosure drain_queue(this, pss);
// Setup the soft refs policy...
rp->setup_policy(false);
- ref_phase_times()->reset();
+ ReferenceProcessorPhaseTimes* pt = g1_policy()->phase_times()->ref_phase_times();
ReferenceProcessorStats stats;
if (!rp->processing_is_mt()) {
// Serial reference processing...
stats = rp->process_discovered_references(&is_alive,
&keep_alive,
&drain_queue,
NULL,
- ref_phase_times());
+ pt);
} else {
uint no_of_gc_workers = workers()->active_workers();
// Parallel reference processing
assert(no_of_gc_workers <= rp->max_num_q(),
@@ -4343,11 +4340,11 @@
G1STWRefProcTaskExecutor par_task_executor(this, per_thread_states, workers(), _task_queues, no_of_gc_workers);
stats = rp->process_discovered_references(&is_alive,
&keep_alive,
&drain_queue,
&par_task_executor,
- ref_phase_times());
+ pt);
}
_gc_tracer_stw->report_gc_reference_stats(stats);
// We have completed copying any necessary live referent objects.
@@ -4362,26 +4359,28 @@
double ref_enq_start = os::elapsedTime();
ReferenceProcessor* rp = _ref_processor_stw;
assert(!rp->discovery_enabled(), "should have been disabled as part of processing");
+ ReferenceProcessorPhaseTimes* pt = g1_policy()->phase_times()->ref_phase_times();
+
// Now enqueue any remaining on the discovered lists on to
// the pending list.
if (!rp->processing_is_mt()) {
// Serial reference processing...
- rp->enqueue_discovered_references(NULL, ref_phase_times());
+ rp->enqueue_discovered_references(NULL, pt);
} else {
// Parallel reference enqueueing
uint n_workers = workers()->active_workers();
assert(n_workers <= rp->max_num_q(),
"Mismatch between the number of GC workers %u and the maximum number of Reference process queues %u",
n_workers, rp->max_num_q());
G1STWRefProcTaskExecutor par_task_executor(this, per_thread_states, workers(), _task_queues, n_workers);
- rp->enqueue_discovered_references(&par_task_executor, ref_phase_times());
+ rp->enqueue_discovered_references(&par_task_executor, pt);
}
rp->verify_no_references_recorded();
assert(!rp->discovery_enabled(), "should have been disabled");
< prev index next >