< prev index next >

src/hotspot/share/gc/shared/collectorCounters.hpp

Print this page

        

@@ -69,19 +69,22 @@
   protected:
     CollectorCounters* _c;
 
   public:
     inline TraceCollectorStats(CollectorCounters* c) :
-           PerfTraceTimedEvent(c->time_counter(), c->invocation_counter()),
+           PerfTraceTimedEvent((c == NULL) ? NULL : c->time_counter(),
+                               (c == NULL) ? NULL : c->invocation_counter()),
            _c(c) {
 
-      if (UsePerfData) {
+      if (UsePerfData && (_c != NULL)) {
          _c->last_entry_counter()->set_value(os::elapsed_counter());
       }
     }
 
     inline ~TraceCollectorStats() {
-      if (UsePerfData) _c->last_exit_counter()->set_value(os::elapsed_counter());
+      if (UsePerfData && (_c != NULL)) {
+        _c->last_exit_counter()->set_value(os::elapsed_counter());
+      }
     }
 };
 
 #endif // SHARE_VM_GC_SHARED_COLLECTORCOUNTERS_HPP
< prev index next >