8193312: Rename VM_CGC_Operation to VM_G1Concurrent
authortschatzl
Thu, 06 Dec 2018 13:55:22 +0100
changeset 52874 c45a5b46461b
parent 52873 6e7db888f04c
child 52875 bb051ca06e9e
8193312: Rename VM_CGC_Operation to VM_G1Concurrent Reviewed-by: pliden, sjohanss, jgeorge
src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp
src/hotspot/share/gc/g1/vm_operations_g1.cpp
src/hotspot/share/gc/g1/vm_operations_g1.hpp
src/hotspot/share/runtime/vm_operations.hpp
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Mon Dec 03 10:51:03 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp	Thu Dec 06 13:55:22 2018 +0100
@@ -339,7 +339,7 @@
                                 TimeHelper::counter_to_millis(mark_end - mark_start));
           mark_manager.set_phase(G1ConcurrentPhase::REMARK, false);
           CMRemark cl(_cm);
-          VM_CGC_Operation op(&cl, "Pause Remark");
+          VM_G1Concurrent op(&cl, "Pause Remark");
           VMThread::execute(&op);
           if (_cm->has_aborted()) {
             break;
@@ -370,7 +370,7 @@
 
       if (!_cm->has_aborted()) {
         CMCleanup cl_cl(_cm);
-        VM_CGC_Operation op(&cl_cl, "Pause Cleanup");
+        VM_G1Concurrent op(&cl_cl, "Pause Cleanup");
         VMThread::execute(&op);
       }
 
--- a/src/hotspot/share/gc/g1/vm_operations_g1.cpp	Mon Dec 03 10:51:03 2018 +0100
+++ b/src/hotspot/share/gc/g1/vm_operations_g1.cpp	Thu Dec 06 13:55:22 2018 +0100
@@ -43,13 +43,14 @@
                                                      uint           gc_count_before,
                                                      GCCause::Cause gc_cause,
                                                      bool           should_initiate_conc_mark,
-                                                     double         target_pause_time_ms)
-  : VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
-    _pause_succeeded(false),
-    _should_initiate_conc_mark(should_initiate_conc_mark),
-    _should_retry_gc(false),
-    _target_pause_time_ms(target_pause_time_ms),
-    _old_marking_cycles_completed_before(0) {
+                                                     double         target_pause_time_ms) :
+  VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
+  _pause_succeeded(false),
+  _should_initiate_conc_mark(should_initiate_conc_mark),
+  _should_retry_gc(false),
+  _target_pause_time_ms(target_pause_time_ms),
+  _old_marking_cycles_completed_before(0) {
+
   guarantee(target_pause_time_ms > 0.0,
             "target_pause_time_ms = %1.6lf should be positive",
             target_pause_time_ms);
@@ -199,23 +200,23 @@
   }
 }
 
-void VM_CGC_Operation::doit() {
+void VM_G1Concurrent::doit() {
   GCIdMark gc_id_mark(_gc_id);
   GCTraceCPUTime tcpu;
   G1CollectedHeap* g1h = G1CollectedHeap::heap();
-  GCTraceTime(Info, gc) t(_printGCMessage, g1h->concurrent_mark()->gc_timer_cm(), GCCause::_no_gc, true);
+  GCTraceTime(Info, gc) t(_message, g1h->concurrent_mark()->gc_timer_cm(), GCCause::_no_gc, true);
   TraceCollectorStats tcs(g1h->g1mm()->conc_collection_counters());
   SvcGCMarker sgcm(SvcGCMarker::CONCURRENT);
   IsGCActiveMark x;
   _cl->do_void();
 }
 
-bool VM_CGC_Operation::doit_prologue() {
+bool VM_G1Concurrent::doit_prologue() {
   Heap_lock->lock();
   return true;
 }
 
-void VM_CGC_Operation::doit_epilogue() {
+void VM_G1Concurrent::doit_epilogue() {
   if (Universe::has_reference_pending_list()) {
     Heap_lock->notify_all();
   }
--- a/src/hotspot/share/gc/g1/vm_operations_g1.hpp	Mon Dec 03 10:51:03 2018 +0100
+++ b/src/hotspot/share/gc/g1/vm_operations_g1.hpp	Thu Dec 06 13:55:22 2018 +0100
@@ -30,31 +30,28 @@
 
 // VM_operations for the G1 collector.
 // VM_GC_Operation:
-//   - VM_CGC_Operation
+//   - VM_G1Concurrent
 //   - VM_G1CollectForAllocation
 //   - VM_G1CollectFull
 
-class VM_G1CollectFull: public VM_GC_Operation {
+class VM_G1CollectFull : public VM_GC_Operation {
 public:
   VM_G1CollectFull(uint gc_count_before,
                    uint full_gc_count_before,
-                   GCCause::Cause cause)
-    : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
+                   GCCause::Cause cause) :
+    VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
   virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
   virtual void doit();
-  virtual const char* name() const {
-    return "G1 Full collection";
-  }
 };
 
-class VM_G1CollectForAllocation: public VM_CollectForAllocation {
-private:
+class VM_G1CollectForAllocation : public VM_CollectForAllocation {
   bool         _pause_succeeded;
 
   bool         _should_initiate_conc_mark;
   bool         _should_retry_gc;
   double       _target_pause_time_ms;
   uint         _old_marking_cycles_completed_before;
+
 public:
   VM_G1CollectForAllocation(size_t         word_size,
                             uint           gc_count_before,
@@ -65,30 +62,23 @@
   virtual bool doit_prologue();
   virtual void doit();
   virtual void doit_epilogue();
-  virtual const char* name() const {
-    return "G1 collect for allocation";
-  }
   bool should_retry_gc() const { return _should_retry_gc; }
   bool pause_succeeded() { return _pause_succeeded; }
 };
 
-// Concurrent GC stop-the-world operations such as remark and cleanup;
-// consider sharing these with CMS's counterparts.
-class VM_CGC_Operation: public VM_Operation {
+// Concurrent G1 stop-the-world operations such as remark and cleanup.
+class VM_G1Concurrent : public VM_Operation {
   VoidClosure* _cl;
-  const char*  _printGCMessage;
+  const char*  _message;
   uint         _gc_id;
 
 public:
-  VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg)
-    : _cl(cl), _printGCMessage(printGCMsg), _gc_id(GCId::current()) {}
-  virtual VMOp_Type type() const { return VMOp_CGC_Operation; }
+  VM_G1Concurrent(VoidClosure* cl, const char* message) :
+    _cl(cl), _message(message), _gc_id(GCId::current()) { }
+  virtual VMOp_Type type() const { return VMOp_G1Concurrent; }
   virtual void doit();
   virtual bool doit_prologue();
   virtual void doit_epilogue();
-  virtual const char* name() const {
-    return "concurrent gc";
-  }
 };
 
 #endif // SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP
--- a/src/hotspot/share/runtime/vm_operations.hpp	Mon Dec 03 10:51:03 2018 +0100
+++ b/src/hotspot/share/runtime/vm_operations.hpp	Thu Dec 06 13:55:22 2018 +0100
@@ -63,11 +63,11 @@
   template(GenCollectForAllocation)               \
   template(ParallelGCFailedAllocation)            \
   template(ParallelGCSystemGC)                    \
-  template(CGC_Operation)                         \
   template(CMS_Initial_Mark)                      \
   template(CMS_Final_Remark)                      \
   template(G1CollectForAllocation)                \
   template(G1CollectFull)                         \
+  template(G1Concurrent)                          \
   template(ZOperation)                            \
   template(HandshakeOneThread)                    \
   template(HandshakeAllThreads)                   \
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java	Mon Dec 03 10:51:03 2018 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java	Thu Dec 06 13:55:22 2018 +0100
@@ -50,13 +50,13 @@
   GenCollectForAllocation,
   ParallelGCFailedAllocation,
   ParallelGCSystemGC,
-  CGC_Operation,
   CMS_Initial_Mark,
   CMS_Final_Remark,
   G1CollectFull,
   ZOperation,
   G1CollectForAllocation,
   G1IncCollectionPause,
+  G1Concurrent,
   EnableBiasedLocking,
   RevokeBias,
   BulkRevokeBias,