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

Remove long as an internal numeric type

    Details

    • Type: Task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b99
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        ECMA defines double as the only number type in JavaScript. In Nashorn, we internally represent numbers as int, long and double. Use of long is problematic because it adds extra precision to the 53 bits provided by double. Two examples for such problems are JDK-8143896 and JDK-8065910.

        If we wanted to continue use long as an internal number representation, we'd have to artificially limit precision to 53 bits. It seems unlikely that the benefit of using longs justifies that overhead.

        There are a few things to consider when removing long support from Nashorn. Two areas where we use long are results of unsigned right shift (>>> and =>>>) and array indices and lengths. Both are defined as unsigned 32 bit integers which are ideally represented as longs in java.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hannesw Hannes Wallnoefer
                  Reporter:
                  hannesw Hannes Wallnoefer
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: