< prev index next >
src/share/vm/prims/jni.cpp
Print this page
rev 12906 : [mq]: gc_interface
*** 48,66 ****
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayKlass.hpp"
! #include "oops/typeArrayOop.hpp"
#include "prims/jni.h"
#include "prims/jniCheck.hpp"
#include "prims/jniExport.hpp"
#include "prims/jniFastGetField.hpp"
#include "prims/jvm.h"
#include "prims/jvm_misc.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/atomic.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/fieldDescriptor.hpp"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
--- 48,67 ----
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayKlass.hpp"
! #include "oops/typeArrayOop.inline.hpp"
#include "prims/jni.h"
#include "prims/jniCheck.hpp"
#include "prims/jniExport.hpp"
#include "prims/jniFastGetField.hpp"
#include "prims/jvm.h"
#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"
#include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp"
*** 82,94 ****
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
#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"
#endif
--- 83,92 ----
*** 2056,2087 ****
// Keep JVMTI addition small and only check enabled flag here.
// jni_GetField_probe() assumes that is okay to create handles.
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);
return ret;
JNI_END
--- 2054,2066 ----
// Keep JVMTI addition small and only check enabled flag here.
// jni_GetField_probe() assumes that is okay to create handles.
if (JvmtiExport::should_post_field_access()) {
o = JvmtiExport::jni_GetField_probe(thread, obj, o, k, fieldID, false);
}
! oop loaded_obj = HeapAccess<ACCESS_ON_ANONYMOUS>::oop_load_at(o, offset);
! jobject ret = JNIHandles::make_local(env, loaded_obj);
! HOTSPOT_JNI_GETOBJECTFIELD_RETURN(ret);
return ret;
JNI_END
< prev index next >