Repository navigation
[JVM] Unbox lambda invocation arguments before implementation dispatch - #606
Open
CaelmBleidd wants to merge 1 commit into
Open
CaelmBleidd wants to merge 1 commit into
CaelmBleidd wants to merge 1 commit into
Conversation
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.
A method reference such as
Predicate<Integer> p = Character::isWhitespacecurrently passes an object reference directly into the primitiveintimplementation parameter. RealWordUtilsanalysis aborts with a register sort mismatch. Generic unboxing followed by widening also needs the instantiated method type, distinct from the erased SAM signature.Dispatch using the erased signature and adapt invocation arguments using the instantiated signature before entering the implementation. Primitive wrapper unboxing preserves null and class-cast checks and uses the existing primitive conversion operators. The adaptation runs in its own machine step after receiver dispatch, so its exception forks belong to the selected state. Ordinary method/model dispatch remains in the existing concrete-call path.
Depends on JacoDB#449, pinned to
1822dea851: its typed lambda builder previously exchanged erased and instantiated method types. There is no guessed wrapper or exception-to-fresh fallback.Validation: the ordinary Java
Character::isWhitespacesource reproduces the same sort mismatch before the change. All 4 focused regressions pass against the exact JacoDB source composite: original reproduction, nullable argument/NPE, unboxing thenint -> longwidening, and a primitive SAM control. No full suite was run.