[code-reflection] RFR: OpBuilder optimizations - part 1. [v12]

Mourad Abbay mabbay at openjdk.org
Wed Nov 19 12:08:09 UTC 2025


On Wed, 19 Nov 2025 09:57:34 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> This PR include following changes:
>> 
>> - op-building methods delegate to a synthetic inner class
>> - fixed boxing in `OpBuilder`
>> - op-building methods are generated by `BytecodeGenerator` and support wide range of ops
>> - `CodeModelTranslator` is deleted
>> - synthetic op-building method overrides significantly reduce overhead (by 60% on `TestBytecode`)
>> - refactored `OpBuilder` to build `ModuleOp` instead of individual `FuncCallOp`s 
>> - fixed `BytecodeGenerator` to support `ModuleOp` and `FuncCallOp`
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fixed javadoc

src/jdk.incubator.code/share/classes/jdk/incubator/code/internal/ReflectMethods.java line 214:

> 212:     @Override
> 213:     public void visitClassDef(JCClassDecl tree) {
> 214:         ListBuffer<JCTree> prevClassOps = opMethodDecls;

Can you rename the variable `prevClassOps` to `prevOpMethodDecls` ?

src/jdk.incubator.code/share/classes/jdk/incubator/code/internal/ReflectMethods.java line 217:

> 215:         SequencedMap<String, Op> prevOps = ops;
> 216:         Symbol.ClassSymbol prevClassSym = currentClassSym;
> 217:         Symbol.ClassSymbol prevSynthClassSym = codeModelsClassSym;

`prevSynthClassSym` to `prevCodeModelsClassSym` ?

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

PR Review Comment: https://git.openjdk.org/babylon/pull/679#discussion_r2541719299
PR Review Comment: https://git.openjdk.org/babylon/pull/679#discussion_r2541725970


More information about the babylon-dev mailing list