Hi,
Webrev already sent to nashorn-dev list to fix this issue.
Bug: https://bugs.openjdk.java.net/browse/JDK-8079424
Review thread:
http://mail.openjdk.java.net/pipermail/nashorn-dev/2015-May/004502.html
Attila is on travel. I think this will be fixed in 9 and backported to
jdk8u-dev afterwards.
-Sundar
On Wednesday 13 May 2015 06:42 PM, Josh Fleming wrote:
Bump.
jf
On 5/1/15, 10:21 AM, "Josh Fleming" <[email protected]> wrote:
Hi folks,
I filed a bug for this on the Oracle site (Review ID: JI-9020901), but
thought I’d surface it here too.
When running our code in minified form, I came across a strange
compilation failure in Nashorn 8u60. After some reduction, it appears
that any code of the following form triggers the failure:
true && true, true
You should be able to reproduce the failure by entering it into the
Nashorn 8u60 shell. The pattern seems to be a binary logical operator
appearing anywhere before the final position in a compound expression.
The same code works properly in previous releases of Nashorn.
java –version:
java version "1.8.0_60-ea"
Java(TM) SE Runtime Environment (build 1.8.0_60-ea-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b12, mixed mode)
Stack trace:
Exception in thread "main" java.lang.AssertionError: Failed generating
bytecode for <STDIN>:1
at
jdk.nashorn.internal.codegen.CompilationPhase$13.transform(CompilationPhas
e.java:486)
at
jdk.nashorn.internal.codegen.CompilationPhase.apply(CompilationPhase.java:
728)
at jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:620)
at jdk.nashorn.internal.runtime.Context.compile(Context.java:1276)
at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:1213)
at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:628)
at
jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEng
ine.java:523)
at
jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEng
ine.java:512)
at
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine
.java:400)
at
jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.jav
a:155)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at com.sun.tools.script.shell.Main.evaluateString(Main.java:298)
at com.sun.tools.script.shell.Main.processSource(Main.java:267)
at com.sun.tools.script.shell.Main.access$100(Main.java:37)
at com.sun.tools.script.shell.Main$1.run(Main.java:183)
at com.sun.tools.script.shell.Main.main(Main.java:48)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at jdk.nashorn.internal.codegen.Label$Stack.pop(Label.java:300)
at
jdk.nashorn.internal.codegen.MethodEmitter.popType(MethodEmitter.java:279)
at jdk.nashorn.internal.codegen.MethodEmitter.pop(MethodEmitter.java:502)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadAND_OR(CodeGenerator.java:3
808)
at
jdk.nashorn.internal.codegen.CodeGenerator.access$3300(CodeGenerator.java:
181)
at
jdk.nashorn.internal.codegen.CodeGenerator$1.enterAND(CodeGenerator.java:1
089)
at
jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor.enterBinaryNode(NodeOp
eratorVisitor.java:111)
at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:339)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:861)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:837)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadAndDiscard(CodeGenerator.ja
va:3678)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadMaybeDiscard(CodeGenerator.
java:3707)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadMaybeDiscard(CodeGenerator.
java:3694)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadCOMMARIGHT(CodeGenerator.ja
va:4128)
at
jdk.nashorn.internal.codegen.CodeGenerator.access$3200(CodeGenerator.java:
181)
at
jdk.nashorn.internal.codegen.CodeGenerator$1.enterCOMMARIGHT(CodeGenerator
.java:1083)
at
jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor.enterBinaryNode(NodeOp
eratorVisitor.java:145)
at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:339)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:861)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:837)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadAndDiscard(CodeGenerator.ja
va:3678)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadCOMMARIGHT(CodeGenerator.ja
va:4127)
at
jdk.nashorn.internal.codegen.CodeGenerator.access$3200(CodeGenerator.java:
181)
at
jdk.nashorn.internal.codegen.CodeGenerator$1.enterCOMMARIGHT(CodeGenerator
.java:1083)
at
jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor.enterBinaryNode(NodeOp
eratorVisitor.java:145)
at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:339)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:861)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:837)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpressionAsBoolean(CodeGen
erator.java:580)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpressionAsType(CodeGenera
tor.java:826)
at
jdk.nashorn.internal.codegen.CodeGenerator$14.evaluate(CodeGenerator.java:
3885)
at
jdk.nashorn.internal.codegen.CodeGenerator$Store.store(CodeGenerator.java:
4502)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadASSIGN(CodeGenerator.java:3
887)
at
jdk.nashorn.internal.codegen.CodeGenerator.access$800(CodeGenerator.java:1
81)
at
jdk.nashorn.internal.codegen.CodeGenerator$1.enterASSIGN(CodeGenerator.jav
a:923)
at
jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor.enterBinaryNode(NodeOp
eratorVisitor.java:113)
at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:339)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:861)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadExpression(CodeGenerator.ja
va:837)
at
jdk.nashorn.internal.codegen.CodeGenerator.loadAndDiscard(CodeGenerator.ja
va:3678)
at
jdk.nashorn.internal.codegen.CodeGenerator.enterExpressionStatement(CodeGe
nerator.java:1732)
at
jdk.nashorn.internal.ir.ExpressionStatement.accept(ExpressionStatement.jav
a:63)
at jdk.nashorn.internal.ir.Node.accept(Node.java:261)
at jdk.nashorn.internal.ir.Block.accept(Block.java:154)
at
jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextN
ode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:409)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:374)
at
jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextN
ode.java:57)
at
jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpr
ession.java:47)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:57)
at
jdk.nashorn.internal.codegen.CompilationPhase.transformFunction(Compilatio
nPhase.java:732)
at
jdk.nashorn.internal.codegen.CompilationPhase.access$100(CompilationPhase.
java:69)
at
jdk.nashorn.internal.codegen.CompilationPhase$13.transform(CompilationPhas
e.java:473)
... 15 more
jf