RFR(XL): 8224675: Late GC barrier insertion for ZGC

Nils Eliasson nils.eliasson at oracle.com
Wed May 29 07:56:15 UTC 2019


Thanks Per,

I put a new webrev here: 
http://cr.openjdk.java.net/~neliasso/8224675/webrev.02/

/ Nils

On 2019-05-28 14:58, Per Liden wrote:
> Hi Nils,
>
> We should now also be able to remove the following ugly hacks (yay!):
>
> diff --git a/src/hotspot/share/classfile/vmSymbols.cpp 
> b/src/hotspot/share/classfile/vmSymbols.cpp
> --- a/src/hotspot/share/classfile/vmSymbols.cpp
> +++ b/src/hotspot/share/classfile/vmSymbols.cpp
> @@ -778,9 +778,6 @@
>  #endif // COMPILER1
>  #ifdef COMPILER2
>    case vmIntrinsics::_clone:
> -#if INCLUDE_ZGC
> -    if (UseZGC) return true;
> -#endif
>    case vmIntrinsics::_copyOf:
>    case vmIntrinsics::_copyOfRange:
>      // These intrinsics use both the objectcopy and the arraycopy
> diff --git a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp 
> b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
> --- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
> +++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
> @@ -462,7 +462,6 @@
>    }
>
>    bool weak = (access.decorators() & ON_WEAK_OOP_REF) != 0;
> -  assert(access.is_parse_access(), "entry not supported at 
> optimization time");
>    if (p->isa_Load()) {
>      p->as_Load()->set_barrier(weak);
>    }
> diff --git a/src/hotspot/share/runtime/stackValue.cpp 
> b/src/hotspot/share/runtime/stackValue.cpp
> --- a/src/hotspot/share/runtime/stackValue.cpp
> +++ b/src/hotspot/share/runtime/stackValue.cpp
> @@ -133,11 +133,6 @@
>        }
>  #endif
>        // Deoptimization must make sure all oops have passed load 
> barriers
> -#if INCLUDE_ZGC
> -      if (UseZGC) {
> -        val = 
> ZBarrier::load_barrier_on_oop_field_preloaded((oop*)value_addr, val);
> -      }
> -#endif
>  #if INCLUDE_SHENANDOAHGC
>        if (UseShenandoahGC) {
>          val = 
> ShenandoahBarrierSet::barrier_set()->load_reference_barrier(val);
>
> cheers,
> Per
>
> On 5/24/19 11:41 AM, Nils Eliasson wrote:
>> Hi Per,
>>
>> I removed the code and updated the webrev.
>>
>> Thanks,
>>
>> Nils
>>
>> On 2019-05-23 21:32, Per Liden wrote:
>>> Hi Nils,
>>>
>>> On 2019-05-23 16:25, Nils Eliasson wrote:
>>> [...]
>>>> The wart that was fixup_partial_loads in zHeap has also been made 
>>>> redundant.
>>>
>>> We should also be able to remove the function, task and closure for 
>>> this:
>>>
>>>  327 class ZFixupPartialLoadsClosure : public ZRootsIteratorClosure {
>>>  328 public:
>>>  329   virtual void do_oop(oop* p) {
>>>  330     ZBarrier::mark_barrier_on_root_oop_field(p);
>>>  331   }
>>>  332
>>>  333   virtual void do_oop(narrowOop* p) {
>>>  334     ShouldNotReachHere();
>>>  335   }
>>>  336 };
>>>  337
>>>  338 class ZFixupPartialLoadsTask : public ZTask {
>>>  339 private:
>>>  340   ZThreadRootsIterator _thread_roots;
>>>  341
>>>  342 public:
>>>  343   ZFixupPartialLoadsTask() :
>>>  344       ZTask("ZFixupPartialLoadsTask"),
>>>  345       _thread_roots() {}
>>>  346
>>>  347   virtual void work() {
>>>  348     ZFixupPartialLoadsClosure cl;
>>>  349     _thread_roots.oops_do(&cl);
>>>  350   }
>>>  351 };
>>>  352
>>>  353 void ZHeap::fixup_partial_loads() {
>>>  354   ZFixupPartialLoadsTask task;
>>>  355   _workers.run_parallel(&task);
>>>  356 }
>>>
>>> cheers,
>>> Per
>>>
>>>> Testing:
>>>>
>>>> Hotspot tier 1-6, CTW, jcstress, micros, runthese, kitchensink, and 
>>>> then some. All with -XX:+ZVerifyViews.
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8224675
>>>>
>>>> Webrev: http://cr.openjdk.java.net/~neliasso/8224675/webrev.01/
>>>>
>>>>
>>>> Please review,
>>>>
>>>> Regards,
>>>>
>>>> Nils
>>>>


More information about the hotspot-compiler-dev mailing list