--- old/src/share/vm/prims/jni.cpp 2017-04-25 16:45:40.743172903 +0200 +++ new/src/share/vm/prims/jni.cpp 2017-04-25 16:45:40.595172908 +0200 @@ -50,7 +50,7 @@ #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "oops/typeArrayKlass.hpp" -#include "oops/typeArrayOop.hpp" +#include "oops/typeArrayOop.inline.hpp" #include "prims/jni.h" #include "prims/jniCheck.hpp" #include "prims/jniExport.hpp" @@ -59,6 +59,7 @@ #include "prims/jvm_misc.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiThreadState.hpp" +#include "runtime/access.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/fieldDescriptor.hpp" @@ -84,9 +85,6 @@ #include "utilities/histogram.hpp" #include "utilities/internalVMTests.hpp" #include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc/g1/g1SATBCardTableModRefBS.hpp" -#endif // INCLUDE_ALL_GCS #if INCLUDE_JVMCI #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciRuntime.hpp" @@ -2058,28 +2056,9 @@ if (JvmtiExport::should_post_field_access()) { o = JvmtiExport::jni_GetField_probe(thread, obj, o, k, fieldID, false); } - jobject ret = JNIHandles::make_local(env, o->obj_field(offset)); -#if INCLUDE_ALL_GCS - // If G1 is enabled and we are accessing the value of the referent - // field in a reference object then we need to register a non-null - // referent with the SATB barrier. - if (UseG1GC) { - bool needs_barrier = false; - - if (ret != NULL && - offset == java_lang_ref_Reference::referent_offset && - InstanceKlass::cast(k)->reference_type() != REF_NONE) { - assert(InstanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity"); - needs_barrier = true; - } - - if (needs_barrier) { - oop referent = JNIHandles::resolve(ret); - G1SATBCardTableModRefBS::enqueue(referent); - } - } -#endif // INCLUDE_ALL_GCS -HOTSPOT_JNI_GETOBJECTFIELD_RETURN(ret); + oop loaded_obj = HeapAccess::oop_load_at(o, offset); + jobject ret = JNIHandles::make_local(env, loaded_obj); + HOTSPOT_JNI_GETOBJECTFIELD_RETURN(ret); return ret; JNI_END