changeset 60669:8da313a83858

8241700: Shenandoah: Fold ShenandoahKeepAliveBarrier flag into ShenandoahSATBBarrier Reviewed-by: shade
author rkennke
date Fri, 27 Mar 2020 12:47:36 +0100
parents 01a199887650
children a51f18f9b776
files src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp src/hotspot/share/gc/shenandoah/shenandoahNormalMode.cpp src/hotspot/share/gc/shenandoah/shenandoahPassiveMode.cpp src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.cpp src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java
diffstat 14 files changed, 5 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -220,8 +220,8 @@
     BarrierSetC1::load_at_resolved(access, result);
   }
 
-  // 3: apply keep-alive barrier if ShenandoahKeepAliveBarrier is set
-  if (ShenandoahKeepAliveBarrier) {
+  // 3: apply keep-alive barrier if ShenandoahSATBBarrier is set
+  if (ShenandoahSATBBarrier) {
     bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
     bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
     bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -47,7 +47,6 @@
   // Final configuration checks
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);
-  SHENANDOAH_CHECK_FLAG_SET(ShenandoahKeepAliveBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
 }
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -45,7 +45,6 @@
   // Final configuration checks
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);
-  SHENANDOAH_CHECK_FLAG_SET(ShenandoahKeepAliveBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
 }
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -38,7 +38,6 @@
   // Final configuration checks
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);
-  SHENANDOAH_CHECK_FLAG_SET(ShenandoahKeepAliveBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
 }
--- a/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -45,7 +45,6 @@
 
   FLAG_SET_DEFAULT(ShenandoahSATBBarrier,            false);
   FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier,         false);
-  FLAG_SET_DEFAULT(ShenandoahKeepAliveBarrier,       false);
   FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, false);
   FLAG_SET_DEFAULT(ShenandoahCASBarrier,             false);
   FLAG_SET_DEFAULT(ShenandoahCloneBarrier,           false);
@@ -132,7 +131,6 @@
   if (ShenandoahVerifyOptoBarriers &&
           (!FLAG_IS_DEFAULT(ShenandoahSATBBarrier)            ||
            !FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier)         ||
-           !FLAG_IS_DEFAULT(ShenandoahKeepAliveBarrier)       ||
            !FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier) ||
            !FLAG_IS_DEFAULT(ShenandoahCASBarrier)             ||
            !FLAG_IS_DEFAULT(ShenandoahCloneBarrier)
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -100,7 +100,7 @@
 }
 
 bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,BasicType type) {
-  if (!ShenandoahKeepAliveBarrier) return false;
+  if (!ShenandoahSATBBarrier) return false;
   // Only needed for references
   if (!is_reference_type(type)) return false;
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Fri Mar 27 12:47:36 2020 +0100
@@ -95,7 +95,6 @@
   template <DecoratorSet decorators>
   inline void keep_alive_if_weak(oop value);
   inline void keep_alive_if_weak(DecoratorSet decorators, oop value);
-  inline void keep_alive_barrier(oop value);
 
   inline void enqueue(oop obj);
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Fri Mar 27 12:47:36 2020 +0100
@@ -92,19 +92,12 @@
   }
 }
 
-inline void ShenandoahBarrierSet::keep_alive_barrier(oop value) {
-  assert(value != NULL, "checked before");
-  if (ShenandoahKeepAliveBarrier && _heap->is_concurrent_mark_in_progress()) {
-    enqueue(value);
-  }
-}
-
 inline void ShenandoahBarrierSet::keep_alive_if_weak(DecoratorSet decorators, oop value) {
   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
   const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0;
   const bool peek              = (decorators & AS_NO_KEEPALIVE) != 0;
   if (!peek && !on_strong_oop_ref) {
-    keep_alive_barrier(value);
+    satb_enqueue(value);
   }
 }
 
@@ -113,7 +106,7 @@
   assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
   if (!HasDecorator<decorators, ON_STRONG_OOP_REF>::value &&
       !HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
-    keep_alive_barrier(value);
+    satb_enqueue(value);
   }
 }
 
--- a/src/hotspot/share/gc/shenandoah/shenandoahNormalMode.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoahNormalMode.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -44,7 +44,6 @@
   // Final configuration checks
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);
-  SHENANDOAH_CHECK_FLAG_SET(ShenandoahKeepAliveBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
 }
--- a/src/hotspot/share/gc/shenandoah/shenandoahPassiveMode.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPassiveMode.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -44,7 +44,6 @@
   // Disable known barriers by default.
   SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahLoadRefBarrier);
   SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahSATBBarrier);
-  SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahKeepAliveBarrier);
   SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahStoreValEnqueueBarrier);
   SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCASBarrier);
   SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCloneBarrier);
--- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.cpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalMode.cpp	Fri Mar 27 12:47:36 2020 +0100
@@ -32,7 +32,6 @@
 void ShenandoahTraversalMode::initialize_flags() const {
   FLAG_SET_DEFAULT(ShenandoahSATBBarrier,            false);
   FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, true);
-  FLAG_SET_DEFAULT(ShenandoahKeepAliveBarrier,       false);
   FLAG_SET_DEFAULT(ShenandoahAllowMixedAllocs,       false);
 
   SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent);
--- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp	Fri Mar 27 13:42:57 2020 +0300
+++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp	Fri Mar 27 12:47:36 2020 +0100
@@ -339,9 +339,6 @@
   diagnostic(bool, ShenandoahSATBBarrier, true,                             \
           "Turn on/off SATB barriers in Shenandoah")                        \
                                                                             \
-  diagnostic(bool, ShenandoahKeepAliveBarrier, true,                        \
-          "Turn on/off keep alive barriers in Shenandoah")                  \
-                                                                            \
   diagnostic(bool, ShenandoahStoreValEnqueueBarrier, false,                 \
           "Turn on/off enqueuing of oops for storeval barriers")            \
                                                                             \
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java	Fri Mar 27 13:42:57 2020 +0300
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestSelectiveBarrierFlags.java	Fri Mar 27 12:47:36 2020 +0100
@@ -43,7 +43,6 @@
 
     public static void main(String[] args) throws Exception {
         String[][] opts = {
-                new String[] { "ShenandoahKeepAliveBarrier" },
                 new String[] { "ShenandoahLoadRefBarrier" },
                 new String[] { "ShenandoahSATBBarrier", "ShenandoahStoreValEnqueueBarrier" },
                 new String[] { "ShenandoahCASBarrier" },
--- a/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java	Fri Mar 27 13:42:57 2020 +0300
+++ b/test/hotspot/jtreg/gc/shenandoah/options/TestWrongBarrierDisable.java	Fri Mar 27 12:47:36 2020 +0100
@@ -43,7 +43,6 @@
                 "ShenandoahCASBarrier",
                 "ShenandoahCloneBarrier",
                 "ShenandoahSATBBarrier",
-                "ShenandoahKeepAliveBarrier",
         };
 
         String[] traversal = {