[code-reflection] RFR: Single method to append an operation to a block builder

Paul Sandoz psandoz at openjdk.org
Wed Jul 9 20:19:26 UTC 2025


Reduce the number of methods to append an operation to a block builder down to a single method.

`Block.Builder` no longer extends from `Function<Op, Op.Result>`, thereby removing the `apply(Op op)` method which just deferred to `op(Op op)`, and when to use which caused confusion. The functional abstraction can be achieved with `Block.Builder::op`.

Remove the method `op` method that accepts a operation transformer, overriding the builder's transformer. This was another source of confusion. For the more advanced cases where a different transformer is required, the builder can be rebound to a new builder with a different transformer.

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

Commit messages:
 - Update triton ops.
 - Block.Builder does not implement Function
 - Remove ops method
 - Remove block.op accepting transformer.

Changes: https://git.openjdk.org/babylon/pull/491/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=491&range=00
  Stats: 202 lines in 13 files changed: 1 ins; 80 del; 121 mod
  Patch: https://git.openjdk.org/babylon/pull/491.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/491/head:pull/491

PR: https://git.openjdk.org/babylon/pull/491


More information about the babylon-dev mailing list