RFR: 8332527: ZGC: generalize object cloning logic [v2]

Tobias Hartmann thartmann at openjdk.org
Thu May 23 07:50:06 UTC 2024


On Tue, 21 May 2024 09:17:16 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> This changeset generalize the logic to produce a runtime call to clone a class instance so that it can be shared by other collectors adopting the late barrier expansion model (including G1 in the near future, see [JEP 475](https://openjdk.org/jeps/475)). The changeset moves the logic from `ZBarrierSetC2` to the GC-shared `BarrierSetC2` class and adds support for 32-bits platforms.
>> 
>> #### Testing
>> 
>> - tier1-3 (windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64; release and debug mode).
>> - tier4-7 (linux-x64, linux-aarch64; release and debug mode; ZGC tests only).
>> - `compiler/arraycopy` tests (linux-x86-debug) with [an additional patch](https://github.com/openjdk/jdk/commit/ddcf777894e740b8e6ddbbf8821e82a173c23ef4) that implements cloning of large class instances with a runtime clone call rather than arraycopy when using G1 (to exercise the generalized logic on a 32-bits platform).
>
> Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Applied Axel's suggestions

Thanks for digging up the history, Roberto. Now I remember working on [JDK-8270098](https://bugs.openjdk.java.net/browse/JDK-8270098). As we discussed offline, we still need that fix because even though these bytecodes are no longer generated by the reflection API (and javac), they might still be generated "manually". We should add some corresponding .jasm tests.

I agree with your suggestion to limit the scope of this PR and create a follow-up RFE/bug.

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

PR Comment: https://git.openjdk.org/jdk/pull/19311#issuecomment-2126451613


More information about the hotspot-gc-dev mailing list