< prev index next >
src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp
Print this page
@@ -123,10 +123,14 @@
}
}
template <class T>
void WorkerDataArray<T>::verify() {
+ if (!_enabled) {
+ return;
+ }
+
for (uint i = 0; i < _length; i++) {
assert(_data[i] != WorkerDataArray<T>::uninitialized(),
err_msg("Invalid data for worker %u in '%s'", i, _title));
}
if (_sub_count != NULL) {
@@ -310,15 +314,19 @@
}
}
G1GCPhaseTimesTracker::G1GCPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCPhases phase, uint worker_id) :
_phase_times(phase_times), _phase(phase), _worker_id(worker_id) {
+ if (_phase_times != NULL) {
_start_time = os::elapsedTime();
+ }
}
G1GCPhaseTimesTracker::~G1GCPhaseTimesTracker() {
+ if (_phase_times != NULL) {
_phase_times->record_time_secs(_phase, _worker_id, os::elapsedTime() - _start_time);
+ }
}
void G1GCPhasePrinter::print_single_length(G1GCPhaseTimes::GCPhases phase_id, WorkerDataArray<double>* phase) {
// No need for min, max, average and sum for only one worker
LineBuffer buf(phase->_indent_level);
< prev index next >