Skip to content

ClassFileApiBackend: implement @TargetInstance and Kind.CALL support #844

Description

@jbachorik

Summary

ClassFileApiBackend (the instrumentation backend for Java 26+ class files using the JDK ClassFile API) currently skips handlers that use @TargetInstance or Kind.CALL with a DEBUG-level log message. These two features are already supported by the ASM-based backend (AsmInstrumentationBackend).

This issue tracks the work needed to bring ClassFileApiBackend to feature parity for:

  • @TargetInstanceom.getTargetInstanceParameter() != -1: inject the target object reference before the INVOKEDYNAMIC call.
  • Kind.CALLKind.CALL location: inject probe calls around method call sites within the instrumented method, matching ClassFile API's instruction-level code transform.

Context

PR #843 implemented @Return and @Duration support in ClassFileApiBackend. The guard for @TargetInstance and Kind.CALL was intentionally left in place with a skip-log, pending this issue.

This issue must be resolved before ClassFileApiBackend is considered fully feature-equivalent to AsmInstrumentationBackend.

Acceptance criteria

  • Handlers with @TargetInstance fire correctly for non-static method probes
  • Kind.CALL handlers fire around method call sites
  • Tests added covering both features with @EnabledForJreRange / assumeTrue for JDK 26+
  • Class-level Javadoc in ClassFileApiBackend updated (move features from unsupported list to supported list)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions