[code-reflection] RFR: Lambda model uniqueness [v4]
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue May 6 11:04:38 UTC 2025
On Sun, 4 May 2025 13:49:46 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:
>> Lambdas that share the same proxy class, have the same implementation and therefore have the same code model generated by the compiler. In this PR, we share the code model across instances of the same proxy class.
>> This also means we reduce execution time as we only need to invoke `opMethod` once for given proxy class.
>> With these changes we can compare lambda code model based on identity.
>
> Mourad Abbay has updated the pull request incrementally with one additional commit since the last revision:
>
> Create Quoted object lazily
src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 496:
> 494: // push the receiver on the stack for operand of put field instruction
> 495: cob.aload(0)
> 496: // load class data: CodeReflectionSupport.HANDLE_MAKE_QUOTED
Who uses `generateQuotedFieldInitializer` ?
src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 691:
> 689: }
> 690:
> 691: private void createQuotedObj(CodeBuilder cob) {
Seems like the code here duplicates `generateQuotedFieldInitializer`
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/420#discussion_r2075225001
PR Review Comment: https://git.openjdk.org/babylon/pull/420#discussion_r2075227202
More information about the babylon-dev
mailing list