< prev index next >

src/share/vm/prims/jvm.cpp

Print this page

        

@@ -71,10 +71,11 @@
 #include "utilities/copy.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"
+#include "utilities/macros.hpp"
 #include "utilities/top.hpp"
 #include "utilities/utf8.hpp"
 #ifdef TARGET_OS_FAMILY_linux
 # include "jvm_linux.h"
 #endif

@@ -91,10 +92,11 @@
 # include "jvm_bsd.h"
 #endif
 
 #if INCLUDE_ALL_GCS
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc_implementation/shenandoah/shenandoahBarrierSetClone.inline.hpp"
 #endif // INCLUDE_ALL_GCS
 
 #include <errno.h>
 
 #ifndef USDT2

@@ -606,11 +608,11 @@
 
 static void fixup_cloned_reference(ReferenceType ref_type, oop src, oop clone) {
   // If G1 is enabled then we need to register a non-null referent
   // with the SATB barrier.
 #if INCLUDE_ALL_GCS
-  if (UseG1GC) {
+  if (UseG1GC || (UseShenandoahGC && ShenandoahSATBBarrier)) {
     oop referent = java_lang_ref_Reference::referent(clone);
     if (referent != NULL) {
       G1SATBCardTableModRefBS::enqueue(referent);
     }
   }

@@ -663,10 +665,16 @@
            !klass->is_subclass_of(SystemDictionary::Reference_klass()),
            "invariant");
     new_obj_oop = CollectedHeap::obj_allocate(klass, size, CHECK_NULL);
   }
 
+#if INCLUDE_ALL_GCS
+  if (UseShenandoahGC && ShenandoahCloneBarrier) {
+    ShenandoahBarrierSet::barrier_set()->clone_barrier_runtime(obj());
+  }
+#endif
+
   // 4839641 (4840070): We must do an oop-atomic copy, because if another thread
   // is modifying a reference field in the clonee, a non-oop-atomic copy might
   // be suspended in the middle of copying the pointer and end up with parts
   // of two different pointers in the field.  Subsequent dereferences will crash.
   // 4846409: an oop-copy of objects with long or double fields or arrays of same

@@ -1169,11 +1177,10 @@
   }
 
   return (jclass) JNIHandles::make_local(env, k->java_mirror());
 }
 
-
 JVM_ENTRY(jclass, JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd))
   JVMWrapper2("JVM_DefineClass %s", name);
 
   return jvm_define_class_common(env, name, loader, buf, len, pd, NULL, true, THREAD);
 JVM_END

@@ -1584,11 +1591,11 @@
       protection_domain  = thread->privileged_stack_top()->protection_domain();
     } else {
       protection_domain = method->method_holder()->protection_domain();
     }
 
-    if ((previous_protection_domain != protection_domain) && (protection_domain != NULL)) {
+    if ((previous_protection_domain != protection_domain) && protection_domain != NULL) {
       local_array->push(protection_domain);
       previous_protection_domain = protection_domain;
     }
 
     if (is_privileged) break;
< prev index next >