diff --git a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index e71c109782399ec9f1248b6e47edffc1d020fed2..07425538987703467587c4868dc55c1d8a85000f 100644 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -2753,7 +2753,7 @@ void G1CollectedHeap::print_taskqueue_stats(outputStream* const st) const { print_taskqueue_stats_hdr(st); TaskQueueStats totals; - const int n = MAX2(workers()->total_workers(), 1); + const int n = workers() != NULL ? workers()->total_workers() : 1; for (int i = 0; i < n; ++i) { st->print("%3d ", i); task_queue(i)->stats.print(st); st->cr(); totals += task_queue(i)->stats; @@ -2764,7 +2764,7 @@ void G1CollectedHeap::print_taskqueue_stats(outputStream* const st) const { } void G1CollectedHeap::reset_taskqueue_stats() { - const int n = MAX2(workers()->total_workers(), 1); + const int n = workers() != NULL ? workers()->total_workers() : 1; for (int i = 0; i < n; ++i) { task_queue(i)->stats.reset(); }