[lworld] RFR: 8228361: [lworld] Optimize the substitutability check in C2 [v3]

Tobias Hartmann thartmann at openjdk.org
Thu Dec 18 14:00:14 UTC 2025


On Thu, 18 Dec 2025 13:42:19 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> C2 will now remove the slow call to `ValueObjectMethods::isSubstitutable(Alt)` whenever it's able to determine the layout of one of the operands. It will then emit code to directly compare the fields.
>> 
>> This patch also contains an intrinsic for `_getFieldMap` that will be used by the new core-libs implementation of the substitutability check ([JDK-8370450](https://bugs.openjdk.org/browse/JDK-8370450)) that's used by the interpreter / C1 and as a slow path in C2.
>> 
>> When browsing code, I marked a few rough edges in unrelated code for follow-up cleanups with the corresponding bug numbers.
>> 
>> Testing: tier1-tier6 + valhalla-comp-stress
>> 
>> Thanks,
>> Tobias
>
> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Adjustments according to review comments

Thanks again Christian!

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

PR Comment: https://git.openjdk.org/valhalla/pull/1823#issuecomment-3670411758


More information about the valhalla-dev mailing list