[code-reflection] RFR: Support storing the code that builds the code model [v18]
    Mourad Abbay 
    mabbay at openjdk.org
       
    Sat Mar 15 02:45:04 UTC 2025
    
    
  
On Sat, 15 Mar 2025 02:38:37 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java line 453:
>> 
>>> 451:         }
>>> 452:         if (quotableOpGetterInfo.getMethodType().parameterList().equals(List.of(CodeReflectionSupport.OP_FACTORY_CLASS,
>>> 453:                 CodeReflectionSupport.TYPE_ELEMENT_FACTORY_CLASS))) {
>> 
>> If these fields are public/static, why don't we load them from inside the compiler-generated method, instead of injecting them here?
>
> I am assuming by the compiler-generated method you mean `opMethod`. The `opMethod` has two params (OpFactory, TypeElementFactory), so loading these fields is necessary before invoking it.
We can turn opMethod into one with no param and load these fields inside its body. But this removes the flexibility we have now (i.e. we can choose the OpFactory and TypeElementFactory we want to pass).
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/305#discussion_r1996523587
    
    
More information about the babylon-dev
mailing list