[code-reflection] RFR: Enhance grammar of op attributes
Paul Sandoz
psandoz at openjdk.org
Wed May 28 16:20:08 UTC 2025
On Wed, 28 May 2025 15:28:30 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> 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).
src/jdk.incubator.code/share/classes/jdk/incubator/code/op/CoreOp.java line 1281:
> 1279:
> 1280: static Object processConstantValue(TypeElement t, Object value) {
> 1281: if (t.equals(JavaType.BOOLEAN) && value instanceof Boolean) {
Nice. Can the IDE refactor the body of this method to a switch expression?
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/435#discussion_r2112288529
More information about the babylon-dev
mailing list