< prev index next >

src/share/vm/gc/g1/g1HRPrinter.hpp

Print this page

        

@@ -24,10 +24,11 @@
 
 #ifndef SHARE_VM_GC_G1_G1HRPRINTER_HPP
 #define SHARE_VM_GC_G1_G1HRPRINTER_HPP
 
 #include "gc/g1/heapRegion.hpp"
+#include "logging/log.hpp"
 #include "memory/allocation.hpp"
 
 #define SKIP_RETIRED_FULL_REGIONS 1
 
 class G1HRPrinter VALUE_OBJ_CLASS_SPEC {

@@ -53,23 +54,13 @@
     StartsHumongous,
     ContinuesHumongous,
     Archive
   } RegionType;
 
-  typedef enum {
-    StartGC,
-    EndGC,
-    StartFullGC,
-    EndFullGC
-  } PhaseType;
-
 private:
-  bool _active;
-
   static const char* action_name(ActionType action);
   static const char* region_type_name(RegionType type);
-  static const char* phase_name(PhaseType phase);
 
   // Print an action event. This version is used in most scenarios and
   // only prints the region's bottom. The parameters type and top are
   // optional (the "not set" values are Unset and NULL).
   static void print(ActionType action, RegionType type,

@@ -77,22 +68,15 @@
 
   // Print an action event. This version prints both the region's
   // bottom and end. Used for Commit / Uncommit events.
   static void print(ActionType action, HeapWord* bottom, HeapWord* end);
 
-  // Print a phase event.
-  static void print(PhaseType phase, size_t phase_num);
-
 public:
   // In some places we iterate over a list in order to generate output
   // for the list's elements. By exposing this we can avoid this
   // iteration if the printer is not active.
-  const bool is_active() { return _active; }
-
-  // Have to set this explicitly as we have to do this during the
-  // heap's initialize() method, not in the constructor.
-  void set_active(bool active) { _active = active; }
+  const bool is_active() { return log_is_enabled(Trace, gc, region); }
 
   // The methods below are convenient wrappers for the print() methods.
 
   void alloc(HeapRegion* hr, RegionType type, bool force = false) {
     if (is_active()) {

@@ -153,30 +137,8 @@
   void uncommit(HeapWord* bottom, HeapWord* end) {
     if (is_active()) {
       print(Uncommit, bottom, end);
     }
   }
-
-  void start_gc(bool full, size_t gc_num) {
-    if (is_active()) {
-      if (!full) {
-        print(StartGC, gc_num);
-      } else {
-        print(StartFullGC, gc_num);
-      }
-    }
-  }
-
-  void end_gc(bool full, size_t gc_num) {
-    if (is_active()) {
-      if (!full) {
-        print(EndGC, gc_num);
-      } else {
-        print(EndFullGC, gc_num);
-      }
-    }
-  }
-
-  G1HRPrinter() : _active(false) { }
 };
 
 #endif // SHARE_VM_GC_G1_G1HRPRINTER_HPP
< prev index next >