< prev index next >

src/share/vm/classfile/javaClasses.cpp

Print this page

        

@@ -50,10 +50,14 @@
 #include "runtime/safepoint.hpp"
 #include "runtime/thread.inline.hpp"
 #include "runtime/vframe.hpp"
 #include "utilities/preserveException.hpp"
 
+#if INCLUDE_ALL_GCS
+#include "gc_implementation/shenandoah/shenandoahBarrierSet.hpp"
+#endif
+
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
 
 #define INJECTED_FIELD_COMPUTE_OFFSET(klass, name, signature, may_be_java)    \
   klass::_##name##_offset = JavaClasses::compute_injected_offset(JavaClasses::klass##_##name##_enum);
 

@@ -1205,15 +1209,22 @@
 }
 
 oop java_lang_Throwable::unassigned_stacktrace() {
   InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Throwable_klass());
   address addr = ik->static_field_addr(static_unassigned_stacktrace_offset);
+  oop result;
   if (UseCompressedOops) {
-    return oopDesc::load_decode_heap_oop((narrowOop *)addr);
+    result = oopDesc::load_decode_heap_oop((narrowOop *)addr);
   } else {
-    return oopDesc::load_decode_heap_oop((oop*)addr);
+    result = oopDesc::load_decode_heap_oop((oop*)addr);
+  }
+#if INCLUDE_ALL_GCS
+  if (UseShenandoahGC) {
+    result = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(result);
   }
+#endif
+  return result;
 }
 
 oop java_lang_Throwable::backtrace(oop throwable) {
   return throwable->obj_field_acquire(backtrace_offset);
 }

@@ -2635,15 +2646,22 @@
 }
 
 oop java_lang_ref_Reference::pending_list_lock() {
   InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Reference_klass());
   address addr = ik->static_field_addr(static_lock_offset);
+  oop result;
   if (UseCompressedOops) {
-    return oopDesc::load_decode_heap_oop((narrowOop *)addr);
+    result = oopDesc::load_decode_heap_oop((narrowOop *)addr);
   } else {
-    return oopDesc::load_decode_heap_oop((oop*)addr);
+    result = oopDesc::load_decode_heap_oop((oop*)addr);
+  }
+#if INCLUDE_ALL_GCS
+  if (UseShenandoahGC) {
+    result = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(result);
   }
+#endif
+  return result;
 }
 
 HeapWord *java_lang_ref_Reference::pending_list_addr() {
   InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Reference_klass());
   address addr = ik->static_field_addr(static_pending_offset);

@@ -2651,15 +2669,22 @@
   return (HeapWord*)addr;
 }
 
 oop java_lang_ref_Reference::pending_list() {
   char *addr = (char *)pending_list_addr();
+  oop result;
   if (UseCompressedOops) {
-    return oopDesc::load_decode_heap_oop((narrowOop *)addr);
+    result = oopDesc::load_decode_heap_oop((narrowOop *)addr);
   } else {
-    return oopDesc::load_decode_heap_oop((oop*)addr);
+    result = oopDesc::load_decode_heap_oop((oop*)addr);
+  }
+#if INCLUDE_ALL_GCS
+  if (UseShenandoahGC) {
+    result = ShenandoahBarrierSet::barrier_set()->load_reference_barrier(result);
   }
+#endif
+  return result;
 }
 
 
 // Support for java_lang_ref_SoftReference
 
< prev index next >