--- old/src/share/vm/runtime/safepoint.cpp 2015-10-08 22:16:04.052912678 +0200 +++ new/src/share/vm/runtime/safepoint.cpp 2015-10-08 22:16:04.002913872 +0200 @@ -56,6 +56,7 @@ #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 @@ -95,7 +96,10 @@ 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 @@ -469,6 +473,8 @@ 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 @@ -968,6 +974,9 @@ // 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");