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

2.11.1: Clarify that small primitives on stack are always ints

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 21
    • specification
    • vm

      Discussions about types 'byte', 'short', 'boolean', and 'char' in JVMS sometimes misleadingly suggest that, despite using int-typed stack operations, there is some "actual" underlying smaller type being processed on the stack and stored in local variables.

      The reality of the operations is that every read from heap memory converts the value to a 32-bit int, and every write converts a 32-bit int to the appropriate heap storage type.

      2.11.1 should make this more clear, and additional references to small primitive types throughout chapter 2 and in 4.9.2 should align with this model.

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: