mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8136627: Backout JDK-8133818 Additional number of processed references printed with -XX:+PrintReferenceGC after JDK-8047125
Reviewed-by: brutisso
This commit is contained in:
parent
b0b89c5b41
commit
b78e96713b
12 changed files with 47 additions and 144 deletions
|
@ -243,13 +243,10 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
|
|||
process_discovered_reflist(_discoveredPhantomRefs, NULL, false,
|
||||
is_alive, keep_alive, complete_gc, task_executor);
|
||||
|
||||
}
|
||||
|
||||
// Cleaners
|
||||
size_t cleaner_count = 0;
|
||||
{
|
||||
GCTraceTime tt("Cleaners", trace_time, false, gc_timer, gc_id);
|
||||
cleaner_count =
|
||||
// Process cleaners, but include them in phantom statistics. We expect
|
||||
// Cleaner references to be temporary, and don't want to deal with
|
||||
// possible incompatibilities arising from making it more visible.
|
||||
phantom_count +=
|
||||
process_discovered_reflist(_discoveredCleanerRefs, NULL, true,
|
||||
is_alive, keep_alive, complete_gc, task_executor);
|
||||
}
|
||||
|
@ -259,17 +256,15 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
|
|||
// 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.
|
||||
size_t jni_weak_ref_count = 0;
|
||||
{
|
||||
GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer, gc_id);
|
||||
if (task_executor != NULL) {
|
||||
task_executor->set_single_threaded_mode();
|
||||
}
|
||||
jni_weak_ref_count =
|
||||
process_phaseJNI(is_alive, keep_alive, complete_gc);
|
||||
process_phaseJNI(is_alive, keep_alive, complete_gc);
|
||||
}
|
||||
|
||||
return ReferenceProcessorStats(soft_count, weak_count, final_count, phantom_count, cleaner_count, jni_weak_ref_count);
|
||||
return ReferenceProcessorStats(soft_count, weak_count, final_count, phantom_count);
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
@ -296,17 +291,17 @@ uint ReferenceProcessor::count_jni_refs() {
|
|||
}
|
||||
#endif
|
||||
|
||||
size_t ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive,
|
||||
OopClosure* keep_alive,
|
||||
VoidClosure* complete_gc) {
|
||||
DEBUG_ONLY(size_t check_count = count_jni_refs();)
|
||||
size_t count = JNIHandles::weak_oops_do(is_alive, keep_alive);
|
||||
assert(count == check_count, "Counts didn't match");
|
||||
complete_gc->do_void();
|
||||
void ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive,
|
||||
OopClosure* keep_alive,
|
||||
VoidClosure* complete_gc) {
|
||||
#ifndef PRODUCT
|
||||
if (PrintGCDetails && PrintReferenceGC) {
|
||||
gclog_or_tty->print(", " SIZE_FORMAT " refs", count);
|
||||
unsigned int count = count_jni_refs();
|
||||
gclog_or_tty->print(", %u refs", count);
|
||||
}
|
||||
return count;
|
||||
#endif
|
||||
JNIHandles::weak_oops_do(is_alive, keep_alive);
|
||||
complete_gc->do_void();
|
||||
}
|
||||
|
||||
|
||||
|
@ -946,10 +941,9 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt)
|
|||
list = &_discoveredCleanerRefs[id];
|
||||
break;
|
||||
case REF_NONE:
|
||||
case REF_JNI:
|
||||
// we should not reach here if we are an InstanceRefKlass
|
||||
default:
|
||||
guarantee(false, err_msg("rt should not be %d", rt));
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
if (TraceReferenceGC && PrintGCDetails) {
|
||||
gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, p2i(list));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue