Skip to content

Support new Java 21 INVOKEDYNAMIC bootstrap methods #334

Description

@johannesduesing

Describe the Problem
Java 21 has introduced new types of bootstrap methods for switch statements. There is at least the java/lang/runtime/SwitchBootstraps class that is currently not supported by the InvokeDynamicRewriting of OPAL. This is not a functional problem, as the instruction will simply not be rewritten - rewriting is a "best-effort" approach. However, we do have an integration test case in the InvokedymamicRewritingTest that assumes we can rewrite every INVOKEDYNAMIC in the current Java Base. This is no longer true for Java 21+, so the integration test fails.

Solution you'd like
Support the rewriting of new bootstrap methods added in Java 21 and above. If rewriting is not always possible, change the test case assumption that we no longer assume we can rewrite all INVOKEDYNAMICs of every Java version.

Activity

  1. changed the title [-]Support new Java 21 INVOKEDYNAMIC types[/-] [+]Support new Java 21 INVOKEDYNAMIC bootstrap methods[/+] on Oct 9, 2025
  2. errt commented on Oct 9, 2025

    @errt
    Collaborator

    There are also new forms of invokedynamic in recent Scala versions that should be considered

  3. errt commented on Sep 22, 2026

    @errt
    Collaborator

    Given its rising popularity, a look into Kotlin and its bootstrap methods may also be a good idea.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions