< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp

Print this page

        

*** 98,111 **** _heap->heuristics()->record_gc_end(); } ShenandoahGCPhase::ShenandoahGCPhase(const ShenandoahPhaseTimings::Phase phase) : _heap(ShenandoahHeap::heap()), _phase(phase) { ! assert(!Thread::current()->is_Worker_thread() && ! (Thread::current()->is_VM_thread() || ! Thread::current()->is_ConcurrentGC_thread()), ! "Must be set by these threads"); _parent_phase = _current_phase; _current_phase = phase; _heap->phase_timings()->record_phase_start(_phase); } --- 98,110 ---- _heap->heuristics()->record_gc_end(); } ShenandoahGCPhase::ShenandoahGCPhase(const ShenandoahPhaseTimings::Phase phase) : _heap(ShenandoahHeap::heap()), _phase(phase) { ! assert(Thread::current()->is_VM_thread() || ! Thread::current()->is_ConcurrentGC_thread(), ! "Must be set by these threads"); _parent_phase = _current_phase; _current_phase = phase; _heap->phase_timings()->record_phase_start(_phase); }
*** 181,229 **** Thread* thr = Thread::current(); assert(ShenandoahThreadLocalData::worker_id(thr) != ShenandoahThreadLocalData::INVALID_WORKER_ID, "Must be set"); ShenandoahThreadLocalData::set_worker_id(thr, ShenandoahThreadLocalData::INVALID_WORKER_ID); #endif } - - struct PhaseMap { - WeakProcessorPhases::Phase _weak_processor_phase; - ShenandoahPhaseTimings::GCParPhases _shenandoah_phase; - }; - - static const struct PhaseMap phase_mapping[] = { - #if INCLUDE_JVMTI - {WeakProcessorPhases::jvmti, ShenandoahPhaseTimings::JVMTIWeakRoots}, - #endif - #if INCLUDE_JFR - {WeakProcessorPhases::jfr, ShenandoahPhaseTimings::JFRWeakRoots}, - #endif - {WeakProcessorPhases::jni, ShenandoahPhaseTimings::JNIWeakRoots}, - {WeakProcessorPhases::stringtable, ShenandoahPhaseTimings::StringTableRoots}, - {WeakProcessorPhases::resolved_method_table, ShenandoahPhaseTimings::ResolvedMethodTableRoots}, - {WeakProcessorPhases::vm, ShenandoahPhaseTimings::VMWeakRoots} - }; - - STATIC_ASSERT(sizeof(phase_mapping) / sizeof(PhaseMap) == WeakProcessorPhases::phase_count); - - void ShenandoahTimingConverter::weak_processing_timing_to_shenandoah_timing(WeakProcessorPhaseTimes* weak_processing_timings, - ShenandoahWorkerTimings* sh_worker_times) { - assert(weak_processing_timings->max_threads() == weak_processing_timings->max_threads(), "Must match"); - for (uint index = 0; index < WeakProcessorPhases::phase_count; index ++) { - weak_processing_phase_to_shenandoah_phase(phase_mapping[index]._weak_processor_phase, - weak_processing_timings, - phase_mapping[index]._shenandoah_phase, - sh_worker_times); - } - } - - void ShenandoahTimingConverter::weak_processing_phase_to_shenandoah_phase(WeakProcessorPhases::Phase wpp, - WeakProcessorPhaseTimes* weak_processing_timings, - ShenandoahPhaseTimings::GCParPhases spp, - ShenandoahWorkerTimings* sh_worker_times) { - if (WeakProcessorPhases::is_serial(wpp)) { - sh_worker_times->record_time_secs(spp, 0, weak_processing_timings->phase_time_sec(wpp)); - } else { - for (uint index = 0; index < weak_processing_timings->max_threads(); index ++) { - sh_worker_times->record_time_secs(spp, index, weak_processing_timings->worker_time_sec(index, wpp)); - } - } - } --- 180,184 ----
< prev index next >