Add minimal support for dynamic invokedynamic bootstrap methods#612
Open
LeaderOne369 wants to merge 1 commit intojavapathfinder:java-17from
Open
Add minimal support for dynamic invokedynamic bootstrap methods#612LeaderOne369 wants to merge 1 commit intojavapathfinder:java-17from
LeaderOne369 wants to merge 1 commit intojavapathfinder:java-17from
Conversation
Author
|
Hi, this PR is intended as a small first step toward the Java 11/17 bootstrap-method support direction. I kept the scope deliberately narrow so the behavior is easier to review: generic |
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.
Summary
This PR implements a baseline execution path for generic invokedynamic bootstrap methods (BMType.DYNAMIC) on the java-17 branch. It addresses the current limitation where JPF only handles hardcoded cases like Lambdas or StringConcat, providing a foundation for broader Java 11/17 support.
Key Changes
Core Logic: Implemented INVOKEDYNAMIC.executeDynamicBootstrap(...) to handle a minimal supported subset of dynamic calls.
Regression Tests: Added InvokeDynamicBootstrapTest using ASM to generate invokedynamic call sites that standard Java compilers typically don't produce.
Technical Coverage:
Support for no-arg and String argument dynamic bootstrap call sites.
Handling of bootstrap static arguments.
Proper management of double (double-slot) stack values.
Record Fix: Restored java.lang.runtime.ObjectMethods.bootstrap to the dedicated RECORDS path to prevent interference with existing record behavior.
Scope & Limitations
To keep this initial PR reviewable, the scope is restricted to:
Static bootstrap methods.
CallSite returns (specifically ConstantCallSite).
Conversion for primitives, boxed primitives, and String on the exercised paths.
Testing
Verified via:
java11.InvokeDynamicBootstrapTest
java11.DynamicBootstrapSupport
Full local suite: ./gradlew test
Context
While JPF has special-case handling for specific bootstrap-based features, generic dynamic bootstrap execution was missing. This PR provides the necessary plumbing and testing infrastructure to begin supporting more complex Java 11+ bootstrap scenarios.