-
Task
-
Resolution: Fixed
-
P3
-
9
-
None
-
b99
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8149325 | 8u101 | Hannes Wallnoefer | P3 | Resolved | Fixed | b01 |
JDK-8148068 | 8u92 | Hannes Wallnoefer | P3 | Resolved | Fixed | b04 |
JDK-8155510 | emb-8u101 | Hannes Wallnoefer | P3 | Resolved | Fixed | b01 |
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.
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.
- backported by
-
JDK-8148068 Remove long as an internal numeric type
- Resolved
-
JDK-8149325 Remove long as an internal numeric type
- Resolved
-
JDK-8155510 Remove long as an internal numeric type
- Resolved
- relates to
-
JDK-8173672 Operator == doesn't give correct output within Nashorn for Long
- Closed
-
JDK-8186140 java long comparison with == operator returns incorrect result.
- Closed
-
JDK-8305531 assign Long to variable cast it to Integer
- Closed
(1 relates to)