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

RETURN symbol has wrong type in split functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8
    • core-libs
    • b102
    • generic
    • generic
    • Verified

      The RETURN symbol in split function always has the OBJECT type, even if the function return type is a primitive. This leads to an AssertionError in codegen.

      One way to reproduce this problem is to compile the Octane earley-boyer.js or crypto.js files with a splitter threshold of 1000:

      bin/js -Dnashorn.compiler.splitter.threshold=1000 test/script/external/octane/earley-boyer.js
      Exception in thread "main" java.lang.AssertionError: boolean is not compatible with object
      at jdk.nashorn.internal.codegen.MethodEmitter.popType(MethodEmitter.java:235)
      at jdk.nashorn.internal.codegen.MethodEmitter.store(MethodEmitter.java:953)
      at jdk.nashorn.internal.codegen.MethodEmitter.storeCompilerConstant(MethodEmitter.java:912)
      at jdk.nashorn.internal.codegen.CodeGenerator.enterSplitNode(CodeGenerator.java:1692)
      at jdk.nashorn.internal.ir.SplitNode.accept(SplitNode.java:84)
      at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:51)
      at jdk.nashorn.internal.ir.LexicalContextStatement.accept(LexicalContextStatement.java:53)
      at jdk.nashorn.internal.ir.SplitNode.accept(SplitNode.java:35)
      at jdk.nashorn.internal.ir.Node.accept(Node.java:291)
      at jdk.nashorn.internal.ir.Block.accept(Block.java:138)
      at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:51)
      at jdk.nashorn.internal.ir.Block.accept(Block.java:343)
      at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:297)
      at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:51)
      at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
      at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:49)
             ......

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

              Created:
              Updated:
              Resolved: