RFR: 8189871: Refactor GC barriers to use declarative semantics
Per Liden
per.liden at oracle.com
Fri Nov 10 21:22:53 UTC 2017
On 11/10/2017 07:39 PM, Aleksey Shipilev wrote:
> On 11/10/2017 05:29 PM, Erik Österlund wrote:
>> 1) The barrier resolver loads the current barrier set, and checks the "name" of it (the enum value).
>> 2) Each "name" for concrete barriers that you listed in barrierSetConfig.hpp is asked for...
>> 3) ...the BarrierSet::GetType of that enum "name", and...
>> 4) The AccessBarrier of that resulting BarrierSet (your ShenandoahBarrierSet) will be called.
>
> So, I tried a simpler exercise with Epsilon, and it seems to work:
> http://cr.openjdk.java.net/~shade/epsilon/gc-barriers-declarative.patch
>
> A few comments from that exercise:
>
> *) After the recent BS cleanup, the EpsilonBarrierSet has only a few leftovers [1]. With current
> patch, write_ref_field_work seems to be gone. But write_ref_array_work and write_region_work are
> still used. This removal is deliberately not handled in current patch, right?
Correct, those will be removed in one of Erik's later patches.
>
> *) What is the meaning of AccesssBarrier::Raw like these?
> typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
That's a convenience typedef for use when you want to call the super
class to do raw accesses (i.e. access without GC barriers, other than
potentially encode/decode oops), which you'd typically do inside
AccessBarrier functions for a specific BarrierSet, where those calls are
sandwiched in-between the GC specific barrier logic.
>
> I am asking because it is not unclear if BS should typedef this. Epsilon seems to work fine
> without the declaration. G1SATBCardTableLoggingModRefBS::AccessBarrier has it, but
> CardTableModRefBS::AccessBarrier has not.
In Epsilon you don't needed it since you have no barriers. All you are
doing is just raw accesses which is the default behavior offered by the
super class.
cheers,
Per
>
> Thanks,
> -Aleksey
>
> [1]
> http://hg.openjdk.java.net/jdk/sandbox/file/b2b4df384c83/src/hotspot/share/gc/epsilon/epsilonBarrierSet.hpp
>
More information about the hotspot-dev
mailing list