src/hotspot/share/gc/z/zBarrier.cpp
changeset 58066 8407928b9fe5
parent 54488 25199b48f34f
--- a/src/hotspot/share/gc/z/zBarrier.cpp	Mon Sep 09 16:34:45 2019 +0200
+++ b/src/hotspot/share/gc/z/zBarrier.cpp	Tue Sep 10 11:11:31 2019 +0200
@@ -72,7 +72,7 @@
   return true;
 }
 
-template <bool finalizable, bool publish>
+template <bool follow, bool finalizable, bool publish>
 uintptr_t ZBarrier::mark(uintptr_t addr) {
   uintptr_t good_addr;
 
@@ -89,7 +89,7 @@
 
   // Mark
   if (should_mark_through<finalizable>(addr)) {
-    ZHeap::heap()->mark_object<finalizable, publish>(good_addr);
+    ZHeap::heap()->mark_object<follow, finalizable, publish>(good_addr);
   }
 
   return good_addr;
@@ -108,7 +108,7 @@
 }
 
 uintptr_t ZBarrier::relocate_or_mark(uintptr_t addr) {
-  return during_relocate() ? relocate(addr) : mark<Strong, Publish>(addr);
+  return during_relocate() ? relocate(addr) : mark<Follow, Strong, Publish>(addr);
 }
 
 uintptr_t ZBarrier::relocate_or_remap(uintptr_t addr) {
@@ -174,11 +174,11 @@
 // Mark barrier
 //
 uintptr_t ZBarrier::mark_barrier_on_oop_slow_path(uintptr_t addr) {
-  return mark<Strong, Overflow>(addr);
+  return mark<Follow, Strong, Overflow>(addr);
 }
 
 uintptr_t ZBarrier::mark_barrier_on_finalizable_oop_slow_path(uintptr_t addr) {
-  const uintptr_t good_addr = mark<Finalizable, Overflow>(addr);
+  const uintptr_t good_addr = mark<Follow, Finalizable, Overflow>(addr);
   if (ZAddress::is_good(addr)) {
     // If the oop was already strongly marked/good, then we do
     // not want to downgrade it to finalizable marked/good.
@@ -200,7 +200,15 @@
   assert(during_mark(), "Invalid phase");
 
   // Mark
-  return mark<Strong, Publish>(addr);
+  return mark<Follow, Strong, Publish>(addr);
+}
+
+uintptr_t ZBarrier::mark_barrier_on_invisible_root_oop_slow_path(uintptr_t addr) {
+  assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
+  assert(during_mark(), "Invalid phase");
+
+  // Mark
+  return mark<DontFollow, Strong, Publish>(addr);
 }
 
 //