Skip to content
Permalink
Browse files

8241700: Shenandoah: Fold ShenandoahKeepAliveBarrier flag into Shenan…

…doahSATBBarrier

Reviewed-by: shade
  • Loading branch information
rkennke committed Mar 27, 2020
1 parent 2df1826 commit bb7a8f643f8323e79f90a761de0a8fbd3f418abd
@@ -220,8 +220,8 @@ void ShenandoahBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result)
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;
@@ -47,7 +47,6 @@ ShenandoahAggressiveHeuristics::ShenandoahAggressiveHeuristics() : ShenandoahHeu
// 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);
}
@@ -45,7 +45,6 @@ ShenandoahCompactHeuristics::ShenandoahCompactHeuristics() : ShenandoahHeuristic
// 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);
}
@@ -38,7 +38,6 @@ ShenandoahStaticHeuristics::ShenandoahStaticHeuristics() : ShenandoahHeuristics(
// 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);
}
@@ -45,7 +45,6 @@ void ShenandoahArguments::initialize() {

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 @@ void ShenandoahArguments::initialize() {
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)
@@ -100,7 +100,7 @@ bool ShenandoahBarrierSet::use_load_reference_barrier_native(DecoratorSet decora
}

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;

@@ -95,7 +95,6 @@ class ShenandoahBarrierSet: public BarrierSet {
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);

@@ -92,19 +92,12 @@ inline void ShenandoahBarrierSet::storeval_barrier(oop obj) {
}
}

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 @@ inline void ShenandoahBarrierSet::keep_alive_if_weak(oop value) {
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);
}
}

@@ -44,7 +44,6 @@ void ShenandoahNormalMode::initialize_flags() const {
// 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);
}
@@ -44,7 +44,6 @@ void ShenandoahPassiveMode::initialize_flags() const {
// 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);
@@ -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);
@@ -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") \
\
@@ -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" },
@@ -43,7 +43,6 @@ public static void main(String[] args) throws Exception {
"ShenandoahCASBarrier",
"ShenandoahCloneBarrier",
"ShenandoahSATBBarrier",
"ShenandoahKeepAliveBarrier",
};

String[] traversal = {

0 comments on commit bb7a8f6

Please sign in to comment.