RFR(S): Use scoped object for gc session/phases recording

Aleksey Shipilev shade at redhat.com
Tue Jun 13 15:39:15 UTC 2017


On 06/13/2017 05:24 PM, Zhengyu Gu wrote:
> Using scoped object for recording gc session and gc phases, to avoid the awkward
> do ... while(false) loop
> 
> 
> Webrev:http://cr.openjdk.java.net/~zgu/shenandoah/gc_phase_recording/webrev.00/

Oh! I like this a lot.

 *) When doing the scopes, can you put ShenandoahGCPhase at the beginning of the
scope? E.g.:

   {
     ShenandoahGCPhase total(SCP::total_pause_gross);
     ShenandoahGCPhase final_update_refs_phase(SCP::total_pause_gross);
     VM_ShenandoahFinalUpdateRefs final_update_refs;
     VMThread::execute(&final_update_refs);
   }

instead of:

   {
     VM_ShenandoahFinalUpdateRefs final_update_refs;
     ShenandoahGCPhase total(SCP::total_pause_gross);
     ShenandoahGCPhase final_update_refs_phase(SCP::total_pause_gross);
     VMThread::execute(&final_update_refs);
   }

 *) These instances could be just named "phase", right?

1465     ShenandoahGCPhase
accum_stats_phase(ShenandoahCollectorPolicy::accumulate_stats);
1480     ShenandoahGCPhase
clear_liveness_phase(ShenandoahCollectorPolicy::clear_liveness);
...

 *) I am a bit worried about changing the BS in MarkCompact until we cancelled
and cleaned up everything in preparation phase. I think leaving that block
outside of "preparation" scope is fine.

Thanks,
-Aleksey



More information about the shenandoah-dev mailing list