< prev index next >

src/share/vm/runtime/safepoint.cpp

Print this page

        

@@ -54,10 +54,11 @@
 #include "runtime/thread.inline.hpp"
 #include "services/runtimeService.hpp"
 #include "utilities/events.hpp"
 #include "utilities/macros.hpp"
 #if INCLUDE_ALL_GCS
+#include "gc/shenandoah/shenandoahConcurrentThread.hpp"
 #include "gc/cms/concurrentMarkSweepThread.hpp"
 #include "gc/g1/suspendibleThreadSet.hpp"
 #endif // INCLUDE_ALL_GCS
 #ifdef COMPILER1
 #include "c1/c1_globals.hpp"

@@ -93,11 +94,14 @@
     // In the future we should investigate whether CMS can use the
     // more-general mechanism below.  DLD (01/05).
     ConcurrentMarkSweepThread::synchronize(false);
   } else if (UseG1GC) {
     SuspendibleThreadSet::synchronize();
+  } else if (UseShenandoahGC) {
+    ShenandoahConcurrentThread::safepoint_synchronize();
   }
+
 #endif // INCLUDE_ALL_GCS
 
   // By getting the Threads_lock, we assure that no threads are about to start or
   // exit. It is released again in SafepointSynchronize::end().
   Threads_lock->lock();

@@ -467,10 +471,12 @@
   // If there are any concurrent GC threads resume them.
   if (UseConcMarkSweepGC) {
     ConcurrentMarkSweepThread::desynchronize(false);
   } else if (UseG1GC) {
     SuspendibleThreadSet::desynchronize();
+  } else if (UseShenandoahGC) {
+    ShenandoahConcurrentThread::safepoint_desynchronize();
   }
 #endif // INCLUDE_ALL_GCS
   // record this time so VMThread can keep track how much time has elapsed
   // since last safepoint.
   _end_of_last_safepoint = os::javaTimeMillis();

@@ -966,10 +972,13 @@
     if (return_oop) {
       // The oop result has been saved on the stack together with all
       // the other registers. In order to preserve it over GCs we need
       // to keep it in a handle.
       oop result = caller_fr.saved_oop_result(&map);
+      if (ShenandoahVerifyReadsToFromSpace) {
+        result = oopDesc::bs()->read_barrier(result);
+      }
       assert(result == NULL || result->is_oop(), "must be oop");
       return_value = Handle(thread(), result);
       assert(Universe::heap()->is_in_or_null(result), "must be heap pointer");
     }
 
< prev index next >