8224667: Shenandoah: Post-LRB cleanup

Reviewed-by: shade
This commit is contained in:
Roman Kennke 2019-05-23 17:01:38 +02:00
parent 6bf5ad140a
commit 56359d42b1
6 changed files with 31 additions and 31 deletions

View File

@ -295,7 +295,7 @@ bool ShenandoahBarrierSetC2::is_shenandoah_wb_pre_call(Node* call) {
call->as_CallLeaf()->entry_point() == CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre_entry);
}
bool ShenandoahBarrierSetC2::is_shenandoah_wb_call(Node* call) {
bool ShenandoahBarrierSetC2::is_shenandoah_lrb_call(Node* call) {
return call->is_CallLeaf() &&
call->as_CallLeaf()->entry_point() == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_JRT);
}
@ -472,7 +472,7 @@ const TypeFunc* ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type() {
return TypeFunc::make(domain, range);
}
const TypeFunc* ShenandoahBarrierSetC2::shenandoah_write_barrier_Type() {
const TypeFunc* ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type() {
const Type **fields = TypeTuple::fields(1);
fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // original field value
const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+1, fields);

View File

@ -93,7 +93,7 @@ public:
static ShenandoahBarrierSetC2* bsc2();
static bool is_shenandoah_wb_pre_call(Node* call);
static bool is_shenandoah_wb_call(Node* call);
static bool is_shenandoah_lrb_call(Node* call);
static bool is_shenandoah_marking_if(PhaseTransform *phase, Node* n);
static bool is_shenandoah_state_load(Node* n);
static bool has_only_shenandoah_wb_pre_uses(Node* n);
@ -102,7 +102,7 @@ public:
static const TypeFunc* write_ref_field_pre_entry_Type();
static const TypeFunc* shenandoah_clone_barrier_Type();
static const TypeFunc* shenandoah_write_barrier_Type();
static const TypeFunc* shenandoah_load_reference_barrier_Type();
virtual bool has_load_barriers() const { return true; }
// This is the entry-point for the backend to perform accesses through the Access API.

View File

@ -1093,7 +1093,7 @@ void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node*& r
mm->set_memory_at(Compile::AliasIdxRaw, raw_mem);
phase->register_new_node(mm, ctrl);
Node* call = new CallLeafNode(ShenandoahBarrierSetC2::shenandoah_write_barrier_Type(), CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_JRT), "shenandoah_write_barrier", TypeRawPtr::BOTTOM);
Node* call = new CallLeafNode(ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type(), CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_JRT), "shenandoah_load_reference_barrier", TypeRawPtr::BOTTOM);
call->init_req(TypeFunc::Control, ctrl);
call->init_req(TypeFunc::I_O, phase->C->top());
call->init_req(TypeFunc::Memory, mm);
@ -1532,7 +1532,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
val_phi->init_req(_not_equal, fwd);
raw_mem_phi->init_req(_not_equal, raw_mem);
// Call wb-stub and wire up that path in slots 4
// Call lrb-stub and wire up that path in slots 4
Node* result_mem = NULL;
ctrl = if_eq;
call_lrb_stub(ctrl, fwd, result_mem, raw_mem, phase);
@ -1979,7 +1979,7 @@ void ShenandoahBarrierC2Support::verify_raw_mem(RootNode* root) {
nodes.push(root);
for (uint next = 0; next < nodes.size(); next++) {
Node *n = nodes.at(next);
if (ShenandoahBarrierSetC2::is_shenandoah_wb_call(n)) {
if (ShenandoahBarrierSetC2::is_shenandoah_lrb_call(n)) {
controls.push(n);
if (trace) { tty->print("XXXXXX verifying"); n->dump(); }
for (uint next2 = 0; next2 < controls.size(); next2++) {

View File

@ -42,7 +42,7 @@
class ShenandoahBarrierSetC1;
class ShenandoahBarrierSetC2;
template <bool STOREVAL_WRITE_BARRIER>
template <bool STOREVAL_EVAC_BARRIER>
class ShenandoahUpdateRefsForOopClosure: public BasicOopIterateClosure {
private:
ShenandoahHeap* _heap;
@ -51,7 +51,7 @@ private:
template <class T>
inline void do_oop_work(T* p) {
oop o;
if (STOREVAL_WRITE_BARRIER) {
if (STOREVAL_EVAC_BARRIER) {
o = _heap->evac_update_with_forwarded(p);
if (!CompressedOops::is_null(o)) {
_bs->enqueue(o);
@ -97,10 +97,10 @@ bool ShenandoahBarrierSet::is_aligned(HeapWord* hw) {
return true;
}
template <class T, bool STOREVAL_WRITE_BARRIER>
template <class T, bool STOREVAL_EVAC_BARRIER>
void ShenandoahBarrierSet::write_ref_array_loop(HeapWord* start, size_t count) {
assert(UseShenandoahGC && ShenandoahCloneBarrier, "should be enabled");
ShenandoahUpdateRefsForOopClosure<STOREVAL_WRITE_BARRIER> cl;
ShenandoahUpdateRefsForOopClosure<STOREVAL_EVAC_BARRIER> cl;
T* dst = (T*) start;
for (size_t i = 0; i < count; i++) {
cl.do_oop(dst++);
@ -114,15 +114,15 @@ void ShenandoahBarrierSet::write_ref_array(HeapWord* start, size_t count) {
if (_heap->is_concurrent_traversal_in_progress()) {
ShenandoahEvacOOMScope oom_evac_scope;
if (UseCompressedOops) {
write_ref_array_loop<narrowOop, /* wb = */ true>(start, count);
write_ref_array_loop<narrowOop, /* evac = */ true>(start, count);
} else {
write_ref_array_loop<oop, /* wb = */ true>(start, count);
write_ref_array_loop<oop, /* evac = */ true>(start, count);
}
} else {
if (UseCompressedOops) {
write_ref_array_loop<narrowOop, /* wb = */ false>(start, count);
write_ref_array_loop<narrowOop, /* evac = */ false>(start, count);
} else {
write_ref_array_loop<oop, /* wb = */ false>(start, count);
write_ref_array_loop<oop, /* evac = */ false>(start, count);
}
}
}
@ -207,10 +207,10 @@ void ShenandoahBarrierSet::write_region(MemRegion mr) {
shenandoah_assert_correct(NULL, obj);
if (_heap->is_concurrent_traversal_in_progress()) {
ShenandoahEvacOOMScope oom_evac_scope;
ShenandoahUpdateRefsForOopClosure</* wb = */ true> cl;
ShenandoahUpdateRefsForOopClosure</* evac = */ true> cl;
obj->oop_iterate(&cl);
} else {
ShenandoahUpdateRefsForOopClosure</* wb = */ false> cl;
ShenandoahUpdateRefsForOopClosure</* evac = */ false> cl;
obj->oop_iterate(&cl);
}
}

View File

@ -35,8 +35,8 @@ class ShenandoahBarrierSet: public BarrierSet {
public:
enum ArrayCopyStoreValMode {
NONE,
READ_BARRIER,
WRITE_BARRIER
RESOLVE_BARRIER,
EVAC_BARRIER
};
private:

View File

@ -199,10 +199,10 @@ bool ShenandoahBarrierSet::arraycopy_loop_3(T* src, T* dst, size_t length, Klass
switch (storeval_mode) {
case NONE:
return arraycopy_loop<T, CHECKCAST, SATB, NONE>(src, dst, length, bound, disjoint);
case READ_BARRIER:
return arraycopy_loop<T, CHECKCAST, SATB, READ_BARRIER>(src, dst, length, bound, disjoint);
case WRITE_BARRIER:
return arraycopy_loop<T, CHECKCAST, SATB, WRITE_BARRIER>(src, dst, length, bound, disjoint);
case RESOLVE_BARRIER:
return arraycopy_loop<T, CHECKCAST, SATB, RESOLVE_BARRIER>(src, dst, length, bound, disjoint);
case EVAC_BARRIER:
return arraycopy_loop<T, CHECKCAST, SATB, EVAC_BARRIER>(src, dst, length, bound, disjoint);
default:
ShouldNotReachHere();
return true; // happy compiler
@ -268,10 +268,10 @@ bool ShenandoahBarrierSet::arraycopy_element(T* cur_src, T* cur_dst, Klass* boun
switch (STOREVAL_MODE) {
case NONE:
break;
case READ_BARRIER:
case WRITE_BARRIER:
// The write-barrier case cannot really happen. It's traversal-only and traversal
// doesn't currently use SATB. And even if it did, it would not be fatal to just do the normal RB here.
case RESOLVE_BARRIER:
case EVAC_BARRIER:
// The evac-barrier case cannot really happen. It's traversal-only and traversal
// doesn't currently use SATB. And even if it did, it would not be fatal to just do the normal resolve here.
prev_obj = ShenandoahBarrierSet::resolve_forwarded_not_null(prev_obj);
}
if (!ctx->is_marked(prev_obj)) {
@ -293,10 +293,10 @@ bool ShenandoahBarrierSet::arraycopy_element(T* cur_src, T* cur_dst, Klass* boun
switch (STOREVAL_MODE) {
case NONE:
break;
case READ_BARRIER:
case RESOLVE_BARRIER:
obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
break;
case WRITE_BARRIER:
case EVAC_BARRIER:
if (_heap->in_collection_set(obj)) {
oop forw = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
if (oopDesc::equals_raw(forw, obj)) {
@ -337,9 +337,9 @@ bool ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_arraycopy
ArrayCopyStoreValMode storeval_mode;
if (heap->has_forwarded_objects()) {
if (heap->is_concurrent_traversal_in_progress()) {
storeval_mode = WRITE_BARRIER;
storeval_mode = EVAC_BARRIER;
} else if (heap->is_update_refs_in_progress()) {
storeval_mode = READ_BARRIER;
storeval_mode = RESOLVE_BARRIER;
} else {
assert(heap->is_idle() || heap->is_evacuation_in_progress(), "must not have anything in progress");
storeval_mode = NONE; // E.g. during evac or outside cycle