src/hotspot/share/gc/z/zDriver.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 55002 da9840e2f7da
child 58679 9c3209ff7550
--- a/src/hotspot/share/gc/z/zDriver.cpp	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/share/gc/z/zDriver.cpp	Thu Oct 17 20:53:35 2019 +0100
@@ -31,6 +31,7 @@
 #include "gc/z/zMessagePort.inline.hpp"
 #include "gc/z/zServiceability.hpp"
 #include "gc/z/zStat.hpp"
+#include "gc/z/zVerify.hpp"
 #include "logging/log.hpp"
 #include "memory/universe.hpp"
 #include "runtime/vmOperations.hpp"
@@ -86,6 +87,9 @@
     GCIdMark gc_id_mark(_gc_id);
     IsGCActiveMark gc_active_mark;
 
+    // Verify before operation
+    ZVerify::before_zoperation();
+
     // Execute operation
     _success = do_operation();
 
@@ -207,6 +211,17 @@
   }
 };
 
+class VM_ZVerify : public VM_Operation {
+public:
+  virtual VMOp_Type type() const {
+    return VMOp_ZVerify;
+  }
+
+  virtual void doit() {
+    ZVerify::after_weak_processing();
+  }
+};
+
 ZDriver::ZDriver() :
     _gc_cycle_port(),
     _gc_locker_port() {
@@ -301,8 +316,13 @@
 
 void ZDriver::pause_verify() {
   if (VerifyBeforeGC || VerifyDuringGC || VerifyAfterGC) {
+    // Full verification
     VM_Verify op;
     VMThread::execute(&op);
+  } else if (ZVerifyRoots || ZVerifyObjects) {
+    // Limited verification
+    VM_ZVerify op;
+    VMThread::execute(&op);
   }
 }