RFR (XS) 8243395: Shenandoah: demote guarantee in ShenandoahPhaseTimings::record_workers_end

Zhengyu Gu zgu at redhat.com
Wed Apr 22 13:09:33 UTC 2020


Looks good.

-Zhengyu

On 4/22/20 9:01 AM, Aleksey Shipilev wrote:
> RFE:
>    https://bugs.openjdk.java.net/browse/JDK-8243395
> 
> It has the guarantee() block that verifies the per-thread worker times are only added to relevant
> phases. There is no reason to have it as guarantee and expose it in release bits, and it is exposed
> on critical path during GC pauses. assert should be enough.
> 
> Fix:
> 
> diff -r d380fc43bcbb -r c2d54a087de0 src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp        Wed Apr 22 13:48:28 2020 +0200
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp        Wed Apr 22 13:50:26 2020 +0200
> @@ -73,16 +73,17 @@
>       return;
>     }
> 
> -  guarantee(phase == init_evac ||
> -            phase == scan_roots ||
> -            phase == update_roots ||
> -            phase == final_update_refs_roots ||
> -            phase == full_gc_roots ||
> -            phase == degen_gc_update_roots ||
> -            phase == full_gc_purge_par ||
> -            phase == purge_par ||
> -            phase == _num_phases,
> -            "only in these phases we can add per-thread phase times");
> +  assert(phase == init_evac ||
> +         phase == scan_roots ||
> +         phase == update_roots ||
> +         phase == final_update_refs_roots ||
> +         phase == full_gc_roots ||
> +         phase == degen_gc_update_roots ||
> +         phase == full_gc_purge_par ||
> +         phase == purge_par ||
> +         phase == _num_phases,
> +         "Phase should accept accept per-thread phase times: %s", phase_name(phase));
> +
>     if (phase != _num_phases) {
>       double s = 0;
>       for (uint i = 1; i < GCParPhasesSentinel; i++) {
> 
> Testing: hotspot_gc_shenandoah
> 




More information about the hotspot-gc-dev mailing list