< prev index next >
src/share/vm/gc/shared/referenceProcessor.cpp
Print this page
*** 190,212 ****
}
class GCRefTraceTime : public StackObj {
GCTraceTimeImpl _gc_trace_time;
public:
! GCRefTraceTime(const char* title, bool doit, GCTimer* timer, GCId gc_id, size_t count) :
! _gc_trace_time(title, doit, false, timer, gc_id) {
log_ref_count(count, doit);
}
};
ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
BoolObjectClosure* is_alive,
OopClosure* keep_alive,
VoidClosure* complete_gc,
AbstractRefProcTaskExecutor* task_executor,
! GCTimer* gc_timer,
! GCId gc_id) {
assert(!enqueuing_is_done(), "If here enqueuing should not be complete");
// Stop treating discovered references specially.
disable_discovery();
--- 190,211 ----
}
class GCRefTraceTime : public StackObj {
GCTraceTimeImpl _gc_trace_time;
public:
! GCRefTraceTime(const char* title, bool doit, GCTimer* timer, size_t count) :
! _gc_trace_time(title, doit, false, timer) {
log_ref_count(count, doit);
}
};
ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
BoolObjectClosure* is_alive,
OopClosure* keep_alive,
VoidClosure* complete_gc,
AbstractRefProcTaskExecutor* task_executor,
! GCTimer* gc_timer) {
assert(!enqueuing_is_done(), "If here enqueuing should not be complete");
// Stop treating discovered references specially.
disable_discovery();
*** 231,264 ****
total_count(_discoveredFinalRefs),
total_count(_discoveredPhantomRefs) + total_count(_discoveredCleanerRefs));
// Soft references
{
! GCRefTraceTime tt("SoftReference", trace_time, gc_timer, gc_id, stats.soft_count());
process_discovered_reflist(_discoveredSoftRefs, _current_soft_ref_policy, true,
is_alive, keep_alive, complete_gc, task_executor);
}
update_soft_ref_master_clock();
// Weak references
{
! GCRefTraceTime tt("WeakReference", trace_time, gc_timer, gc_id, stats.weak_count());
process_discovered_reflist(_discoveredWeakRefs, NULL, true,
is_alive, keep_alive, complete_gc, task_executor);
}
// Final references
{
! GCRefTraceTime tt("FinalReference", trace_time, gc_timer, gc_id, stats.final_count());
process_discovered_reflist(_discoveredFinalRefs, NULL, false,
is_alive, keep_alive, complete_gc, task_executor);
}
// Phantom references
{
! GCRefTraceTime tt("PhantomReference", trace_time, gc_timer, gc_id, stats.phantom_count());
process_discovered_reflist(_discoveredPhantomRefs, NULL, false,
is_alive, keep_alive, complete_gc, task_executor);
// Process cleaners, but include them in phantom timing. We expect
// Cleaner references to be temporary, and don't want to deal with
--- 230,263 ----
total_count(_discoveredFinalRefs),
total_count(_discoveredPhantomRefs) + total_count(_discoveredCleanerRefs));
// Soft references
{
! GCRefTraceTime tt("SoftReference", trace_time, gc_timer, stats.soft_count());
process_discovered_reflist(_discoveredSoftRefs, _current_soft_ref_policy, true,
is_alive, keep_alive, complete_gc, task_executor);
}
update_soft_ref_master_clock();
// Weak references
{
! GCRefTraceTime tt("WeakReference", trace_time, gc_timer, stats.weak_count());
process_discovered_reflist(_discoveredWeakRefs, NULL, true,
is_alive, keep_alive, complete_gc, task_executor);
}
// Final references
{
! GCRefTraceTime tt("FinalReference", trace_time, gc_timer, stats.final_count());
process_discovered_reflist(_discoveredFinalRefs, NULL, false,
is_alive, keep_alive, complete_gc, task_executor);
}
// Phantom references
{
! GCRefTraceTime tt("PhantomReference", trace_time, gc_timer, stats.phantom_count());
process_discovered_reflist(_discoveredPhantomRefs, NULL, false,
is_alive, keep_alive, complete_gc, task_executor);
// Process cleaners, but include them in phantom timing. We expect
// Cleaner references to be temporary, and don't want to deal with
*** 271,281 ****
// traverse these simultaneously with the regular weak references above, but
// that is not how the JDK1.2 specification is. See #4126360. Native code can
// thus use JNI weak references to circumvent the phantom references and
// resurrect a "post-mortem" object.
{
! GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer, gc_id);
NOT_PRODUCT(log_ref_count(count_jni_refs(), trace_time);)
if (task_executor != NULL) {
task_executor->set_single_threaded_mode();
}
process_phaseJNI(is_alive, keep_alive, complete_gc);
--- 270,280 ----
// traverse these simultaneously with the regular weak references above, but
// that is not how the JDK1.2 specification is. See #4126360. Native code can
// thus use JNI weak references to circumvent the phantom references and
// resurrect a "post-mortem" object.
{
! GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer);
NOT_PRODUCT(log_ref_count(count_jni_refs(), trace_time);)
if (task_executor != NULL) {
task_executor->set_single_threaded_mode();
}
process_phaseJNI(is_alive, keep_alive, complete_gc);
*** 1150,1166 ****
void ReferenceProcessor::preclean_discovered_references(
BoolObjectClosure* is_alive,
OopClosure* keep_alive,
VoidClosure* complete_gc,
YieldClosure* yield,
! GCTimer* gc_timer,
! GCId gc_id) {
// Soft references
{
GCTraceTime tt("Preclean SoftReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer, gc_id);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredSoftRefs[i], is_alive,
--- 1149,1164 ----
void ReferenceProcessor::preclean_discovered_references(
BoolObjectClosure* is_alive,
OopClosure* keep_alive,
VoidClosure* complete_gc,
YieldClosure* yield,
! GCTimer* gc_timer) {
// Soft references
{
GCTraceTime tt("Preclean SoftReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredSoftRefs[i], is_alive,
*** 1169,1179 ****
}
// Weak references
{
GCTraceTime tt("Preclean WeakReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer, gc_id);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredWeakRefs[i], is_alive,
--- 1167,1177 ----
}
// Weak references
{
GCTraceTime tt("Preclean WeakReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredWeakRefs[i], is_alive,
*** 1182,1192 ****
}
// Final references
{
GCTraceTime tt("Preclean FinalReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer, gc_id);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredFinalRefs[i], is_alive,
--- 1180,1190 ----
}
// Final references
{
GCTraceTime tt("Preclean FinalReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredFinalRefs[i], is_alive,
*** 1195,1205 ****
}
// Phantom references
{
GCTraceTime tt("Preclean PhantomReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer, gc_id);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredPhantomRefs[i], is_alive,
--- 1193,1203 ----
}
// Phantom references
{
GCTraceTime tt("Preclean PhantomReferences", PrintGCDetails && PrintReferenceGC,
! false, gc_timer);
for (uint i = 0; i < _max_num_q; i++) {
if (yield->should_return()) {
return;
}
preclean_discovered_reflist(_discoveredPhantomRefs[i], is_alive,
< prev index next >