Skip to content

Add minimal support for dynamic invokedynamic bootstrap methods#612

Open
LeaderOne369 wants to merge 1 commit intojavapathfinder:java-17from
LeaderOne369:feature/lixing-dynamic-bootstrap
Open

Add minimal support for dynamic invokedynamic bootstrap methods#612
LeaderOne369 wants to merge 1 commit intojavapathfinder:java-17from
LeaderOne369:feature/lixing-dynamic-bootstrap

Conversation

@LeaderOne369
Copy link
Copy Markdown

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.

@LeaderOne369
Copy link
Copy Markdown
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 BMType.DYNAMIC, static bootstrap methods, ConstantCallSite, and regression tests for a few representative call-site shapes. I’d be very happy to refine the scope or split follow-up work further if that would make review easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant