[code-reflection] RFR: Hide implementation computing global names

Paul Sandoz psandoz at openjdk.org
Wed Jan 31 23:18:31 UTC 2024


`OpWriter` is updated to accept a function for computing the names of blocks and values, which is also made accessible.

The default implement is now embedded in `OpWriter`, so we can remove the writer impl package. 

A separate method is added to compute the global names for blocks and values using the same algorithm that `OpWriter` uses.  This is useful for debugging when names need to be printed in context to the textual form of the model.

A new top-level sealed class `CodeItem` was introduced so we can refer to either blocks or values without resorting to `Object`. We shall see if this remains a useful top-level abstraction.

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

Commit messages:
 - Hide implementation computing global names

Changes: https://git.openjdk.org/babylon/pull/13/files
 Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=13&range=00
  Stats: 333 lines in 9 files changed: 227 ins; 63 del; 43 mod
  Patch: https://git.openjdk.org/babylon/pull/13.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/13/head:pull/13

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


More information about the babylon-dev mailing list