[code-reflection] RFR: Enhance grammar of op attributes

Maurizio Cimadamore mcimadamore at openjdk.org
Wed May 28 15:47:12 UTC 2025


This PR enhances the grammar of op attributes, so as to avoid use of "stringy" attributes where possible. Now all attributes that are Java primitives are externalized and re-parsed back automatically. This means that op factories no longer need to test for attribute values of type `String` and then manually parse that string back into the correct primitive, which makes the code more robust.

This change caused some reshuffling in the tests -- most notably, when fixing the triton test, the new logic highlighted what was probably an "issue" in the triton transformer (see related comment).

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

Commit messages:
 - Update attribute grammar doc in OpParser
 - Simplify code in ArithMathOps.ConstantOp
 - Initial push

Changes: https://git.openjdk.org/babylon/pull/435/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=435&range=00
  Stats: 960 lines in 52 files changed: 41 ins; 79 del; 840 mod
  Patch: https://git.openjdk.org/babylon/pull/435.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/435/head:pull/435

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


More information about the babylon-dev mailing list