--- old/src/share/vm/opto/runtime.cpp 2015-10-14 13:54:29.126528989 +0200 +++ new/src/share/vm/opto/runtime.cpp 2015-10-14 13:54:29.023531480 +0200 @@ -34,6 +34,7 @@ #include "code/vtableStubs.hpp" #include "compiler/compileBroker.hpp" #include "compiler/oopMap.hpp" +#include "gc/shenandoah/shenandoahBarrierSet.hpp" #include "gc/g1/g1SATBCardTableModRefBS.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/shared/barrierSet.hpp" @@ -420,7 +421,7 @@ ResourceMark rm; jint len = dims->length(); assert(len > 0, "Dimensions array should contain data"); - jint *j_dims = typeArrayOop(dims)->int_at_addr(0); + jint *j_dims = typeArrayOop(oopDesc::bs()->read_barrier(dims))->int_at_addr(0); jint *c_dims = NEW_RESOURCE_ARRAY(jint, len); Copy::conjoint_jints_atomic(j_dims, c_dims, len); @@ -435,6 +436,7 @@ // the dominant fast-path is to simply return. // Relatedly, it's critical that notify/notifyAll be fast in order to // reduce lock hold times. + obj = oopDesc::bs()->write_barrier(obj); if (!SafepointSynchronize::is_synchronizing()) { if (ObjectSynchronizer::quick_notify(obj, thread, false)) { return; @@ -453,6 +455,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notifyAll_C(oopDesc* obj, JavaThread *thread)) + obj = oopDesc::bs()->write_barrier(obj); if (!SafepointSynchronize::is_synchronizing() ) { if (ObjectSynchronizer::quick_notify(obj, thread, true)) { return; @@ -590,6 +593,33 @@ return TypeFunc::make(domain, range); } + +const TypeFunc *OptoRuntime::shenandoah_clone_barrier_Type() { + const Type **fields = TypeTuple::fields(1); + fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // original field value + const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields); + + // create result type (range) + fields = TypeTuple::fields(0); + const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields); + + return TypeFunc::make(domain, range); +} + +const TypeFunc *OptoRuntime::shenandoah_cas_obj_Type() { + const Type **fields = TypeTuple::fields(3); + fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // Address + fields[TypeFunc::Parms+1] = TypeInstPtr::BOTTOM; // New value + fields[TypeFunc::Parms+2] = TypeInstPtr::BOTTOM; // Expected value + const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+3, fields); + + // create result type (range) + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms+0] = TypeInt::BOOL; + const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields); + + return TypeFunc::make(domain, range); +} const TypeFunc *OptoRuntime::uncommon_trap_Type() { // create input type (domain)