src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp
changeset 50803 45c1fde86050
parent 50728 9375184cec98
child 53244 9807daeb47c4
--- a/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp	Tue Jun 26 13:50:59 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp	Tue Jun 26 16:59:38 2018 -0400
@@ -98,12 +98,10 @@
 template <typename T>
 inline void G1BarrierSet::AccessBarrier<decorators, BarrierSetT>::
 oop_store_not_in_heap(T* addr, oop new_value) {
-  if (HasDecorator<decorators, IN_CONCURRENT_ROOT>::value) {
-    // For roots not scanned in a safepoint, we have to apply SATB barriers
-    // even for roots.
-    G1BarrierSet *bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
-    bs->write_ref_field_pre<decorators>(addr);
-  }
+  // Apply SATB barriers for all non-heap references, to allow
+  // concurrent scanning of such references.
+  G1BarrierSet *bs = barrier_set_cast<G1BarrierSet>(BarrierSet::barrier_set());
+  bs->write_ref_field_pre<decorators>(addr);
   Raw::oop_store(addr, new_value);
 }