[code-reflection] RFR: Replace opField with opMethod for lambdas.

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Jan 6 14:02:05 UTC 2025


On Mon, 6 Jan 2025 13:56:32 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> We replace field holding the textual representation of an identified lambda with method that returns the representation of that lambda.
>
> src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 495:
> 
>> 493:                 Class<?> quotedHelper = layer.findLoader("jdk.incubator.code")
>> 494:                         .loadClass("jdk.incubator.code.internal.QuotedHelper");
>> 495:                 Class<?> funcOp = layer.findLoader("jdk.incubator.code")
> 
> Maybe we should try to call `findLoader` only once and cache the result?

In fact, perhaps all these classes should be moved to static fields in the inner class `CodeReflectonSupport`, which is used for similar purposes?

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/301#discussion_r1904183667


More information about the babylon-dev mailing list