--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2017-11-29 16:41:16.396701430 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2017-11-29 16:41:16.132690995 +0100 @@ -1085,14 +1085,6 @@ } } -G1HeapVerifier::G1VerifyType G1CollectedHeap::young_verification_type() { - if (collector_state()->yc_type() == Mixed) { - return G1HeapVerifier::G1VerifyMixed; - } else { - return G1HeapVerifier::G1VerifyYoung; - } -} - void G1CollectedHeap::abort_concurrent_cycle() { // Note: When we have a more flexible GC logging framework that // allows us to add optional attributes to a GC log record we @@ -2944,13 +2936,17 @@ GCTraceCPUTime tcpu; + G1HeapVerifier::G1VerifyType verify_type; FormatBuffer<> gc_string("Pause "); if (collector_state()->during_initial_mark_pause()) { gc_string.append("Initial Mark"); + verify_type = G1HeapVerifier::G1VerifyInitialMark; } else if (collector_state()->gcs_are_young()) { gc_string.append("Young"); + verify_type = G1HeapVerifier::G1VerifyYoungOnly; } else { gc_string.append("Mixed"); + verify_type = G1HeapVerifier::G1VerifyMixed; } GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true); @@ -2991,7 +2987,7 @@ heap_region_iterate(&v_cl); } - _verifier->verify_before_gc(young_verification_type()); + _verifier->verify_before_gc(verify_type); _verifier->check_bitmaps("GC Start"); @@ -3151,7 +3147,7 @@ heap_region_iterate(&v_cl); } - _verifier->verify_after_gc(young_verification_type()); + _verifier->verify_after_gc(verify_type); _verifier->check_bitmaps("GC End"); assert(!ref_processor_stw()->discovery_enabled(), "Postcondition");