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

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Oct 26 14:49:44 UTC 2023


> This PR fixes how javac loads dynamic variable symbols in `Gen` - currently, either a `ldc` or `ldc_w` is emitted. This is problematic, as, depending on the type of the dynamic constant, in some cases `ldc2_w` might be required (e.g. if the type of the constant is either `long` or `double`).
> 
> I've updated the existing compiler condy test to check which `ldc` opcode is emitted for the various constants. I've also verified that the updated test fails w/o the changes in this patch.

Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:

  Address review comments

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16367/files
  - new: https://git.openjdk.org/jdk/pull/16367/files/59c0bfe4..65b85b6a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16367&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16367&range=01-02

  Stats: 14 lines in 1 file changed: 0 ins; 9 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/16367.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16367/head:pull/16367

PR: https://git.openjdk.org/jdk/pull/16367


More information about the compiler-dev mailing list