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

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Oct 26 10:14:06 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
  Simplify code

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

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

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

  Stats: 23 lines in 2 files changed: 4 ins; 18 del; 1 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