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

InvokerBytecodeGenerator emitConst should handle Byte, Short, Character

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b97
    • CPU:
      generic
    • OS:
      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

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

              Dates

              Created:
              Updated:
              Resolved: