--- old/src/share/vm/gc/shenandoah/shenandoahConcurrentThread.cpp 2017-03-13 09:18:23.159587851 -0400 +++ new/src/share/vm/gc/shenandoah/shenandoahConcurrentThread.cpp 2017-03-13 09:18:23.098587952 -0400 @@ -87,6 +87,7 @@ GCIdMark gc_id_mark; TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters()); TraceMemoryManagerStats tmms(false, GCCause::_no_cause_specified); + ShenandoahWorkGang* workers = heap->workers(); // Start initial mark under STW: { @@ -105,10 +106,9 @@ // Continue concurrent mark: { // Setup workers for concurrent marking phase - WorkGang* workers = heap->workers(); uint n_workers = ShenandoahCollectorPolicy::calc_workers_for_conc_marking(workers->active_workers(), Threads::number_of_non_daemon_threads()); - ShenandoahWorkerScope scope(workers, n_workers); + ShenandoahWorkerSessionScope scope(workers, n_workers, ShenandoahWorkerSessionScope::Concurrent); GCTraceTime(Info, gc) time("Concurrent marking", gc_timer, GCCause::_no_gc, true); TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters()); @@ -154,10 +154,9 @@ // Continue concurrent evacuation: { // Setup workers for concurrent evacuation phase - WorkGang* workers = heap->workers(); uint n_workers = ShenandoahCollectorPolicy::calc_workers_for_conc_evacuation(workers->active_workers(), Threads::number_of_non_daemon_threads()); - ShenandoahWorkerScope scope(workers, n_workers); + ShenandoahWorkerSessionScope scope(workers, n_workers, ShenandoahWorkerSessionScope::Concurrent); GCTraceTime(Info, gc) time("Concurrent evacuation ", gc_timer, GCCause::_no_gc, true); TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters()); @@ -170,7 +169,6 @@ { GCTraceTime(Info, gc) time("Concurrent reset bitmaps", gc_timer, GCCause::_no_gc); heap->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::reset_bitmaps); - WorkGang* workers = heap->workers(); ShenandoahPushWorkerScope scope(workers, heap->max_workers()); heap->reset_next_mark_bitmap(workers); heap->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::reset_bitmaps);