# HG changeset patch # User rkennke # Date 1558623698 -7200 # Thu May 23 17:01:38 2019 +0200 # Node ID b20405c9efaa976c58f10c814c2d0690275fd1c8 # Parent 617e7f0e370d3ef28465595085c3373ddeca2af5 8224667: Shenandoah: Post-LRB cleanup diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -295,7 +295,7 @@ 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 @@ 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); diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp @@ -93,7 +93,7 @@ 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 @@ 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. diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -1093,7 +1093,7 @@ 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 @@ 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 @@ 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++) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp @@ -42,7 +42,7 @@ class ShenandoahBarrierSetC1; class ShenandoahBarrierSetC2; -template +template class ShenandoahUpdateRefsForOopClosure: public BasicOopIterateClosure { private: ShenandoahHeap* _heap; @@ -51,7 +51,7 @@ template 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 @@ return true; } -template +template void ShenandoahBarrierSet::write_ref_array_loop(HeapWord* start, size_t count) { assert(UseShenandoahGC && ShenandoahCloneBarrier, "should be enabled"); - ShenandoahUpdateRefsForOopClosure cl; + ShenandoahUpdateRefsForOopClosure cl; T* dst = (T*) start; for (size_t i = 0; i < count; i++) { cl.do_oop(dst++); @@ -114,15 +114,15 @@ if (_heap->is_concurrent_traversal_in_progress()) { ShenandoahEvacOOMScope oom_evac_scope; if (UseCompressedOops) { - write_ref_array_loop(start, count); + write_ref_array_loop(start, count); } else { - write_ref_array_loop(start, count); + write_ref_array_loop(start, count); } } else { if (UseCompressedOops) { - write_ref_array_loop(start, count); + write_ref_array_loop(start, count); } else { - write_ref_array_loop(start, count); + write_ref_array_loop(start, count); } } } @@ -207,10 +207,10 @@ shenandoah_assert_correct(NULL, obj); if (_heap->is_concurrent_traversal_in_progress()) { ShenandoahEvacOOMScope oom_evac_scope; - ShenandoahUpdateRefsForOopClosure cl; + ShenandoahUpdateRefsForOopClosure cl; obj->oop_iterate(&cl); } else { - ShenandoahUpdateRefsForOopClosure cl; + ShenandoahUpdateRefsForOopClosure cl; obj->oop_iterate(&cl); } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp @@ -35,8 +35,8 @@ public: enum ArrayCopyStoreValMode { NONE, - READ_BARRIER, - WRITE_BARRIER + RESOLVE_BARRIER, + EVAC_BARRIER }; private: diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp @@ -199,10 +199,10 @@ switch (storeval_mode) { case NONE: return arraycopy_loop(src, dst, length, bound, disjoint); - case READ_BARRIER: - return arraycopy_loop(src, dst, length, bound, disjoint); - case WRITE_BARRIER: - return arraycopy_loop(src, dst, length, bound, disjoint); + case RESOLVE_BARRIER: + return arraycopy_loop(src, dst, length, bound, disjoint); + case EVAC_BARRIER: + return arraycopy_loop(src, dst, length, bound, disjoint); default: ShouldNotReachHere(); return true; // happy compiler @@ -268,10 +268,10 @@ 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 @@ 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 @@ 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