RFR: 8263361: Incorrect arraycopy stub selected by C2 for SATB collectors
Erik Österlund
eosterlund at openjdk.java.net
Mon Mar 15 15:40:08 UTC 2021
On Mon, 15 Mar 2021 14:03:09 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:
>> There is a bit of a conceptual disconnect in the code. In generate_arraycopy dest_uninitialized is set only when the allocation isn't already "complete" - that is we haven't already been able to prove that no zeroing is neccessary. Clones will for example create complete allocations from the beginning - but they aren't initialized.
>>
>> The code that is guarded by dest_uninitialized will add zeroing for the array allocation that is outside the copy range. The part that is inside the copy range will still not be initialized. (But that is ok - since dest_uninitialized is set).
>>
>> The problem here is that there are acopies that are proven to be complete from the beginning (like clones) that will copy uninitialized memory - and they don't need anything of the zeroing code that is guarded by dest_uninitialized.
>
> My plan is to rename dest_uninitialized to dest_needs_zeroing and add a separate variable for when the acopy is done to uninitilialized memory.
Sounds like a good plan!
-------------
PR: https://git.openjdk.java.net/jdk/pull/3008
More information about the hotspot-compiler-dev
mailing list