RFR: 8275868: ciReplay: Inlining fails with "unloaded signature classes" due to wrong protection domains
Christian Hagedorn
chagedorn at openjdk.java.net
Thu Oct 28 15:08:32 UTC 2021
Replay compilation can fail to inline a method which was inlined in the normal run due to unresolved classes in the signature of an inlinee. The reason is that ciReplay is not resolving Java API classes with the protection domain of the holder class of the method to be replay compiled. Compiler replay is currently only resolving classes without a protection domain (i.e. an empty handle):
https://github.com/openjdk/jdk/blob/593401fe8b38bbb8d331a862818fe077af157fcb/src/hotspot/share/ci/ciReplay.cpp#L139-L142
A more detailed description can be found in the description of [JDK-8275868](https://bugs.openjdk.java.net/browse/JDK-8275868).
This patch fixes that and takes the protection domain of the holder class of the method to be compiled to resolve all other classes used for ciReplay. The unloaded classes check is done in `ciMethod::has_unloaded_classes_in_signature()` and bypasses the whitelist introduced by JDK-8262912. However, this is fine since the inlining decision is enforced by the inlining information in the replay file.
To test the various scenarios mentioned in the description of JDK-8275868, I've added some support to use `DumpReplay` to not require a crash. I parse the inlining information from the hotspot log file to check that ciReplay applies the same inlining decisions as the normal run.
Thanks,
Christian
-------------
Commit messages:
- 8275868: ciReplay: Inlining fails with "unloaded signature classes" due to wrong protection domains
Changes: https://git.openjdk.java.net/jdk/pull/6159/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6159&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8275868
Stats: 438 lines in 5 files changed: 434 ins; 0 del; 4 mod
Patch: https://git.openjdk.java.net/jdk/pull/6159.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6159/head:pull/6159
PR: https://git.openjdk.java.net/jdk/pull/6159
More information about the hotspot-compiler-dev
mailing list