[code-reflection] RFR: Support storing the code that builds the code model [v18]

Mourad Abbay mabbay at openjdk.org
Sat Mar 15 02:41:08 UTC 2025


On Thu, 13 Mar 2025 13:27:28 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Mourad Abbay has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 20 additional commits since the last revision:
>> 
>>  - Merge branch 'code-reflection' into code-model-storage-option
>>  - Load OpFactory and TypeElementFactory before invocation of opMethod only if the opMethod has there params.
>>  - Fix the remaining compiler tests failures
>>  - Fix some of the test failures (3 remains)
>>  - Fix the remaining test failures of SwitchExpressionTest2
>>  - Fix almost all test failures of SwitchExpressionTest2 (one remaining)
>>  - Pass arrayType instead of eleType in OpBuilder.buildArray
>>  - Ensure that block params are inserted in the correct order
>>  - Add missing imports
>>  - Merge branch 'code-reflection' into code-model-storage-option
>>  - ... and 10 more: https://git.openjdk.org/babylon/compare/c9d98dd5...966005ce
>
> 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.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/305#discussion_r1996522797


More information about the babylon-dev mailing list