[code-reflection] RFR: Drop ClosureOp and ClosureOpCall

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Nov 7 10:43:30 UTC 2025


On Fri, 7 Nov 2025 10:33:18 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> As we have dropped support for quoted structured lambdas, the corresponding code model `ClosureOp` is no longer used and can be removed as well. That also drags `ClosureOpCall`, as that op is only used to call closure ops. And the related `TestClosureOps` test.
> 
> I didn't find any occurence of the removed class in examples/HAT.

When looking at this, I was a bit surprised to see that some core ops implement interfaces defined by `JavaOp`. This happens in the following cases:

* VarOp <: JavaStatement
* VarAccessOp <: JavaAccessOp
* VarLoadOp <: JavaExpression
* VarStoreOp <: JavaStatement
* ReturnOp <: JavaStatement
* ConstantOp <: JavaExpression

It all makes sense of course (unless we want to create duplication in the IR) -- I just found it a bit odd conceptually that some "core" operations are subtypes of "derived" operations. Mixing dialects is hard :-)

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

PR Comment: https://git.openjdk.org/babylon/pull/668#issuecomment-3501797383


More information about the babylon-dev mailing list