<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 27, 2022 at 3:34 PM Brian Goetz <<a href="mailto:brian.goetz@oracle.com">brian.goetz@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  
  <div>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div>
              This method exists in the library as an Opcode ->
              Opcode method.<br>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>
            <div style="font-family:arial,helvetica,sans-serif">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?</div>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Yes, we've been conservative about what we expose, since its easier
    to expose something hidden than vice versa.  <br>
    <br>
    What other transforms on opcodes go along with this?<br>
  </div>

</blockquote></div><br clear="all"><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">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.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">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.</div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">- DML • he/him<br></div></div></div>