< prev index next >
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
Print this page
rev 7515 : imported patch 8066566
rev 7517 : const * instead of &
@@ -306,11 +306,11 @@
~ParScanThreadStateSet() { TASKQUEUE_STATS_ONLY(reset_stats()); }
inline ParScanThreadState& thread_state(int i);
- void trace_promotion_failed(YoungGCTracer& gc_tracer);
+ void trace_promotion_failed(const YoungGCTracer* gc_tracer);
void reset(int active_workers, bool promotion_failed);
void flush();
#if TASKQUEUE_STATS
static void
@@ -355,14 +355,14 @@
{
assert(i >= 0 && i < length(), "sanity check!");
return ((ParScanThreadState*)_data)[i];
}
-void ParScanThreadStateSet::trace_promotion_failed(YoungGCTracer& gc_tracer) {
+void ParScanThreadStateSet::trace_promotion_failed(const YoungGCTracer* gc_tracer) {
for (int i = 0; i < length(); ++i) {
if (thread_state(i).promotion_failed()) {
- gc_tracer.report_promotion_failed(thread_state(i).promotion_failed_info());
+ gc_tracer->report_promotion_failed(thread_state(i).promotion_failed_info());
thread_state(i).promotion_failed_info().reset();
}
}
}
@@ -881,11 +881,11 @@
}
// A Generation that does parallel young-gen collection.
-void ParNewGeneration::handle_promotion_failed(GenCollectedHeap* gch, ParScanThreadStateSet& thread_state_set, ParNewTracer& gc_tracer) {
+void ParNewGeneration::handle_promotion_failed(GenCollectedHeap* gch, ParScanThreadStateSet& thread_state_set) {
assert(_promo_failure_scan_stack.is_empty(), "post condition");
_promo_failure_scan_stack.clear(true); // Clear cached segments.
remove_forwarding_pointers();
if (PrintGCDetails) {
@@ -897,14 +897,14 @@
gch->set_incremental_collection_failed();
// Inform the next generation that a promotion failure occurred.
_next_gen->promotion_failure_occurred();
// Trace promotion failure in the parallel GC threads
- thread_state_set.trace_promotion_failed(gc_tracer);
+ thread_state_set.trace_promotion_failed(gc_tracer());
// Single threaded code may have reported promotion failure to the global state
if (_promotion_failed_info.has_failed()) {
- gc_tracer.report_promotion_failed(_promotion_failed_info);
+ _gc_tracer.report_promotion_failed(_promotion_failed_info);
}
// Reset the PromotionFailureALot counters.
NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();)
}
@@ -939,22 +939,21 @@
gch->set_incremental_collection_failed(); // slight lie, in that we did not even attempt one
return;
}
assert(to()->is_empty(), "Else not collection_attempt_is_safe");
- ParNewTracer gc_tracer;
- gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
- gch->trace_heap_before_gc(&gc_tracer);
+ _gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
+ gch->trace_heap_before_gc(gc_tracer());
init_assuming_no_promotion_failure();
if (UseAdaptiveSizePolicy) {
set_survivor_overflow(false);
size_policy->minor_collection_begin();
}
- GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL, gc_tracer.gc_id());
+ GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL, _gc_tracer.gc_id());
// Capture heap used before collection (for printing).
size_t gch_prev_used = gch->used();
SpecializationStats::clear();
@@ -992,11 +991,11 @@
thread_state_set.reset(0 /* Bad value in debug if not reset */,
promotion_failed());
// Trace and reset failed promotion info.
if (promotion_failed()) {
- thread_state_set.trace_promotion_failed(gc_tracer);
+ thread_state_set.trace_promotion_failed(gc_tracer());
}
// Process (weak) reference objects found during scavenge.
ReferenceProcessor* rp = ref_processor();
IsAliveClosure is_alive(this);
@@ -1013,20 +1012,20 @@
ReferenceProcessorStats stats;
if (rp->processing_is_mt()) {
ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
stats = rp->process_discovered_references(&is_alive, &keep_alive,
&evacuate_followers, &task_executor,
- _gc_timer, gc_tracer.gc_id());
+ _gc_timer, _gc_tracer.gc_id());
} else {
thread_state_set.flush();
gch->set_par_threads(0); // 0 ==> non-parallel.
gch->save_marks();
stats = rp->process_discovered_references(&is_alive, &keep_alive,
&evacuate_followers, NULL,
- _gc_timer, gc_tracer.gc_id());
+ _gc_timer, _gc_tracer.gc_id());
}
- gc_tracer.report_gc_reference_stats(stats);
+ _gc_tracer.report_gc_reference_stats(stats);
if (!promotion_failed()) {
// Swap the survivor spaces.
eden()->clear(SpaceDecorator::Mangle);
from()->clear(SpaceDecorator::Mangle);
if (ZapUnusedHeapArea) {
@@ -1047,11 +1046,11 @@
assert(to()->is_empty(), "to space should be empty now");
adjust_desired_tenuring_threshold();
} else {
- handle_promotion_failed(gch, thread_state_set, gc_tracer);
+ handle_promotion_failed(gch, thread_state_set);
}
// set new iteration safe limit for the survivor spaces
from()->set_concurrent_iteration_safe_limit(from()->top());
to()->set_concurrent_iteration_safe_limit(to()->top());
@@ -1086,16 +1085,16 @@
} else {
rp->enqueue_discovered_references(NULL);
}
rp->verify_no_references_recorded();
- gch->trace_heap_after_gc(&gc_tracer);
- gc_tracer.report_tenuring_threshold(tenuring_threshold());
+ gch->trace_heap_after_gc(gc_tracer());
+ _gc_tracer.report_tenuring_threshold(tenuring_threshold());
_gc_timer->register_gc_end();
- gc_tracer.report_gc_end(_gc_timer->gc_end(), _gc_timer->time_partitions());
+ _gc_tracer.report_gc_end(_gc_timer->gc_end(), _gc_timer->time_partitions());
}
static int sum;
void ParNewGeneration::waste_some_time() {
for (int i = 0; i < 100; i++) {
< prev index next >