Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8342458

More consistent constant instruction handling

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • core-libs
    • None

      Currently, our constant instruction handling is inconsistent. Our opcode promotion strategy is wrong for dynamic constants: compile and run the Sick.java with 24 preview and run the Test.class, JVM will fail to verify Test.class due to it using ldc_w for a dynamic constant returning double.

      I recommend to only carry out the opcode promotion if:

      1. The opcode is ldc (not ldc_w or ldc2_w)
      2. The entry is external, and index is too wide after adaptation.

      In addition, we allow creation of LoadConstantInstruction with ldc2_w referring to non-category-2 and vice versa. Should we restrict this at all?

            liach Chen Liang
            liach Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: