-
Bug
-
Resolution: Fixed
-
P3
-
None
-
None
-
b64
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085648 | emb-9 | Attila Szegedi | P3 | Resolved | Fixed | team |
JDK-8087065 | 8u65 | Attila Szegedi | P3 | Resolved | Fixed | b01 |
JDK-8079472 | 8u60 | Attila Szegedi | P3 | Resolved | Fixed | b16 |
JDK-8138456 | emb-8u65 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8081190 | emb-8u60 | Attila Szegedi | P3 | Resolved | Fixed | team |
The following code throws ArrayIndexOutOfBoundsException with JDK9 with optimistic types enabled:
var m = 1;
var obj = {
p0: m,
p1: m = "foo",
p2: m
};
Appearently the restof handle expects a second copy of the JD4 object being initialized on the stack which is not available in the RewriteException's stack array.
The object literal code is generated by FieldObjectCreator, but SpillObjectCreator (used for object literals with >= 256 properties) exhibits the same problem.
Output:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at jdk.nashorn.internal.scripts.Script$Recompilation$2$JDK_8078049$cu1$restOf.:program(test/script/basic/JDK-8078049.js:0)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:636)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.tools.Shell.apply(Shell.java:397)
at jdk.nashorn.tools.Shell.runScripts(Shell.java:326)
at jdk.nashorn.tools.Shell.run(Shell.java:172)
at jdk.nashorn.tools.Shell.main(Shell.java:136)
at jdk.nashorn.tools.Shell.main(Shell.java:112)
var m = 1;
var obj = {
p0: m,
p1: m = "foo",
p2: m
};
Appearently the restof handle expects a second copy of the JD4 object being initialized on the stack which is not available in the RewriteException's stack array.
The object literal code is generated by FieldObjectCreator, but SpillObjectCreator (used for object literals with >= 256 properties) exhibits the same problem.
Output:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at jdk.nashorn.internal.scripts.Script$Recompilation$2$JDK_8078049$cu1$restOf.:program(test/script/basic/
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:636)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.tools.Shell.apply(Shell.java:397)
at jdk.nashorn.tools.Shell.runScripts(Shell.java:326)
at jdk.nashorn.tools.Shell.run(Shell.java:172)
at jdk.nashorn.tools.Shell.main(Shell.java:136)
at jdk.nashorn.tools.Shell.main(Shell.java:112)
- backported by
-
JDK-8079472 Optimistic rewrite in object literal causes ArrayIndexOutOfBoundsException
-
- Resolved
-
-
JDK-8081190 Optimistic rewrite in object literal causes ArrayIndexOutOfBoundsException
-
- Resolved
-
-
JDK-8085648 Optimistic rewrite in object literal causes ArrayIndexOutOfBoundsException
-
- Resolved
-
-
JDK-8087065 Optimistic rewrite in object literal causes ArrayIndexOutOfBoundsException
-
- Resolved
-
-
JDK-8138456 Optimistic rewrite in object literal causes ArrayIndexOutOfBoundsException
-
- Resolved
-