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

Remove long as an internal numeric type

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • core-libs
    • None
    • b99
    • generic
    • generic

        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.

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

                Created:
                Updated:
                Resolved: