RFR: 8268125: ZGC: Clone oop array gets wrong acopy stub [v4]
Nils Eliasson
neliasso at openjdk.java.net
Mon Jun 14 14:25:50 UTC 2021
On Mon, 14 Jun 2021 14:17:17 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:
>> Hi,
>>
>> This fixes a problem I introduced with JDK-8267726. With that change clone oop array is treated as normal clone arrays with ZGC. I missed that a case was missing in zBarrierSetC2::clone_at_expansion - which caused clone_oop-arrays to get the wrong array copy stub.
>>
>> In this fix I move the entire leaf call creation inside zBarrierSetC2, and leave BarrierSetC2 as is. In this way I don't have to change anything for the other collectors.
>>
>> Please review,
>> Best regards,
>> Nils Eliasson
>
> Nils Eliasson has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove whitespace
I've added an assert(StressReflectiveCode, "...") for the clone_at_expansion case when we don't find an TypeAryPtr. This case only happens with StressReflectiveCode and the code generated is unreachable, but not yet removed.
It happens because the StressReflectiveCode flag prevents the check for array to be resolved at compile time - leaving an unfolded check in compiled code. inline_clone will create a clone with cases for both array and oop. On the array path there will be an allocate_array with a checkcast to an oop, and an arraycopy without a TypeAryPtr on the src and dest. That code is unreachable - but must be tolerated.
Please review,
Nils Eliasson
-------------
PR: https://git.openjdk.java.net/jdk/pull/4359
More information about the hotspot-dev
mailing list