InvokerBytecodeGenerator emitConst should handle Byte, Short, Character

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: None
    • Component/s: 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;
              }

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

              Created:
              Updated:
              Resolved: