RFR: 8294982: Implementation of Classfile API [v36]

Adam Sotona asotona at openjdk.org
Tue Mar 7 08:38:03 UTC 2023


On Mon, 6 Mar 2023 17:45:27 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> I see what you mean. `transforming` was selected to represent the continuation of the code building process, similar to `trying` and `catching`. While `transform` may imply that the actual code builder gets transformed into something else. For example `MethodModel::transformCode` takes `CodeModel`, applies `CodeTransform` and after that the code of the actual method is finished.
>> What about `transformBlock(BlockCodeBuilder, CodeTransform)`?
>
> I am unsure how you might use `BlockCodeBuilder`. If the current signature is not changed then `transformFromHandler` seems reasonable (since its the handler that pushes elements into its given builder).
> 
> The other `transform` is implicitly "transform model".

I'm sorry my answer was inaccurate, what I'm proposing is `transformBlock(Consumer<BlockCodeBuilder>, CodeTransform)` or `transformedBlock(Consumer<BlockCodeBuilder>, CodeTransform)`. `BlockCodeBuilder` is just an extension of `CodeBuilder` with ability to break block execution.
Block is a sub-unit of code, so I expect it would be a logical extension of the actual `block(Consumer<BlockCodeBuilder>`.
I'll move this discussion to the mailing list to make common decision about API change.
Thanks.

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

PR: https://git.openjdk.org/jdk/pull/10982



More information about the build-dev mailing list