RFR: 8318837: javac generates wrong ldc instruction for dynamic constant loads

Vicente Romero vromero at openjdk.org
Thu Oct 26 13:14:31 UTC 2023


On Thu, 26 Oct 2023 10:10:19 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> > > > side: given that you are in the neighborhood :) does it make sense to fold the cases for: `ldc2w` and `ldc2` at: `Code::emitop2`?
> 
> This turned out to be a very good suggestion, thanks! While doing it, I realized that we already had a method (`Types::constantType`) to get the `Type` of a constant, so the new method I added to `LoadableConstant` is not really required (and I have now removed it).
> 
> In the end I left the names as they are, beacuse, while confusing, when looking at `emitOp` they kind of make sense - e.g. 1/2 is used to denote the number of operand bytes. So at least it's self-consistent :-)

last version looks good to me, thanks!

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

PR Comment: https://git.openjdk.org/jdk/pull/16367#issuecomment-1781096417


More information about the compiler-dev mailing list