[0.54] Detect any monitorenter before point of dynamic loop transfers - #22317
Merged
vijaysun-omr merged 1 commit intoJul 28, 2025
Conversation
Dynamic loop transfer can transfer control from the interpreter into a JIT-compiled method after the point at which monitorenter bytecode instructions have been executed. With Java 24 and later, the JVM uses the JIT's live monitor metadata to locate monitors that might need to be detached from carrier threads when the owning virtual thread is unmounted. This is enabled if the J9_EXTENDED_RUNTIME3_YIELD_PINNED_CONTINUATION flag is set in extendedRuntimeFlags3, which can be turned off by specifying the option -XX:-YieldPinnedVirtualThreads. If the JIT is unable to determine that no monitorenters will be executed prior to the entry point for dynamic loop transfer, it must fail the compilation. This change follows predecessor paths in the CFG from the blocks identified as potential DLT entry points to see whether a monitorenter could have been encountered before the DLT occurred. If that might be possible, the compilation fails. Also, if the JVM requires correct live monitor maps, force the disableLiveMonitorMetadata JIT option off. Finally, the disableInlineMonEnt and disableInlineMonExit options can be set in a fashion that's specific to a particular method compilation. Whether they should be forced off needs to be considered earlier in J9::Options::feLatePostProcess. Signed-off-by: Henry Zongaro <zongaro@ca.ibm.com>
hzongaro
requested review from
0xdaryl and
vijaysun-omr
and removed request for
0xdaryl
July 28, 2025 13:36
Member
Author
|
@vijaysun-omr, may I ask you to merge this change to the 0.54.0-release branch? |
vijaysun-omr
approved these changes
Jul 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dynamic loop transfer can transfer control from the interpreter into a JIT-compiled method after the point at which
monitorenterbytecode instructions have been executed. With Java 24 and later, the JVM uses the JIT's live monitor metadata to locate monitors that might need to be detached from carrier threads when the owning virtual thread is unmounted.If the JIT is unable to determine that no
monitorenters will be executed prior to the entry point for dynamic loop transfer, it must fail the compilation.Fixes: #22266
Port of pull request #22291 to v0.54.0-release branch