comparison src/share/vm/prims/jni.cpp @ 3464:be4ca325525a

Merge.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Jul 2011 17:32:44 -0700
parents b78b4ae0757c e1162778c1c8
children 85625aff715b
comparison
equal deleted inserted replaced
3239:7c4b4daac19b 3464:be4ca325525a
28 #include "classfile/symbolTable.hpp" 28 #include "classfile/symbolTable.hpp"
29 #include "classfile/systemDictionary.hpp" 29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp" 30 #include "classfile/vmSymbols.hpp"
31 #include "interpreter/linkResolver.hpp" 31 #include "interpreter/linkResolver.hpp"
32 #include "graal/graalCompiler.hpp" 32 #include "graal/graalCompiler.hpp"
33 #ifndef SERIALGC
34 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
35 #endif // SERIALGC
33 #include "memory/allocation.inline.hpp" 36 #include "memory/allocation.inline.hpp"
34 #include "memory/gcLocker.inline.hpp" 37 #include "memory/gcLocker.inline.hpp"
35 #include "memory/oopFactory.hpp" 38 #include "memory/oopFactory.hpp"
36 #include "memory/universe.inline.hpp" 39 #include "memory/universe.inline.hpp"
37 #include "oops/instanceKlass.hpp" 40 #include "oops/instanceKlass.hpp"
1723 // jni_GetField_probe() assumes that is okay to create handles. 1726 // jni_GetField_probe() assumes that is okay to create handles.
1724 if (JvmtiExport::should_post_field_access()) { 1727 if (JvmtiExport::should_post_field_access()) {
1725 o = JvmtiExport::jni_GetField_probe(thread, obj, o, k, fieldID, false); 1728 o = JvmtiExport::jni_GetField_probe(thread, obj, o, k, fieldID, false);
1726 } 1729 }
1727 jobject ret = JNIHandles::make_local(env, o->obj_field(offset)); 1730 jobject ret = JNIHandles::make_local(env, o->obj_field(offset));
1731 #ifndef SERIALGC
1732 // If G1 is enabled and we are accessing the value of the referent
1733 // field in a reference object then we need to register a non-null
1734 // referent with the SATB barrier.
1735 if (UseG1GC) {
1736 bool needs_barrier = false;
1737
1738 if (ret != NULL &&
1739 offset == java_lang_ref_Reference::referent_offset &&
1740 instanceKlass::cast(k)->reference_type() != REF_NONE) {
1741 assert(instanceKlass::cast(k)->is_subclass_of(SystemDictionary::Reference_klass()), "sanity");
1742 needs_barrier = true;
1743 }
1744
1745 if (needs_barrier) {
1746 oop referent = JNIHandles::resolve(ret);
1747 G1SATBCardTableModRefBS::enqueue(referent);
1748 }
1749 }
1750 #endif // SERIALGC
1728 DTRACE_PROBE1(hotspot_jni, GetObjectField__return, ret); 1751 DTRACE_PROBE1(hotspot_jni, GetObjectField__return, ret);
1729 return ret; 1752 return ret;
1730 JNI_END 1753 JNI_END
1731 1754
1732 1755