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

Tobias Hartmann thartmann at openjdk.org
Thu Dec 18 13:42:19 UTC 2025


> 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

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1823/files
  - new: https://git.openjdk.org/valhalla/pull/1823/files/4f8556c7..35757d7f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1823&range=02
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1823&range=01-02

  Stats: 37 lines in 3 files changed: 3 ins; 0 del; 34 mod
  Patch: https://git.openjdk.org/valhalla/pull/1823.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1823/head:pull/1823

PR: https://git.openjdk.org/valhalla/pull/1823


More information about the valhalla-dev mailing list