< prev index next >

src/share/vm/prims/unsafe.cpp

Print this page
rev 14282 : Factor out keep-alive barrier from usual pre-barrier implementations.

@@ -43,13 +43,10 @@
 #include "trace/tracing.hpp"
 #include "utilities/align.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/dtrace.hpp"
 #include "utilities/macros.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc/g1/g1SATBCardTableModRefBS.hpp"
-#endif // INCLUDE_ALL_GCS
 
 /**
  * Implementation of the jdk.internal.misc.Unsafe class
  */
 

@@ -295,12 +292,12 @@
 }
 #endif
 
 static void ensure_satb_referent_alive(oop o, jlong offset, oop v) {
 #if INCLUDE_ALL_GCS
-  if ((UseG1GC || (UseShenandoahGC && ShenandoahSATBBarrier)) && v != NULL && is_java_lang_ref_Reference_access(o, offset)) {
-    G1SATBCardTableModRefBS::enqueue(v);
+  if (v != NULL && is_java_lang_ref_Reference_access(o, offset)) {
+    oopDesc::bs()->keep_alive_barrier(v);
   }
 #endif
 }
 
 // These functions allow a null base pointer with an arbitrary address.
< prev index next >