RFR: 8209883: ZGC: Compile without C1 broken
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Aug 23 18:14:43 UTC 2018
Thank you, Aleksey
Vladimir
On 8/23/18 10:59 AM, Aleksey Shipilev wrote:
> On 08/23/2018 06:44 PM, Vladimir Kozlov wrote:
>> Can you explain where ZBarrierSetC1 declaration will come if zBarrierSetC1.hpp is not included?
>
> (not Per, but I'll try to answer)
>
> There are two forward declarations:
>
> 39 class ZBarrierSetC1;
> 40 class ZBarrierSetC2;
>
> These are enough, i.e. no need for definition, because make_barrier_set() would handle paths with
> COMPILER{1,2} disabled.
>
> Pretty much every other *BarrierSet.cpp does the same. See e.g. g1BarrierSet.cpp:
>
> #include "utilities/macros.hpp"
> #ifdef COMPILER1
> #include "gc/g1/c1/g1BarrierSetC1.hpp"
> #endif
> #ifdef COMPILER2
> #include "gc/g1/c2/g1BarrierSetC2.hpp"
> #endif
>
> class G1BarrierSetC1;
> class G1BarrierSetC2;
>
> G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
> CardTableBarrierSet(make_barrier_set_assembler<G1BarrierSetAssembler>(),
> make_barrier_set_c1<G1BarrierSetC1>(),
> make_barrier_set_c2<G1BarrierSetC2>(),
>
> Thanks,
> -Aleksey
>
More information about the hotspot-gc-dev
mailing list