Skip to content

fix: handle invokeBasic target signature mismatch - #111

Merged
taofengliu merged 1 commit into
jeandle:mainfrom
xiejf2020:fix-invokebasic-cha
Sep 18, 2026
Merged

taofengliu merged 1 commit into
jeandle:mainfrom
xiejf2020:fix-invokebasic-cha

Conversation

@xiejf2020

@xiejf2020 xiejf2020 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Fix _invokeBasic CHA devirtualization for adapted MethodHandles whose wrapper signature differs from the target method signature. The optimizer now resolves the concrete MethodHandle target, validates the target argument types, rebuilds the direct call with the target’s actual function type, and safely handles discarded return values for void wrappers. Ordinary _linkTo* CHA handling remains unchanged. This keeps the generated LLVM call type consistent with the real Java target and avoids correctness failures caused by reusing the outer wrapper signature.

@mergify

mergify Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 2 merge protections satisfied — ready to merge.

Show 2 satisfied protections

🟢 Require a review from a maintainer.

  • approved-reviews-by = @Maintainer

🟢 Pull request title format.

  • title ~= ^(fix|feat|docs|style|refactor|enhance|test|build|ci|chore|revert):

@xiejf2020

Copy link
Copy Markdown
Contributor Author

jdk-dependent needed

@rcjhd rcjhd added the jdk-dependent Don't run JDK tests in this PR. label Sep 4, 2026
Rebuild invokeBasic calls with the actual MethodHandle target signature instead of reusing the outer wrapper signature.

Signed-off-by: xiejf2020 <xiejf2020@outlook.com>
@mergify

mergify Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@taofengliu
taofengliu merged commit ee6f858 into jeandle:main Sep 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jdk-dependent Don't run JDK tests in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants