fix(core): Don't inline invokedynamic bootstrap methods in alias analysis - #309
Draft
misonijnik wants to merge 3 commits into
Draft
fix(core): Don't inline invokedynamic bootstrap methods in alias analysis#309misonijnik wants to merge 3 commits into
misonijnik wants to merge 3 commits into
Conversation
misonijnik
marked this pull request as draft
July 24, 2026 12:31
misonijnik
force-pushed
the
misonijnik/fix-nested-call-arg-idx
branch
from
July 24, 2026 15:27
447ade2 to
ba57918
Compare
…analysis
Alias analysis crashed with IllegalStateException("Incorrect argument
idx: 4")
while analyzing record-bearing code (e.g. Netflix Conductor's openai.api
package). A record's auto-generated equals/hashCode/toString lowers to
an
invokedynamic bootstrapped by java.lang.runtime.ObjectMethods.bootstrap,
which
declares six parameters while the dynamic call site supplies one.
resolveCallNoCache resolved that call to the six-parameter bootstrap and
inlined
it; NestedCallInstEvalCtx then mapped the callee's parameters onto the
one-element call.args and indexed past the end, aborting the whole
package
unit's alias analysis (on Conductor this silently suppressed ~60% of
findings).
Guard at the resolution boundary: never inline a callee that declares
more
parameters than the call site provides, since its parameters cannot be
soundly
mapped onto the arguments. The call becomes opaque for alias analysis --
the
conservative default for an unanalyzable callee -- and createArg's
out-of-range
check stays a genuine invariant assertion rather than a silent fallback
that
fabricates alias facts.
Baked by test: AliasSampleTest.`record invokedynamic bootstrap does not
overflow
alias arg mapping` inlines Payload.hashCode() at depth 2 and asserts the
analysis
does not throw; it fails with "Incorrect argument idx" when the guard is
removed.
The alias samples module moves to Java 17 so record samples compile --
existing
samples use no invokedynamic constructs and their behaviour is unchanged
(full
AliasSampleTest green).
misonijnik
force-pushed
the
misonijnik/fix-nested-call-arg-idx
branch
from
August 3, 2026 06:02
ba57918 to
1244158
Compare
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.
No description provided.