More consistent constant instruction handling

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 24
    • Affects Version/s: 24
    • Component/s: 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?

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

              Created:
              Updated:
              Resolved: