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

InvokerBytecodeGenerator emitConst should handle Byte, Short, Character

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 9
    • None
    • core-libs
    • b97
    • generic
    • generic

    Description

      Current implementation of InvokerBytecodeGenerator emits optimized bytecode for small Integer and Long constants, while Byte, Short and Character falls through and is treated as Object.

              if (con instanceof Integer) {
                  emitIconstInsn((int) con);
                  return;
              }

      could reasonably be replaced with:

              if (con instanceof Integer || con instanceof Short || con instanceof Byte || con instanceof Character) {
                  emitIconstInsn((int) con);
                  return;
              }

      Attachments

        Activity

          People

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: