RFR: 8370377: Avoid resolving constant pool entries during preimage generation in the training run
Ashutosh Mehra
asmehra at openjdk.org
Wed Oct 22 02:30:30 UTC 2025
This patch prevents constant pool entries from getting stored in resolved state in the preimage generated by the training run. Now the information about the constant pool entries to be pre-resolved in the assembly phase is only conveyed through FinalImageRecipes, making it easier to trace the resolution of CP entries.
Note that this change broke the pre-resolution of CP entries referred by getfield and putfield bytecodes. This is because `AOTConstantPoolResolver::preresolve_field_and_method_cp_entries` was only looking for `getfield` and `putfield` bytecodes, but during the training run, these bytecodes may get replaced by their "fast" versions by the interpreter, or by the "nofast" versions during preimage dumping. So I have to add cases for handling the "fast" and "nofast" variations of the bytecodes as well.
I also added logging to dump the list of CP entries to be pre-resolved which is stored as part of FinalImageRecipes in preimage.
-------------
Commit messages:
- 8370377: Avoid resolving constant pool entries during preimage generation in the training run
Changes: https://git.openjdk.org/jdk/pull/27927/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27927&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8370377
Stats: 114 lines in 4 files changed: 53 ins; 12 del; 49 mod
Patch: https://git.openjdk.org/jdk/pull/27927.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27927/head:pull/27927
PR: https://git.openjdk.org/jdk/pull/27927
More information about the hotspot-dev
mailing list