Trying out the API for qbicc

David Lloyd david.lloyd at redhat.com
Wed Jul 27 20:56:33 UTC 2022


On Wed, Jul 27, 2022 at 3:34 PM Brian Goetz <brian.goetz at oracle.com> wrote:

>
> 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?
>

>From my own experience, complementing a conditional is about it for
transformations - though I have at least imagined a couple of the other
transformations in that class, I haven't run across practical applications
for them. Some additional queries might be useful though. I've recently had
a case where it would have been convenient to know whether a given binary
operation was commutative, in order to know whether I had to care about
operand order on the stack.

Also, I note that both binary and unary operators are known just as
"operators"; adding a distinction here might be useful as well. I could
probably speculate several more, but as they say: YAGNI.

-- 
- DML • he/him
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20220727/0bf97f13/attachment.htm>


More information about the classfile-api-dev mailing list