mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8259849: Shenandoah: Rename store-val to IU-barrier
Reviewed-by: zgu, shade
This commit is contained in:
parent
db9c114d40
commit
e60c992699
26 changed files with 126 additions and 131 deletions
|
@ -40,7 +40,7 @@ void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
|
||||||
Register tmp2 = _tmp2->as_register();
|
Register tmp2 = _tmp2->as_register();
|
||||||
Register result = result_opr()->as_register();
|
Register result = result_opr()->as_register();
|
||||||
|
|
||||||
ShenandoahBarrierSet::assembler()->storeval_barrier(masm->masm(), newval, rscratch2);
|
ShenandoahBarrierSet::assembler()->iu_barrier(masm->masm(), newval, rscratch2);
|
||||||
|
|
||||||
if (UseCompressedOops) {
|
if (UseCompressedOops) {
|
||||||
__ encode_heap_oop(tmp1, cmpval);
|
__ encode_heap_oop(tmp1, cmpval);
|
||||||
|
@ -102,7 +102,7 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt
|
||||||
LIR_Opr value_opr = value.result();
|
LIR_Opr value_opr = value.result();
|
||||||
|
|
||||||
if (access.is_oop()) {
|
if (access.is_oop()) {
|
||||||
value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
|
value_opr = iu_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
|
assert(type == T_INT || is_reference_type(type) LP64_ONLY( || type == T_LONG ), "unexpected type");
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -47,7 +47,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
|
||||||
Register src, Register dst, Register count, RegSet saved_regs) {
|
Register src, Register dst, Register count, RegSet saved_regs) {
|
||||||
if (is_oop) {
|
if (is_oop) {
|
||||||
bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0;
|
bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0;
|
||||||
if ((ShenandoahSATBBarrier && !dest_uninitialized) || ShenandoahStoreValEnqueueBarrier || ShenandoahLoadRefBarrier) {
|
if ((ShenandoahSATBBarrier && !dest_uninitialized) || ShenandoahIUBarrier || ShenandoahLoadRefBarrier) {
|
||||||
|
|
||||||
Label done;
|
Label done;
|
||||||
|
|
||||||
|
@ -297,8 +297,8 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
|
||||||
__ leave();
|
__ leave();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahBarrierSetAssembler::storeval_barrier(MacroAssembler* masm, Register dst, Register tmp) {
|
void ShenandoahBarrierSetAssembler::iu_barrier(MacroAssembler* masm, Register dst, Register tmp) {
|
||||||
if (ShenandoahStoreValEnqueueBarrier) {
|
if (ShenandoahIUBarrier) {
|
||||||
__ push_call_clobbered_registers();
|
__ push_call_clobbered_registers();
|
||||||
satb_write_barrier_pre(masm, noreg, dst, rthread, tmp, true, false);
|
satb_write_barrier_pre(masm, noreg, dst, rthread, tmp, true, false);
|
||||||
__ pop_call_clobbered_registers();
|
__ pop_call_clobbered_registers();
|
||||||
|
@ -394,7 +394,7 @@ void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet
|
||||||
if (val == noreg) {
|
if (val == noreg) {
|
||||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(r3, 0), noreg, noreg, noreg);
|
BarrierSetAssembler::store_at(masm, decorators, type, Address(r3, 0), noreg, noreg, noreg);
|
||||||
} else {
|
} else {
|
||||||
storeval_barrier(masm, val, tmp1);
|
iu_barrier(masm, val, tmp1);
|
||||||
// G1 barrier needs uncompressed oop for region cross check.
|
// G1 barrier needs uncompressed oop for region cross check.
|
||||||
Register new_val = val;
|
Register new_val = val;
|
||||||
if (UseCompressedOops) {
|
if (UseCompressedOops) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -60,7 +60,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void storeval_barrier(MacroAssembler* masm, Register dst, Register tmp);
|
void iu_barrier(MacroAssembler* masm, Register dst, Register tmp);
|
||||||
|
|
||||||
#ifdef COMPILER1
|
#ifdef COMPILER1
|
||||||
void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);
|
void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -46,8 +46,8 @@ void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
|
||||||
assert(cmpval != addr, "cmp and addr must be in different registers");
|
assert(cmpval != addr, "cmp and addr must be in different registers");
|
||||||
assert(newval != addr, "new value and addr must be in different registers");
|
assert(newval != addr, "new value and addr must be in different registers");
|
||||||
|
|
||||||
// Apply storeval barrier to newval.
|
// Apply IU barrier to newval.
|
||||||
ShenandoahBarrierSet::assembler()->storeval_barrier(masm->masm(), newval, tmp1);
|
ShenandoahBarrierSet::assembler()->iu_barrier(masm->masm(), newval, tmp1);
|
||||||
|
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
if (UseCompressedOops) {
|
if (UseCompressedOops) {
|
||||||
|
@ -102,7 +102,7 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt
|
||||||
LIR_Opr value_opr = value.result();
|
LIR_Opr value_opr = value.result();
|
||||||
|
|
||||||
if (access.is_oop()) {
|
if (access.is_oop()) {
|
||||||
value_opr = storeval_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
|
value_opr = iu_barrier(access.gen(), value_opr, access.access_emit_info(), access.decorators());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Because we want a 2-arg form of xchg and xadd
|
// Because we want a 2-arg form of xchg and xadd
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -74,7 +74,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
|
||||||
|
|
||||||
if (is_reference_type(type)) {
|
if (is_reference_type(type)) {
|
||||||
|
|
||||||
if ((ShenandoahSATBBarrier && !dest_uninitialized) || ShenandoahStoreValEnqueueBarrier || ShenandoahLoadRefBarrier) {
|
if ((ShenandoahSATBBarrier && !dest_uninitialized) || ShenandoahIUBarrier || ShenandoahLoadRefBarrier) {
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
Register thread = r15_thread;
|
Register thread = r15_thread;
|
||||||
#else
|
#else
|
||||||
|
@ -417,18 +417,18 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahBarrierSetAssembler::storeval_barrier(MacroAssembler* masm, Register dst, Register tmp) {
|
void ShenandoahBarrierSetAssembler::iu_barrier(MacroAssembler* masm, Register dst, Register tmp) {
|
||||||
if (ShenandoahStoreValEnqueueBarrier) {
|
if (ShenandoahIUBarrier) {
|
||||||
storeval_barrier_impl(masm, dst, tmp);
|
iu_barrier_impl(masm, dst, tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahBarrierSetAssembler::storeval_barrier_impl(MacroAssembler* masm, Register dst, Register tmp) {
|
void ShenandoahBarrierSetAssembler::iu_barrier_impl(MacroAssembler* masm, Register dst, Register tmp) {
|
||||||
assert(ShenandoahStoreValEnqueueBarrier, "should be enabled");
|
assert(ShenandoahIUBarrier, "should be enabled");
|
||||||
|
|
||||||
if (dst == noreg) return;
|
if (dst == noreg) return;
|
||||||
|
|
||||||
if (ShenandoahStoreValEnqueueBarrier) {
|
if (ShenandoahIUBarrier) {
|
||||||
// The set of registers to be saved+restored is the same as in the write-barrier above.
|
// The set of registers to be saved+restored is the same as in the write-barrier above.
|
||||||
// Those are the commonly used registers in the interpreter.
|
// Those are the commonly used registers in the interpreter.
|
||||||
__ pusha();
|
__ pusha();
|
||||||
|
@ -586,7 +586,7 @@ void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet
|
||||||
if (val == noreg) {
|
if (val == noreg) {
|
||||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp1, 0), val, noreg, noreg);
|
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp1, 0), val, noreg, noreg);
|
||||||
} else {
|
} else {
|
||||||
storeval_barrier(masm, val, tmp3);
|
iu_barrier(masm, val, tmp3);
|
||||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp1, 0), val, noreg, noreg);
|
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp1, 0), val, noreg, noreg);
|
||||||
}
|
}
|
||||||
NOT_LP64(imasm->restore_bcp());
|
NOT_LP64(imasm->restore_bcp());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -56,10 +56,10 @@ private:
|
||||||
bool tosca_live,
|
bool tosca_live,
|
||||||
bool expand_call);
|
bool expand_call);
|
||||||
|
|
||||||
void storeval_barrier_impl(MacroAssembler* masm, Register dst, Register tmp);
|
void iu_barrier_impl(MacroAssembler* masm, Register dst, Register tmp);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void storeval_barrier(MacroAssembler* masm, Register dst, Register tmp);
|
void iu_barrier(MacroAssembler* masm, Register dst, Register tmp);
|
||||||
#ifdef COMPILER1
|
#ifdef COMPILER1
|
||||||
void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);
|
void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);
|
||||||
void gen_load_reference_barrier_stub(LIR_Assembler* ce, ShenandoahLoadReferenceBarrierStub* stub);
|
void gen_load_reference_barrier_stub(LIR_Assembler* ce, ShenandoahLoadReferenceBarrierStub* stub);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -173,8 +173,8 @@ LIR_Opr ShenandoahBarrierSetC1::ensure_in_register(LIRGenerator* gen, LIR_Opr ob
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
LIR_Opr ShenandoahBarrierSetC1::storeval_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators) {
|
LIR_Opr ShenandoahBarrierSetC1::iu_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators) {
|
||||||
if (ShenandoahStoreValEnqueueBarrier) {
|
if (ShenandoahIUBarrier) {
|
||||||
obj = ensure_in_register(gen, obj, T_OBJECT);
|
obj = ensure_in_register(gen, obj, T_OBJECT);
|
||||||
pre_barrier(gen, info, decorators, LIR_OprFact::illegalOpr, obj);
|
pre_barrier(gen, info, decorators, LIR_OprFact::illegalOpr, obj);
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ void ShenandoahBarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value)
|
||||||
if (ShenandoahSATBBarrier) {
|
if (ShenandoahSATBBarrier) {
|
||||||
pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), access.resolved_addr(), LIR_OprFact::illegalOpr /* pre_val */);
|
pre_barrier(access.gen(), access.access_emit_info(), access.decorators(), access.resolved_addr(), LIR_OprFact::illegalOpr /* pre_val */);
|
||||||
}
|
}
|
||||||
value = storeval_barrier(access.gen(), value, access.access_emit_info(), access.decorators());
|
value = iu_barrier(access.gen(), value, access.access_emit_info(), access.decorators());
|
||||||
}
|
}
|
||||||
BarrierSetC1::store_at_resolved(access, value);
|
BarrierSetC1::store_at_resolved(access, value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -198,7 +198,7 @@ private:
|
||||||
void pre_barrier(LIRGenerator* gen, CodeEmitInfo* info, DecoratorSet decorators, LIR_Opr addr_opr, LIR_Opr pre_val);
|
void pre_barrier(LIRGenerator* gen, CodeEmitInfo* info, DecoratorSet decorators, LIR_Opr addr_opr, LIR_Opr pre_val);
|
||||||
|
|
||||||
LIR_Opr load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, DecoratorSet decorators);
|
LIR_Opr load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, DecoratorSet decorators);
|
||||||
LIR_Opr storeval_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators);
|
LIR_Opr iu_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators);
|
||||||
|
|
||||||
LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, DecoratorSet decorators);
|
LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, DecoratorSet decorators);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -48,25 +48,25 @@ ShenandoahBarrierSetC2* ShenandoahBarrierSetC2::bsc2() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ShenandoahBarrierSetC2State::ShenandoahBarrierSetC2State(Arena* comp_arena)
|
ShenandoahBarrierSetC2State::ShenandoahBarrierSetC2State(Arena* comp_arena)
|
||||||
: _enqueue_barriers(new (comp_arena) GrowableArray<ShenandoahEnqueueBarrierNode*>(comp_arena, 8, 0, NULL)),
|
: _iu_barriers(new (comp_arena) GrowableArray<ShenandoahIUBarrierNode*>(comp_arena, 8, 0, NULL)),
|
||||||
_load_reference_barriers(new (comp_arena) GrowableArray<ShenandoahLoadReferenceBarrierNode*>(comp_arena, 8, 0, NULL)) {
|
_load_reference_barriers(new (comp_arena) GrowableArray<ShenandoahLoadReferenceBarrierNode*>(comp_arena, 8, 0, NULL)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int ShenandoahBarrierSetC2State::enqueue_barriers_count() const {
|
int ShenandoahBarrierSetC2State::iu_barriers_count() const {
|
||||||
return _enqueue_barriers->length();
|
return _iu_barriers->length();
|
||||||
}
|
}
|
||||||
|
|
||||||
ShenandoahEnqueueBarrierNode* ShenandoahBarrierSetC2State::enqueue_barrier(int idx) const {
|
ShenandoahIUBarrierNode* ShenandoahBarrierSetC2State::iu_barrier(int idx) const {
|
||||||
return _enqueue_barriers->at(idx);
|
return _iu_barriers->at(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahBarrierSetC2State::add_enqueue_barrier(ShenandoahEnqueueBarrierNode * n) {
|
void ShenandoahBarrierSetC2State::add_iu_barrier(ShenandoahIUBarrierNode* n) {
|
||||||
assert(!_enqueue_barriers->contains(n), "duplicate entry in barrier list");
|
assert(!_iu_barriers->contains(n), "duplicate entry in barrier list");
|
||||||
_enqueue_barriers->append(n);
|
_iu_barriers->append(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahBarrierSetC2State::remove_enqueue_barrier(ShenandoahEnqueueBarrierNode * n) {
|
void ShenandoahBarrierSetC2State::remove_iu_barrier(ShenandoahIUBarrierNode* n) {
|
||||||
_enqueue_barriers->remove_if_existing(n);
|
_iu_barriers->remove_if_existing(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ShenandoahBarrierSetC2State::load_reference_barriers_count() const {
|
int ShenandoahBarrierSetC2State::load_reference_barriers_count() const {
|
||||||
|
@ -88,9 +88,9 @@ void ShenandoahBarrierSetC2State::remove_load_reference_barrier(ShenandoahLoadRe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* ShenandoahBarrierSetC2::shenandoah_storeval_barrier(GraphKit* kit, Node* obj) const {
|
Node* ShenandoahBarrierSetC2::shenandoah_iu_barrier(GraphKit* kit, Node* obj) const {
|
||||||
if (ShenandoahStoreValEnqueueBarrier) {
|
if (ShenandoahIUBarrier) {
|
||||||
obj = shenandoah_enqueue_barrier(kit, obj);
|
return kit->gvn().transform(new ShenandoahIUBarrierNode(obj));
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
@ -357,10 +357,6 @@ void ShenandoahBarrierSetC2::shenandoah_write_barrier_pre(GraphKit* kit,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* ShenandoahBarrierSetC2::shenandoah_enqueue_barrier(GraphKit* kit, Node* pre_val) const {
|
|
||||||
return kit->gvn().transform(new ShenandoahEnqueueBarrierNode(pre_val));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper that guards and inserts a pre-barrier.
|
// Helper that guards and inserts a pre-barrier.
|
||||||
void ShenandoahBarrierSetC2::insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset,
|
void ShenandoahBarrierSetC2::insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset,
|
||||||
Node* pre_val, bool need_mem_bar) const {
|
Node* pre_val, bool need_mem_bar) const {
|
||||||
|
@ -517,7 +513,7 @@ Node* ShenandoahBarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue&
|
||||||
uint adr_idx = kit->C->get_alias_index(adr_type);
|
uint adr_idx = kit->C->get_alias_index(adr_type);
|
||||||
assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
|
assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
|
||||||
Node* value = val.node();
|
Node* value = val.node();
|
||||||
value = shenandoah_storeval_barrier(kit, value);
|
value = shenandoah_iu_barrier(kit, value);
|
||||||
val.set_node(value);
|
val.set_node(value);
|
||||||
shenandoah_write_barrier_pre(kit, true /* do_load */, /*kit->control(),*/ access.base(), adr, adr_idx, val.node(),
|
shenandoah_write_barrier_pre(kit, true /* do_load */, /*kit->control(),*/ access.base(), adr, adr_idx, val.node(),
|
||||||
static_cast<const TypeOopPtr*>(val.type()), NULL /* pre_val */, access.type());
|
static_cast<const TypeOopPtr*>(val.type()), NULL /* pre_val */, access.type());
|
||||||
|
@ -527,8 +523,8 @@ Node* ShenandoahBarrierSetC2::store_at_resolved(C2Access& access, C2AccessValue&
|
||||||
C2OptAccess& opt_access = static_cast<C2OptAccess&>(access);
|
C2OptAccess& opt_access = static_cast<C2OptAccess&>(access);
|
||||||
PhaseGVN& gvn = opt_access.gvn();
|
PhaseGVN& gvn = opt_access.gvn();
|
||||||
|
|
||||||
if (ShenandoahStoreValEnqueueBarrier) {
|
if (ShenandoahIUBarrier) {
|
||||||
Node* enqueue = gvn.transform(new ShenandoahEnqueueBarrierNode(val.node()));
|
Node* enqueue = gvn.transform(new ShenandoahIUBarrierNode(val.node()));
|
||||||
val.set_node(enqueue);
|
val.set_node(enqueue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -606,7 +602,7 @@ Node* ShenandoahBarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess
|
||||||
Node* new_val, const Type* value_type) const {
|
Node* new_val, const Type* value_type) const {
|
||||||
GraphKit* kit = access.kit();
|
GraphKit* kit = access.kit();
|
||||||
if (access.is_oop()) {
|
if (access.is_oop()) {
|
||||||
new_val = shenandoah_storeval_barrier(kit, new_val);
|
new_val = shenandoah_iu_barrier(kit, new_val);
|
||||||
shenandoah_write_barrier_pre(kit, false /* do_load */,
|
shenandoah_write_barrier_pre(kit, false /* do_load */,
|
||||||
NULL, NULL, max_juint, NULL, NULL,
|
NULL, NULL, max_juint, NULL, NULL,
|
||||||
expected_val /* pre_val */, T_OBJECT);
|
expected_val /* pre_val */, T_OBJECT);
|
||||||
|
@ -654,7 +650,7 @@ Node* ShenandoahBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAcces
|
||||||
Node* new_val, const Type* value_type) const {
|
Node* new_val, const Type* value_type) const {
|
||||||
GraphKit* kit = access.kit();
|
GraphKit* kit = access.kit();
|
||||||
if (access.is_oop()) {
|
if (access.is_oop()) {
|
||||||
new_val = shenandoah_storeval_barrier(kit, new_val);
|
new_val = shenandoah_iu_barrier(kit, new_val);
|
||||||
shenandoah_write_barrier_pre(kit, false /* do_load */,
|
shenandoah_write_barrier_pre(kit, false /* do_load */,
|
||||||
NULL, NULL, max_juint, NULL, NULL,
|
NULL, NULL, max_juint, NULL, NULL,
|
||||||
expected_val /* pre_val */, T_OBJECT);
|
expected_val /* pre_val */, T_OBJECT);
|
||||||
|
@ -708,7 +704,7 @@ Node* ShenandoahBarrierSetC2::atomic_cmpxchg_bool_at_resolved(C2AtomicParseAcces
|
||||||
Node* ShenandoahBarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* val, const Type* value_type) const {
|
Node* ShenandoahBarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* val, const Type* value_type) const {
|
||||||
GraphKit* kit = access.kit();
|
GraphKit* kit = access.kit();
|
||||||
if (access.is_oop()) {
|
if (access.is_oop()) {
|
||||||
val = shenandoah_storeval_barrier(kit, val);
|
val = shenandoah_iu_barrier(kit, val);
|
||||||
}
|
}
|
||||||
Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, val, value_type);
|
Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, val, value_type);
|
||||||
if (access.is_oop()) {
|
if (access.is_oop()) {
|
||||||
|
@ -743,7 +739,7 @@ Node* ShenandoahBarrierSetC2::step_over_gc_barrier(Node* c) const {
|
||||||
if (c->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
if (c->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
||||||
return c->in(ShenandoahLoadReferenceBarrierNode::ValueIn);
|
return c->in(ShenandoahLoadReferenceBarrierNode::ValueIn);
|
||||||
}
|
}
|
||||||
if (c->Opcode() == Op_ShenandoahEnqueueBarrier) {
|
if (c->Opcode() == Op_ShenandoahIUBarrier) {
|
||||||
c = c->in(1);
|
c = c->in(1);
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
|
@ -779,7 +775,7 @@ bool ShenandoahBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_couple
|
||||||
return !is_clone;
|
return !is_clone;
|
||||||
}
|
}
|
||||||
if (phase == Optimization) {
|
if (phase == Optimization) {
|
||||||
return !ShenandoahStoreValEnqueueBarrier;
|
return !ShenandoahIUBarrier;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -840,7 +836,7 @@ void ShenandoahBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCo
|
||||||
|
|
||||||
Node* gc_state = phase->transform_later(new LoadBNode(ctrl, mem, gc_state_addr, gc_state_adr_type, TypeInt::BYTE, MemNode::unordered));
|
Node* gc_state = phase->transform_later(new LoadBNode(ctrl, mem, gc_state_addr, gc_state_adr_type, TypeInt::BYTE, MemNode::unordered));
|
||||||
int flags = ShenandoahHeap::HAS_FORWARDED;
|
int flags = ShenandoahHeap::HAS_FORWARDED;
|
||||||
if (ShenandoahStoreValEnqueueBarrier) {
|
if (ShenandoahIUBarrier) {
|
||||||
flags |= ShenandoahHeap::MARKING;
|
flags |= ShenandoahHeap::MARKING;
|
||||||
}
|
}
|
||||||
Node* stable_and = phase->transform_later(new AndINode(gc_state, phase->igvn().intcon(flags)));
|
Node* stable_and = phase->transform_later(new AndINode(gc_state, phase->igvn().intcon(flags)));
|
||||||
|
@ -892,8 +888,8 @@ void ShenandoahBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCo
|
||||||
|
|
||||||
// Support for macro expanded GC barriers
|
// Support for macro expanded GC barriers
|
||||||
void ShenandoahBarrierSetC2::register_potential_barrier_node(Node* node) const {
|
void ShenandoahBarrierSetC2::register_potential_barrier_node(Node* node) const {
|
||||||
if (node->Opcode() == Op_ShenandoahEnqueueBarrier) {
|
if (node->Opcode() == Op_ShenandoahIUBarrier) {
|
||||||
state()->add_enqueue_barrier((ShenandoahEnqueueBarrierNode*) node);
|
state()->add_iu_barrier((ShenandoahIUBarrierNode*) node);
|
||||||
}
|
}
|
||||||
if (node->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
if (node->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
||||||
state()->add_load_reference_barrier((ShenandoahLoadReferenceBarrierNode*) node);
|
state()->add_load_reference_barrier((ShenandoahLoadReferenceBarrierNode*) node);
|
||||||
|
@ -901,8 +897,8 @@ void ShenandoahBarrierSetC2::register_potential_barrier_node(Node* node) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahBarrierSetC2::unregister_potential_barrier_node(Node* node) const {
|
void ShenandoahBarrierSetC2::unregister_potential_barrier_node(Node* node) const {
|
||||||
if (node->Opcode() == Op_ShenandoahEnqueueBarrier) {
|
if (node->Opcode() == Op_ShenandoahIUBarrier) {
|
||||||
state()->remove_enqueue_barrier((ShenandoahEnqueueBarrierNode*) node);
|
state()->remove_iu_barrier((ShenandoahIUBarrierNode*) node);
|
||||||
}
|
}
|
||||||
if (node->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
if (node->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
||||||
state()->remove_load_reference_barrier((ShenandoahLoadReferenceBarrierNode*) node);
|
state()->remove_load_reference_barrier((ShenandoahLoadReferenceBarrierNode*) node);
|
||||||
|
@ -951,10 +947,10 @@ void ShenandoahBarrierSetC2::eliminate_useless_gc_barriers(Unique_Node_List &use
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = state()->enqueue_barriers_count() - 1; i >= 0; i--) {
|
for (int i = state()->iu_barriers_count() - 1; i >= 0; i--) {
|
||||||
ShenandoahEnqueueBarrierNode* n = state()->enqueue_barrier(i);
|
ShenandoahIUBarrierNode* n = state()->iu_barrier(i);
|
||||||
if (!useful.member(n)) {
|
if (!useful.member(n)) {
|
||||||
state()->remove_enqueue_barrier(n);
|
state()->remove_iu_barrier(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = state()->load_reference_barriers_count() - 1; i >= 0; i--) {
|
for (int i = state()->load_reference_barriers_count() - 1; i >= 0; i--) {
|
||||||
|
@ -1198,7 +1194,7 @@ bool ShenandoahBarrierSetC2::escape_add_to_con_graph(ConnectionGraph* conn_graph
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case Op_ShenandoahEnqueueBarrier:
|
case Op_ShenandoahIUBarrier:
|
||||||
conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape, n->in(1), delayed_worklist);
|
conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape, n->in(1), delayed_worklist);
|
||||||
break;
|
break;
|
||||||
case Op_ShenandoahLoadReferenceBarrier:
|
case Op_ShenandoahLoadReferenceBarrier:
|
||||||
|
@ -1224,7 +1220,7 @@ bool ShenandoahBarrierSetC2::escape_add_final_edges(ConnectionGraph* conn_graph,
|
||||||
case Op_ShenandoahWeakCompareAndSwapP:
|
case Op_ShenandoahWeakCompareAndSwapP:
|
||||||
case Op_ShenandoahWeakCompareAndSwapN:
|
case Op_ShenandoahWeakCompareAndSwapN:
|
||||||
return conn_graph->add_final_edges_unsafe_access(n, opcode);
|
return conn_graph->add_final_edges_unsafe_access(n, opcode);
|
||||||
case Op_ShenandoahEnqueueBarrier:
|
case Op_ShenandoahIUBarrier:
|
||||||
conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape, n->in(1), NULL);
|
conn_graph->add_local_var_and_edge(n, PointsToNode::NoEscape, n->in(1), NULL);
|
||||||
return true;
|
return true;
|
||||||
case Op_ShenandoahLoadReferenceBarrier:
|
case Op_ShenandoahLoadReferenceBarrier:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -31,16 +31,16 @@
|
||||||
|
|
||||||
class ShenandoahBarrierSetC2State : public ResourceObj {
|
class ShenandoahBarrierSetC2State : public ResourceObj {
|
||||||
private:
|
private:
|
||||||
GrowableArray<ShenandoahEnqueueBarrierNode*>* _enqueue_barriers;
|
GrowableArray<ShenandoahIUBarrierNode*>* _iu_barriers;
|
||||||
GrowableArray<ShenandoahLoadReferenceBarrierNode*>* _load_reference_barriers;
|
GrowableArray<ShenandoahLoadReferenceBarrierNode*>* _load_reference_barriers;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ShenandoahBarrierSetC2State(Arena* comp_arena);
|
ShenandoahBarrierSetC2State(Arena* comp_arena);
|
||||||
|
|
||||||
int enqueue_barriers_count() const;
|
int iu_barriers_count() const;
|
||||||
ShenandoahEnqueueBarrierNode* enqueue_barrier(int idx) const;
|
ShenandoahIUBarrierNode* iu_barrier(int idx) const;
|
||||||
void add_enqueue_barrier(ShenandoahEnqueueBarrierNode* n);
|
void add_iu_barrier(ShenandoahIUBarrierNode* n);
|
||||||
void remove_enqueue_barrier(ShenandoahEnqueueBarrierNode * n);
|
void remove_iu_barrier(ShenandoahIUBarrierNode * n);
|
||||||
|
|
||||||
int load_reference_barriers_count() const;
|
int load_reference_barriers_count() const;
|
||||||
ShenandoahLoadReferenceBarrierNode* load_reference_barrier(int idx) const;
|
ShenandoahLoadReferenceBarrierNode* load_reference_barrier(int idx) const;
|
||||||
|
@ -73,8 +73,7 @@ private:
|
||||||
Node* pre_val,
|
Node* pre_val,
|
||||||
BasicType bt) const;
|
BasicType bt) const;
|
||||||
|
|
||||||
Node* shenandoah_enqueue_barrier(GraphKit* kit, Node* val) const;
|
Node* shenandoah_iu_barrier(GraphKit* kit, Node* obj) const;
|
||||||
Node* shenandoah_storeval_barrier(GraphKit* kit, Node* obj) const;
|
|
||||||
|
|
||||||
void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset,
|
void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset,
|
||||||
Node* pre_val, bool need_mem_bar) const;
|
Node* pre_val, bool need_mem_bar) const;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2015, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) {
|
bool ShenandoahBarrierC2Support::expand(Compile* C, PhaseIterGVN& igvn) {
|
||||||
ShenandoahBarrierSetC2State* state = ShenandoahBarrierSetC2::bsc2()->state();
|
ShenandoahBarrierSetC2State* state = ShenandoahBarrierSetC2::bsc2()->state();
|
||||||
if ((state->enqueue_barriers_count() +
|
if ((state->iu_barriers_count() +
|
||||||
state->load_reference_barriers_count()) > 0) {
|
state->load_reference_barriers_count()) > 0) {
|
||||||
assert(C->post_loop_opts_phase(), "no loop opts allowed");
|
assert(C->post_loop_opts_phase(), "no loop opts allowed");
|
||||||
C->reset_post_loop_opts_phase(); // ... but we know what we are doing
|
C->reset_post_loop_opts_phase(); // ... but we know what we are doing
|
||||||
|
@ -191,7 +191,7 @@ bool ShenandoahBarrierC2Support::verify_helper(Node* in, Node_Stack& phis, Vecto
|
||||||
uint i = 0;
|
uint i = 0;
|
||||||
for (; i < phis.size(); i++) {
|
for (; i < phis.size(); i++) {
|
||||||
Node* n = phis.node_at(i);
|
Node* n = phis.node_at(i);
|
||||||
if (n->Opcode() == Op_ShenandoahEnqueueBarrier) {
|
if (n->Opcode() == Op_ShenandoahIUBarrier) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ bool ShenandoahBarrierC2Support::verify_helper(Node* in, Node_Stack& phis, Vecto
|
||||||
}
|
}
|
||||||
barriers_used.push(in);
|
barriers_used.push(in);
|
||||||
if (trace) {tty->print("Found barrier"); in->dump();}
|
if (trace) {tty->print("Found barrier"); in->dump();}
|
||||||
} else if (in->Opcode() == Op_ShenandoahEnqueueBarrier) {
|
} else if (in->Opcode() == Op_ShenandoahIUBarrier) {
|
||||||
if (t != ShenandoahOopStore) {
|
if (t != ShenandoahOopStore) {
|
||||||
in = in->in(1);
|
in = in->in(1);
|
||||||
continue;
|
continue;
|
||||||
|
@ -328,7 +328,7 @@ void ShenandoahBarrierC2Support::verify(RootNode* root) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verify && !verify_helper(n->in(MemNode::ValueIn), phis, visited, ShenandoahStoreValEnqueueBarrier ? ShenandoahOopStore : ShenandoahValue, trace, barriers_used)) {
|
if (verify && !verify_helper(n->in(MemNode::ValueIn), phis, visited, ShenandoahIUBarrier ? ShenandoahOopStore : ShenandoahValue, trace, barriers_used)) {
|
||||||
report_verify_failure("Shenandoah verification: Store should have barriers", n);
|
report_verify_failure("Shenandoah verification: Store should have barriers", n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ void ShenandoahBarrierC2Support::verify(RootNode* root) {
|
||||||
}
|
}
|
||||||
} else if (n->is_LoadStore()) {
|
} else if (n->is_LoadStore()) {
|
||||||
if (n->in(MemNode::ValueIn)->bottom_type()->make_ptr() &&
|
if (n->in(MemNode::ValueIn)->bottom_type()->make_ptr() &&
|
||||||
!verify_helper(n->in(MemNode::ValueIn), phis, visited, ShenandoahStoreValEnqueueBarrier ? ShenandoahOopStore : ShenandoahValue, trace, barriers_used)) {
|
!verify_helper(n->in(MemNode::ValueIn), phis, visited, ShenandoahIUBarrier ? ShenandoahOopStore : ShenandoahValue, trace, barriers_used)) {
|
||||||
report_verify_failure("Shenandoah verification: LoadStore (value) should have barriers", n);
|
report_verify_failure("Shenandoah verification: LoadStore (value) should have barriers", n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ void ShenandoahBarrierC2Support::verify(RootNode* root) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (n->Opcode() == Op_ShenandoahEnqueueBarrier || n->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
} else if (n->Opcode() == Op_ShenandoahIUBarrier || n->Opcode() == Op_ShenandoahLoadReferenceBarrier) {
|
||||||
// skip
|
// skip
|
||||||
} else if (n->is_AddP()
|
} else if (n->is_AddP()
|
||||||
|| n->is_Phi()
|
|| n->is_Phi()
|
||||||
|
@ -1110,8 +1110,8 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
|
||||||
ShenandoahBarrierSetC2State* state = ShenandoahBarrierSetC2::bsc2()->state();
|
ShenandoahBarrierSetC2State* state = ShenandoahBarrierSetC2::bsc2()->state();
|
||||||
|
|
||||||
Unique_Node_List uses;
|
Unique_Node_List uses;
|
||||||
for (int i = 0; i < state->enqueue_barriers_count(); i++) {
|
for (int i = 0; i < state->iu_barriers_count(); i++) {
|
||||||
Node* barrier = state->enqueue_barrier(i);
|
Node* barrier = state->iu_barrier(i);
|
||||||
Node* ctrl = phase->get_ctrl(barrier);
|
Node* ctrl = phase->get_ctrl(barrier);
|
||||||
IdealLoopTree* loop = phase->get_loop(ctrl);
|
IdealLoopTree* loop = phase->get_loop(ctrl);
|
||||||
Node* head = loop->head();
|
Node* head = loop->head();
|
||||||
|
@ -1461,8 +1461,8 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
|
||||||
// Done expanding load-reference-barriers.
|
// Done expanding load-reference-barriers.
|
||||||
assert(ShenandoahBarrierSetC2::bsc2()->state()->load_reference_barriers_count() == 0, "all load reference barrier nodes should have been replaced");
|
assert(ShenandoahBarrierSetC2::bsc2()->state()->load_reference_barriers_count() == 0, "all load reference barrier nodes should have been replaced");
|
||||||
|
|
||||||
for (int i = state->enqueue_barriers_count() - 1; i >= 0; i--) {
|
for (int i = state->iu_barriers_count() - 1; i >= 0; i--) {
|
||||||
Node* barrier = state->enqueue_barrier(i);
|
Node* barrier = state->iu_barrier(i);
|
||||||
Node* pre_val = barrier->in(1);
|
Node* pre_val = barrier->in(1);
|
||||||
|
|
||||||
if (phase->igvn().type(pre_val)->higher_equal(TypePtr::NULL_PTR)) {
|
if (phase->igvn().type(pre_val)->higher_equal(TypePtr::NULL_PTR)) {
|
||||||
|
@ -1609,7 +1609,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
|
||||||
|
|
||||||
phase->igvn().replace_node(barrier, pre_val);
|
phase->igvn().replace_node(barrier, pre_val);
|
||||||
}
|
}
|
||||||
assert(state->enqueue_barriers_count() == 0, "all enqueue barrier nodes should have been replaced");
|
assert(state->iu_barriers_count() == 0, "all enqueue barrier nodes should have been replaced");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1663,7 +1663,7 @@ Node* ShenandoahBarrierC2Support::get_load_addr(PhaseIdealLoop* phase, VectorSet
|
||||||
}
|
}
|
||||||
case Op_ShenandoahLoadReferenceBarrier:
|
case Op_ShenandoahLoadReferenceBarrier:
|
||||||
return get_load_addr(phase, visited, in->in(ShenandoahLoadReferenceBarrierNode::ValueIn));
|
return get_load_addr(phase, visited, in->in(ShenandoahLoadReferenceBarrierNode::ValueIn));
|
||||||
case Op_ShenandoahEnqueueBarrier:
|
case Op_ShenandoahIUBarrier:
|
||||||
return get_load_addr(phase, visited, in->in(1));
|
return get_load_addr(phase, visited, in->in(1));
|
||||||
case Op_CallDynamicJava:
|
case Op_CallDynamicJava:
|
||||||
case Op_CallLeaf:
|
case Op_CallLeaf:
|
||||||
|
@ -1996,11 +1996,11 @@ void ShenandoahBarrierC2Support::verify_raw_mem(RootNode* root) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ShenandoahEnqueueBarrierNode::ShenandoahEnqueueBarrierNode(Node* val) : Node(NULL, val) {
|
ShenandoahIUBarrierNode::ShenandoahIUBarrierNode(Node* val) : Node(NULL, val) {
|
||||||
ShenandoahBarrierSetC2::bsc2()->state()->add_enqueue_barrier(this);
|
ShenandoahBarrierSetC2::bsc2()->state()->add_iu_barrier(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Type* ShenandoahEnqueueBarrierNode::bottom_type() const {
|
const Type* ShenandoahIUBarrierNode::bottom_type() const {
|
||||||
if (in(1) == NULL || in(1)->is_top()) {
|
if (in(1) == NULL || in(1)->is_top()) {
|
||||||
return Type::TOP;
|
return Type::TOP;
|
||||||
}
|
}
|
||||||
|
@ -2011,7 +2011,7 @@ const Type* ShenandoahEnqueueBarrierNode::bottom_type() const {
|
||||||
return t->is_oopptr();
|
return t->is_oopptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Type* ShenandoahEnqueueBarrierNode::Value(PhaseGVN* phase) const {
|
const Type* ShenandoahIUBarrierNode::Value(PhaseGVN* phase) const {
|
||||||
if (in(1) == NULL) {
|
if (in(1) == NULL) {
|
||||||
return Type::TOP;
|
return Type::TOP;
|
||||||
}
|
}
|
||||||
|
@ -2025,10 +2025,10 @@ const Type* ShenandoahEnqueueBarrierNode::Value(PhaseGVN* phase) const {
|
||||||
return t->is_oopptr();
|
return t->is_oopptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
int ShenandoahEnqueueBarrierNode::needed(Node* n) {
|
int ShenandoahIUBarrierNode::needed(Node* n) {
|
||||||
if (n == NULL ||
|
if (n == NULL ||
|
||||||
n->is_Allocate() ||
|
n->is_Allocate() ||
|
||||||
n->Opcode() == Op_ShenandoahEnqueueBarrier ||
|
n->Opcode() == Op_ShenandoahIUBarrier ||
|
||||||
n->bottom_type() == TypePtr::NULL_PTR ||
|
n->bottom_type() == TypePtr::NULL_PTR ||
|
||||||
(n->bottom_type()->make_oopptr() != NULL && n->bottom_type()->make_oopptr()->const_oop() != NULL)) {
|
(n->bottom_type()->make_oopptr() != NULL && n->bottom_type()->make_oopptr()->const_oop() != NULL)) {
|
||||||
return NotNeeded;
|
return NotNeeded;
|
||||||
|
@ -2040,7 +2040,7 @@ int ShenandoahEnqueueBarrierNode::needed(Node* n) {
|
||||||
return Needed;
|
return Needed;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* ShenandoahEnqueueBarrierNode::next(Node* n) {
|
Node* ShenandoahIUBarrierNode::next(Node* n) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (n == NULL) {
|
if (n == NULL) {
|
||||||
return n;
|
return n;
|
||||||
|
@ -2062,7 +2062,7 @@ Node* ShenandoahEnqueueBarrierNode::next(Node* n) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node* ShenandoahEnqueueBarrierNode::Identity(PhaseGVN* phase) {
|
Node* ShenandoahIUBarrierNode::Identity(PhaseGVN* phase) {
|
||||||
PhaseIterGVN* igvn = phase->is_IterGVN();
|
PhaseIterGVN* igvn = phase->is_IterGVN();
|
||||||
|
|
||||||
Node* n = next(in(1));
|
Node* n = next(in(1));
|
||||||
|
@ -3074,7 +3074,7 @@ bool ShenandoahLoadReferenceBarrierNode::needs_barrier_impl(PhaseGVN* phase, Nod
|
||||||
case Op_CMoveP:
|
case Op_CMoveP:
|
||||||
return needs_barrier_impl(phase, n->in(2), visited) ||
|
return needs_barrier_impl(phase, n->in(2), visited) ||
|
||||||
needs_barrier_impl(phase, n->in(3), visited);
|
needs_barrier_impl(phase, n->in(3), visited);
|
||||||
case Op_ShenandoahEnqueueBarrier:
|
case Op_ShenandoahIUBarrier:
|
||||||
return needs_barrier_impl(phase, n->in(1), visited);
|
return needs_barrier_impl(phase, n->in(1), visited);
|
||||||
case Op_CreateEx:
|
case Op_CreateEx:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2015, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -87,9 +87,9 @@ public:
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
class ShenandoahEnqueueBarrierNode : public Node {
|
class ShenandoahIUBarrierNode : public Node {
|
||||||
public:
|
public:
|
||||||
ShenandoahEnqueueBarrierNode(Node* val);
|
ShenandoahIUBarrierNode(Node* val);
|
||||||
|
|
||||||
const Type *bottom_type() const;
|
const Type *bottom_type() const;
|
||||||
const Type* Value(PhaseGVN* phase) const;
|
const Type* Value(PhaseGVN* phase) const;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2020, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -40,8 +40,8 @@ void ShenandoahIUMode::initialize_flags() const {
|
||||||
FLAG_SET_DEFAULT(VerifyBeforeExit, false);
|
FLAG_SET_DEFAULT(VerifyBeforeExit, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier)) {
|
if (FLAG_IS_DEFAULT(ShenandoahIUBarrier)) {
|
||||||
FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, true);
|
FLAG_SET_DEFAULT(ShenandoahIUBarrier, true);
|
||||||
}
|
}
|
||||||
if (FLAG_IS_DEFAULT(ShenandoahSATBBarrier)) {
|
if (FLAG_IS_DEFAULT(ShenandoahSATBBarrier)) {
|
||||||
FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
|
FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
|
||||||
|
@ -53,7 +53,7 @@ void ShenandoahIUMode::initialize_flags() const {
|
||||||
// Final configuration checks
|
// Final configuration checks
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_UNSET(ShenandoahSATBBarrier);
|
SHENANDOAH_CHECK_FLAG_UNSET(ShenandoahSATBBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahStoreValEnqueueBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahIUBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2019, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -45,7 +45,7 @@ void ShenandoahPassiveMode::initialize_flags() const {
|
||||||
// Disable known barriers by default.
|
// Disable known barriers by default.
|
||||||
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahLoadRefBarrier);
|
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahLoadRefBarrier);
|
||||||
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahSATBBarrier);
|
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahSATBBarrier);
|
||||||
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahStoreValEnqueueBarrier);
|
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahIUBarrier);
|
||||||
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCASBarrier);
|
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCASBarrier);
|
||||||
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCloneBarrier);
|
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahCloneBarrier);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2019, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -45,7 +45,7 @@ void ShenandoahSATBMode::initialize_flags() const {
|
||||||
|
|
||||||
// Final configuration checks
|
// Final configuration checks
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_UNSET(ShenandoahStoreValEnqueueBarrier);
|
SHENANDOAH_CHECK_FLAG_UNSET(ShenandoahIUBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahSATBBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
|
||||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
|
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -48,7 +48,7 @@ void ShenandoahArguments::initialize() {
|
||||||
|
|
||||||
FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
|
FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
|
||||||
FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier, false);
|
FLAG_SET_DEFAULT(ShenandoahLoadRefBarrier, false);
|
||||||
FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, false);
|
FLAG_SET_DEFAULT(ShenandoahIUBarrier, false);
|
||||||
FLAG_SET_DEFAULT(ShenandoahCASBarrier, false);
|
FLAG_SET_DEFAULT(ShenandoahCASBarrier, false);
|
||||||
FLAG_SET_DEFAULT(ShenandoahCloneBarrier, false);
|
FLAG_SET_DEFAULT(ShenandoahCloneBarrier, false);
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ void ShenandoahArguments::initialize() {
|
||||||
if (ShenandoahVerifyOptoBarriers &&
|
if (ShenandoahVerifyOptoBarriers &&
|
||||||
(!FLAG_IS_DEFAULT(ShenandoahSATBBarrier) ||
|
(!FLAG_IS_DEFAULT(ShenandoahSATBBarrier) ||
|
||||||
!FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier) ||
|
!FLAG_IS_DEFAULT(ShenandoahLoadRefBarrier) ||
|
||||||
!FLAG_IS_DEFAULT(ShenandoahStoreValEnqueueBarrier) ||
|
!FLAG_IS_DEFAULT(ShenandoahIUBarrier) ||
|
||||||
!FLAG_IS_DEFAULT(ShenandoahCASBarrier) ||
|
!FLAG_IS_DEFAULT(ShenandoahCASBarrier) ||
|
||||||
!FLAG_IS_DEFAULT(ShenandoahCloneBarrier)
|
!FLAG_IS_DEFAULT(ShenandoahCloneBarrier)
|
||||||
)) {
|
)) {
|
||||||
|
|
|
@ -126,7 +126,7 @@ void ShenandoahBarrierSet::on_thread_detach(Thread *thread) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShenandoahBarrierSet::clone_barrier_runtime(oop src) {
|
void ShenandoahBarrierSet::clone_barrier_runtime(oop src) {
|
||||||
if (_heap->has_forwarded_objects() || (ShenandoahStoreValEnqueueBarrier && _heap->is_concurrent_mark_in_progress())) {
|
if (_heap->has_forwarded_objects() || (ShenandoahIUBarrier && _heap->is_concurrent_mark_in_progress())) {
|
||||||
clone_barrier(src);
|
clone_barrier(src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2013, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -93,7 +93,7 @@ public:
|
||||||
template <DecoratorSet decorators, typename T>
|
template <DecoratorSet decorators, typename T>
|
||||||
inline void satb_barrier(T* field);
|
inline void satb_barrier(T* field);
|
||||||
inline void satb_enqueue(oop value);
|
inline void satb_enqueue(oop value);
|
||||||
inline void storeval_barrier(oop obj);
|
inline void iu_barrier(oop obj);
|
||||||
|
|
||||||
template <DecoratorSet decorators>
|
template <DecoratorSet decorators>
|
||||||
inline void keep_alive_if_weak(oop value);
|
inline void keep_alive_if_weak(oop value);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2015, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -166,8 +166,8 @@ inline void ShenandoahBarrierSet::satb_enqueue(oop value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ShenandoahBarrierSet::storeval_barrier(oop obj) {
|
inline void ShenandoahBarrierSet::iu_barrier(oop obj) {
|
||||||
if (ShenandoahStoreValEnqueueBarrier && obj != NULL && _heap->is_concurrent_mark_in_progress()) {
|
if (ShenandoahIUBarrier && obj != NULL && _heap->is_concurrent_mark_in_progress()) {
|
||||||
enqueue(obj);
|
enqueue(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ inline void ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_st
|
||||||
shenandoah_assert_marked_if(NULL, value, !CompressedOops::is_null(value) && ShenandoahHeap::heap()->is_evacuation_in_progress());
|
shenandoah_assert_marked_if(NULL, value, !CompressedOops::is_null(value) && ShenandoahHeap::heap()->is_evacuation_in_progress());
|
||||||
shenandoah_assert_not_in_cset_if(addr, value, value != NULL && !ShenandoahHeap::heap()->cancelled_gc());
|
shenandoah_assert_not_in_cset_if(addr, value, value != NULL && !ShenandoahHeap::heap()->cancelled_gc());
|
||||||
ShenandoahBarrierSet* const bs = ShenandoahBarrierSet::barrier_set();
|
ShenandoahBarrierSet* const bs = ShenandoahBarrierSet::barrier_set();
|
||||||
bs->storeval_barrier(value);
|
bs->iu_barrier(value);
|
||||||
bs->satb_barrier<decorators>(addr);
|
bs->satb_barrier<decorators>(addr);
|
||||||
Raw::oop_store(addr, value);
|
Raw::oop_store(addr, value);
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ template <DecoratorSet decorators, typename BarrierSetT>
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_cmpxchg_not_in_heap(T* addr, oop compare_value, oop new_value) {
|
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_cmpxchg_not_in_heap(T* addr, oop compare_value, oop new_value) {
|
||||||
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
|
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
|
||||||
bs->storeval_barrier(new_value);
|
bs->iu_barrier(new_value);
|
||||||
|
|
||||||
oop res;
|
oop res;
|
||||||
oop expected = compare_value;
|
oop expected = compare_value;
|
||||||
|
@ -284,7 +284,7 @@ template <DecoratorSet decorators, typename BarrierSetT>
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_xchg_not_in_heap(T* addr, oop new_value) {
|
inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_atomic_xchg_not_in_heap(T* addr, oop new_value) {
|
||||||
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
|
ShenandoahBarrierSet* bs = ShenandoahBarrierSet::barrier_set();
|
||||||
bs->storeval_barrier(new_value);
|
bs->iu_barrier(new_value);
|
||||||
|
|
||||||
oop previous = Raw::oop_atomic_xchg(addr, new_value);
|
oop previous = Raw::oop_atomic_xchg(addr, new_value);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2013, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -74,7 +74,7 @@ public:
|
||||||
|
|
||||||
void ShenandoahBarrierSet::clone_marking(oop obj) {
|
void ShenandoahBarrierSet::clone_marking(oop obj) {
|
||||||
assert(_heap->is_concurrent_mark_in_progress(), "only during marking");
|
assert(_heap->is_concurrent_mark_in_progress(), "only during marking");
|
||||||
assert(ShenandoahStoreValEnqueueBarrier, "only with incremental-update");
|
assert(ShenandoahIUBarrier, "only with incremental-update");
|
||||||
if (!_heap->marking_context()->allocated_after_mark_start(obj)) {
|
if (!_heap->marking_context()->allocated_after_mark_start(obj)) {
|
||||||
ShenandoahUpdateRefsForOopClosure</* has_fwd = */ false, /* evac = */ false, /* enqueue */ true> cl;
|
ShenandoahUpdateRefsForOopClosure</* has_fwd = */ false, /* evac = */ false, /* enqueue */ true> cl;
|
||||||
obj->oop_iterate(&cl);
|
obj->oop_iterate(&cl);
|
||||||
|
|
|
@ -166,7 +166,7 @@ public:
|
||||||
ShenandoahMarkRefsClosure mark_cl(q, rp);
|
ShenandoahMarkRefsClosure mark_cl(q, rp);
|
||||||
MarkingCodeBlobClosure blobsCl(&mark_cl, !CodeBlobToOopClosure::FixRelocations);
|
MarkingCodeBlobClosure blobsCl(&mark_cl, !CodeBlobToOopClosure::FixRelocations);
|
||||||
ShenandoahSATBAndRemarkCodeRootsThreadsClosure tc(&cl,
|
ShenandoahSATBAndRemarkCodeRootsThreadsClosure tc(&cl,
|
||||||
ShenandoahStoreValEnqueueBarrier ? &mark_cl : NULL,
|
ShenandoahIUBarrier ? &mark_cl : NULL,
|
||||||
do_nmethods ? &blobsCl : NULL);
|
do_nmethods ? &blobsCl : NULL);
|
||||||
Threads::threads_do(&tc);
|
Threads::threads_do(&tc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved.
|
* Copyright (c) 2016, 2021, Red Hat, Inc. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -340,8 +340,8 @@
|
||||||
product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC, \
|
product(bool, ShenandoahSATBBarrier, true, DIAGNOSTIC, \
|
||||||
"Turn on/off SATB barriers in Shenandoah") \
|
"Turn on/off SATB barriers in Shenandoah") \
|
||||||
\
|
\
|
||||||
product(bool, ShenandoahStoreValEnqueueBarrier, false, DIAGNOSTIC, \
|
product(bool, ShenandoahIUBarrier, false, DIAGNOSTIC, \
|
||||||
"Turn on/off enqueuing of oops for storeval barriers") \
|
"Turn on/off I-U barriers barriers in Shenandoah") \
|
||||||
\
|
\
|
||||||
product(bool, ShenandoahCASBarrier, true, DIAGNOSTIC, \
|
product(bool, ShenandoahCASBarrier, true, DIAGNOSTIC, \
|
||||||
"Turn on/off CAS barriers in Shenandoah") \
|
"Turn on/off CAS barriers in Shenandoah") \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -293,7 +293,7 @@ shmacro(ShenandoahCompareAndSwapN)
|
||||||
shmacro(ShenandoahCompareAndSwapP)
|
shmacro(ShenandoahCompareAndSwapP)
|
||||||
shmacro(ShenandoahWeakCompareAndSwapN)
|
shmacro(ShenandoahWeakCompareAndSwapN)
|
||||||
shmacro(ShenandoahWeakCompareAndSwapP)
|
shmacro(ShenandoahWeakCompareAndSwapP)
|
||||||
shmacro(ShenandoahEnqueueBarrier)
|
shmacro(ShenandoahIUBarrier)
|
||||||
shmacro(ShenandoahLoadReferenceBarrier)
|
shmacro(ShenandoahLoadReferenceBarrier)
|
||||||
macro(SCMemProj)
|
macro(SCMemProj)
|
||||||
macro(CopySignD)
|
macro(CopySignD)
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class TestSelectiveBarrierFlags {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
String[][] opts = {
|
String[][] opts = {
|
||||||
new String[] { "ShenandoahLoadRefBarrier" },
|
new String[] { "ShenandoahLoadRefBarrier" },
|
||||||
new String[] { "ShenandoahSATBBarrier", "ShenandoahStoreValEnqueueBarrier" },
|
new String[] { "ShenandoahSATBBarrier", "ShenandoahIUBarrier" },
|
||||||
new String[] { "ShenandoahCASBarrier" },
|
new String[] { "ShenandoahCASBarrier" },
|
||||||
new String[] { "ShenandoahCloneBarrier" },
|
new String[] { "ShenandoahCloneBarrier" },
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class TestWrongBarrierDisable {
|
||||||
};
|
};
|
||||||
String[] iu = {
|
String[] iu = {
|
||||||
"ShenandoahLoadRefBarrier",
|
"ShenandoahLoadRefBarrier",
|
||||||
"ShenandoahStoreValEnqueueBarrier",
|
"ShenandoahIUBarrier",
|
||||||
"ShenandoahCASBarrier",
|
"ShenandoahCASBarrier",
|
||||||
"ShenandoahCloneBarrier",
|
"ShenandoahCloneBarrier",
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class TestWrongBarrierEnable {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
String[] concurrent = {
|
String[] concurrent = {
|
||||||
"ShenandoahStoreValEnqueueBarrier",
|
"ShenandoahIUBarrier",
|
||||||
};
|
};
|
||||||
String[] iu = {
|
String[] iu = {
|
||||||
"ShenandoahSATBBarrier",
|
"ShenandoahSATBBarrier",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue