Trying out the API for qbicc
Brian Goetz
brian.goetz at oracle.com
Wed Jul 27 20:34:08 UTC 2022
>> Obviously this is wandering dangerously close to the bikeshed
>> borderline, however one other real-world advantage is that an
>> enum constant in a more specific `*Opcode` subtype type can store
>> more useful information about itself that a consumer could use;
>> for example, the opcode constant for `IFEQ` could have a method
>> `complement` which yields `IFNE`, which can be useful for
>> simplifying some code generators (and I can think of specific
>> cases both within qbicc and within Quarkus where this would have
>> been useful).
>
> This method exists in the library as an Opcode -> Opcode method.
>
>
> Ah yes, I found it in `BytecodeHelpers`, excellent. That's in the
> `impl` subpackage though, so it doesn't feel very "public". Perhaps
> that class could be moved into the `jdk.classfile` package?
>
Yes, we've been conservative about what we expose, since its easier to
expose something hidden than vice versa.
What other transforms on opcodes go along with this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20220727/40f02a61/attachment.htm>
More information about the classfile-api-dev
mailing list