RFR: 8334060: Implementation of Late Barrier Expansion for G1 [v20]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Mon Sep 16 16:49:25 UTC 2024


On Fri, 13 Sep 2024 23:14:19 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix a few style issues
>
> src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp line 241:
> 
>> 239:   assert(newval_bottom->isa_ptr() || newval_bottom->isa_narrowoop(), "newval should be an OOP");
>> 240:   TypePtr::PTR newval_type = newval_bottom->make_ptr()->ptr();
>> 241:   uint8_t barrier_data = store->barrier_data();
> 
> Should you check barrier data for 0?
> `is_ptr()` has wide set of types. It includes TypeRawPtr, TypeKlassPtr and TypeMetadataPtr. Where you filtering them?

I added the check and excluded other pointers than OOPs, narrow OOPs, and null pointers (needed because null in uncompressed OOP mode is typed as `AnyPtr`) in commit 10bc0d2c. Note that these checks are not strictly required for correctness, because for all other pointers the corresponding barrier data would be 0, and the only potential operations over it would be bit clearing. But I still think they have value in that they communicate more clearly the intent and scope of the optimization.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19746#discussion_r1761494258


More information about the hotspot-dev mailing list