Skip to content
Permalink
Browse files
8270082: Remove unnecessary gc_timer null check in ReferenceProcessor…
…PhaseTimes

Reviewed-by: tschatzl, kbarrett
  • Loading branch information
albertnetymk committed Jul 9, 2021
1 parent 676f1d7 commit 3d193adbec07a77dce3b34fe5d0dbb99ff03b9a7
Showing with 4 additions and 8 deletions.
  1. +4 −8 src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp
@@ -117,9 +117,7 @@ RefProcPhaseTimeBaseTracker::RefProcPhaseTimeBaseTracker(const char* title,
assert(_phase_times != NULL, "Invariant");

_start_ticks.stamp();
if (_phase_times->gc_timer() != NULL) {
_phase_times->gc_timer()->register_gc_phase_start(title, _start_ticks);
}
_phase_times->gc_timer()->register_gc_phase_start(title, _start_ticks);
}

Ticks RefProcPhaseTimeBaseTracker::end_ticks() {
@@ -138,10 +136,8 @@ double RefProcPhaseTimeBaseTracker::elapsed_time() {
}

RefProcPhaseTimeBaseTracker::~RefProcPhaseTimeBaseTracker() {
if (_phase_times->gc_timer() != NULL) {
Ticks ticks = end_ticks();
_phase_times->gc_timer()->register_gc_phase_end(ticks);
}
Ticks ticks = end_ticks();
_phase_times->gc_timer()->register_gc_phase_end(ticks);
}

RefProcBalanceQueuesTimeTracker::RefProcBalanceQueuesTimeTracker(ReferenceProcessor::RefProcPhases phase_number,
@@ -175,7 +171,7 @@ RefProcTotalPhaseTimesTracker::~RefProcTotalPhaseTimesTracker() {

ReferenceProcessorPhaseTimes::ReferenceProcessorPhaseTimes(GCTimer* gc_timer, uint max_gc_threads) :
_processing_is_mt(false), _gc_timer(gc_timer) {

assert(gc_timer != nullptr, "pre-condition");
for (uint i = 0; i < ReferenceProcessor::RefSubPhaseMax; i++) {
_sub_phases_worker_time_sec[i] = new WorkerDataArray<double>(NULL, SubPhasesParWorkTitle[i], max_gc_threads);
}

1 comment on commit 3d193ad

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 3d193ad Jul 9, 2021

Please sign in to comment.