提交 4d5b7476 编写于 作者: J johnc

8000831: Heap verification output incorrect/incomplete

Summary: Restore non-silent output of heap verification.
Reviewed-by: ysr, brutisso, jmasa
上级 a790fe7c
...@@ -2395,7 +2395,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) { ...@@ -2395,7 +2395,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyBeforeGC && if (VerifyBeforeGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
Universe::verify(true); Universe::verify();
} }
// Snapshot the soft reference policy to be used in this collection cycle. // Snapshot the soft reference policy to be used in this collection cycle.
...@@ -2419,7 +2419,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) { ...@@ -2419,7 +2419,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC && if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before initial mark: "); gclog_or_tty->print("Verify before initial mark: ");
Universe::verify(true); Universe::verify();
} }
{ {
bool res = markFromRoots(false); bool res = markFromRoots(false);
...@@ -2431,7 +2431,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) { ...@@ -2431,7 +2431,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC && if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before re-mark: "); gclog_or_tty->print("Verify before re-mark: ");
Universe::verify(true); Universe::verify();
} }
checkpointRootsFinal(false, clear_all_soft_refs, checkpointRootsFinal(false, clear_all_soft_refs,
init_mark_was_synchronous); init_mark_was_synchronous);
...@@ -2443,7 +2443,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) { ...@@ -2443,7 +2443,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC && if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before sweep: "); gclog_or_tty->print("Verify before sweep: ");
Universe::verify(true); Universe::verify();
} }
sweep(false); sweep(false);
assert(_collectorState == Resizing, "Incorrect state"); assert(_collectorState == Resizing, "Incorrect state");
...@@ -2459,7 +2459,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) { ...@@ -2459,7 +2459,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyDuringGC && if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
gclog_or_tty->print("Verify before reset: "); gclog_or_tty->print("Verify before reset: ");
Universe::verify(true); Universe::verify();
} }
reset(false); reset(false);
assert(_collectorState == Idling, "Collector state should " assert(_collectorState == Idling, "Collector state should "
...@@ -2486,7 +2486,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) { ...@@ -2486,7 +2486,7 @@ void CMSCollector::collect_in_foreground(bool clear_all_soft_refs) {
if (VerifyAfterGC && if (VerifyAfterGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
Universe::verify(true); Universe::verify();
} }
if (TraceCMSState) { if (TraceCMSState) {
gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT
...@@ -5668,7 +5668,7 @@ void CMSCollector::do_remark_non_parallel() { ...@@ -5668,7 +5668,7 @@ void CMSCollector::do_remark_non_parallel() {
if (VerifyDuringGC && if (VerifyDuringGC &&
GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
Universe::verify(true); Universe::verify();
} }
{ {
TraceTime t("root rescan", PrintGCDetails, false, gclog_or_tty); TraceTime t("root rescan", PrintGCDetails, false, gclog_or_tty);
......
...@@ -64,7 +64,7 @@ void VM_CMS_Operation::verify_before_gc() { ...@@ -64,7 +64,7 @@ void VM_CMS_Operation::verify_before_gc() {
FreelistLocker x(_collector); FreelistLocker x(_collector);
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag); MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
Universe::heap()->prepare_for_verify(); Universe::heap()->prepare_for_verify();
Universe::verify(true); Universe::verify();
} }
} }
...@@ -74,7 +74,7 @@ void VM_CMS_Operation::verify_after_gc() { ...@@ -74,7 +74,7 @@ void VM_CMS_Operation::verify_after_gc() {
HandleMark hm; HandleMark hm;
FreelistLocker x(_collector); FreelistLocker x(_collector);
MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag); MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag);
Universe::verify(true); Universe::verify();
} }
} }
......
...@@ -1120,8 +1120,8 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { ...@@ -1120,8 +1120,8 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
HandleMark hm; // handle scope HandleMark hm; // handle scope
gclog_or_tty->print(" VerifyDuringGC:(before)"); gclog_or_tty->print(" VerifyDuringGC:(before)");
Universe::heap()->prepare_for_verify(); Universe::heap()->prepare_for_verify();
Universe::verify(/* silent */ false, Universe::verify(/* silent */ false,
/* option */ VerifyOption_G1UsePrevMarking); /* option */ VerifyOption_G1UsePrevMarking);
} }
G1CollectorPolicy* g1p = g1h->g1_policy(); G1CollectorPolicy* g1p = g1h->g1_policy();
...@@ -1159,8 +1159,8 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { ...@@ -1159,8 +1159,8 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
HandleMark hm; // handle scope HandleMark hm; // handle scope
gclog_or_tty->print(" VerifyDuringGC:(after)"); gclog_or_tty->print(" VerifyDuringGC:(after)");
Universe::heap()->prepare_for_verify(); Universe::heap()->prepare_for_verify();
Universe::verify(/* silent */ false, Universe::verify(/* silent */ false,
/* option */ VerifyOption_G1UseNextMarking); /* option */ VerifyOption_G1UseNextMarking);
} }
assert(!restart_for_overflow(), "sanity"); assert(!restart_for_overflow(), "sanity");
} }
...@@ -1811,8 +1811,8 @@ void ConcurrentMark::cleanup() { ...@@ -1811,8 +1811,8 @@ void ConcurrentMark::cleanup() {
HandleMark hm; // handle scope HandleMark hm; // handle scope
gclog_or_tty->print(" VerifyDuringGC:(before)"); gclog_or_tty->print(" VerifyDuringGC:(before)");
Universe::heap()->prepare_for_verify(); Universe::heap()->prepare_for_verify();
Universe::verify(/* silent */ false, Universe::verify(/* silent */ false,
/* option */ VerifyOption_G1UsePrevMarking); /* option */ VerifyOption_G1UsePrevMarking);
} }
G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy(); G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy();
...@@ -1966,8 +1966,8 @@ void ConcurrentMark::cleanup() { ...@@ -1966,8 +1966,8 @@ void ConcurrentMark::cleanup() {
HandleMark hm; // handle scope HandleMark hm; // handle scope
gclog_or_tty->print(" VerifyDuringGC:(after)"); gclog_or_tty->print(" VerifyDuringGC:(after)");
Universe::heap()->prepare_for_verify(); Universe::heap()->prepare_for_verify();
Universe::verify(/* silent */ false, Universe::verify(/* silent */ false,
/* option */ VerifyOption_G1UsePrevMarking); /* option */ VerifyOption_G1UsePrevMarking);
} }
g1h->verify_region_sets_optional(); g1h->verify_region_sets_optional();
......
...@@ -139,7 +139,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { ...@@ -139,7 +139,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyBeforeGC:"); gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true); Universe::verify();
} }
// Verify object start arrays // Verify object start arrays
...@@ -341,7 +341,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { ...@@ -341,7 +341,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:"); gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false); Universe::verify();
} }
// Re-verify object start arrays // Re-verify object start arrays
......
...@@ -983,7 +983,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) ...@@ -983,7 +983,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values)
if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyBeforeGC:"); gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true); Universe::verify();
} }
// Verify object start arrays // Verify object start arrays
...@@ -2184,7 +2184,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { ...@@ -2184,7 +2184,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:"); gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false); Universe::verify();
} }
// Re-verify object start arrays // Re-verify object start arrays
......
...@@ -315,7 +315,7 @@ bool PSScavenge::invoke_no_policy() { ...@@ -315,7 +315,7 @@ bool PSScavenge::invoke_no_policy() {
if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyBeforeGC:"); gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true); Universe::verify();
} }
{ {
...@@ -639,7 +639,7 @@ bool PSScavenge::invoke_no_policy() { ...@@ -639,7 +639,7 @@ bool PSScavenge::invoke_no_policy() {
if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:"); gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false); Universe::verify();
} }
heap->print_heap_after_gc(); heap->print_heap_after_gc();
......
...@@ -447,7 +447,7 @@ void GenCollectedHeap::do_collection(bool full, ...@@ -447,7 +447,7 @@ void GenCollectedHeap::do_collection(bool full,
prepared_for_verification = true; prepared_for_verification = true;
} }
gclog_or_tty->print(" VerifyBeforeGC:"); gclog_or_tty->print(" VerifyBeforeGC:");
Universe::verify(true); Universe::verify();
} }
COMPILER2_PRESENT(DerivedPointerTable::clear()); COMPILER2_PRESENT(DerivedPointerTable::clear());
...@@ -519,7 +519,7 @@ void GenCollectedHeap::do_collection(bool full, ...@@ -519,7 +519,7 @@ void GenCollectedHeap::do_collection(bool full,
total_collections() >= VerifyGCStartAt) { total_collections() >= VerifyGCStartAt) {
HandleMark hm; // Discard invalid handles created during verification HandleMark hm; // Discard invalid handles created during verification
gclog_or_tty->print(" VerifyAfterGC:"); gclog_or_tty->print(" VerifyAfterGC:");
Universe::verify(false); Universe::verify();
} }
if (PrintGCDetails) { if (PrintGCDetails) {
......
...@@ -403,8 +403,14 @@ class Universe: AllStatic { ...@@ -403,8 +403,14 @@ class Universe: AllStatic {
// Debugging // Debugging
static bool verify_in_progress() { return _verify_in_progress; } static bool verify_in_progress() { return _verify_in_progress; }
static void verify(bool silent = false, static void verify(bool silent, VerifyOption option);
VerifyOption option = VerifyOption_Default ); static void verify(bool silent) {
verify(silent, VerifyOption_Default /* option */);
}
static void verify() {
verify(false /* silent */);
}
static int verify_count() { return _verify_count; } static int verify_count() { return _verify_count; }
// The default behavior is to call print_on() on gclog_or_tty. // The default behavior is to call print_on() on gclog_or_tty.
static void print(); static void print();
......
...@@ -477,7 +477,7 @@ extern "C" void verify() { ...@@ -477,7 +477,7 @@ extern "C" void verify() {
} }
// Ensure Eden top is correct before verification // Ensure Eden top is correct before verification
Universe::heap()->prepare_for_verify(); Universe::heap()->prepare_for_verify();
Universe::verify(true); Universe::verify();
if (!safe) SafepointSynchronize::set_is_not_at_safepoint(); if (!safe) SafepointSynchronize::set_is_not_at_safepoint();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册