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

InvokerBytecodeGenerator emitConst should handle Byte, Short, Character

XMLWordPrintable

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

      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;
              }

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

              Created:
              Updated:
              Resolved: