Skip to content

Commit

Permalink
8270082: Remove unnecessary gc_timer null check in ReferenceProcessor…
Browse files Browse the repository at this point in the history
…PhaseTimes

Reviewed-by: tschatzl, kbarrett
  • Loading branch information
albertnetymk committed Jul 9, 2021
1 parent 676f1d7 commit 3d193ad
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp
Expand Up @@ -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() {
Expand All @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down

1 comment on commit 3d193ad

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.