8098807: Strict eval throws ClassCastException with large scripts

Tue, 16 Jun 2015 13:25:41 +0200

author
hannesw
date
Tue, 16 Jun 2015 13:25:41 +0200
changeset 1411
77ff49b11306
parent 1410
9dba91416efb
child 1412
a8706b5e6a2e

8098807: Strict eval throws ClassCastException with large scripts
Reviewed-by: sundar, attila

src/jdk/nashorn/internal/codegen/Compiler.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/Splitter.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/Context.java file | annotate | diff | comparison | revisions
test/script/basic/JDK-8098807-payload.js file | annotate | diff | comparison | revisions
test/script/basic/JDK-8098807.js file | annotate | diff | comparison | revisions
     1.1 --- a/src/jdk/nashorn/internal/codegen/Compiler.java	Mon Jun 15 15:49:14 2015 +0200
     1.2 +++ b/src/jdk/nashorn/internal/codegen/Compiler.java	Tue Jun 16 13:25:41 2015 +0200
     1.3 @@ -103,7 +103,7 @@
     1.4  
     1.5      private final CodeInstaller<ScriptEnvironment> installer;
     1.6  
     1.7 -    /** logger for compiler, trampolines, splits and related code generation events
     1.8 +    /** logger for compiler, trampolines and related code generation events
     1.9       *  that affect classes */
    1.10      private final DebugLogger log;
    1.11  
     2.1 --- a/src/jdk/nashorn/internal/codegen/Splitter.java	Mon Jun 15 15:49:14 2015 +0200
     2.2 +++ b/src/jdk/nashorn/internal/codegen/Splitter.java	Tue Jun 16 13:25:41 2015 +0200
     2.3 @@ -42,13 +42,17 @@
     2.4  import jdk.nashorn.internal.ir.SplitNode;
     2.5  import jdk.nashorn.internal.ir.Statement;
     2.6  import jdk.nashorn.internal.ir.visitor.NodeVisitor;
     2.7 +import jdk.nashorn.internal.runtime.Context;
     2.8  import jdk.nashorn.internal.runtime.logging.DebugLogger;
     2.9 +import jdk.nashorn.internal.runtime.logging.Loggable;
    2.10 +import jdk.nashorn.internal.runtime.logging.Logger;
    2.11  import jdk.nashorn.internal.runtime.options.Options;
    2.12  
    2.13  /**
    2.14   * Split the IR into smaller compile units.
    2.15   */
    2.16 -final class Splitter extends NodeVisitor<LexicalContext> {
    2.17 +@Logger(name="splitter")
    2.18 +final class Splitter extends NodeVisitor<LexicalContext> implements Loggable {
    2.19      /** Current compiler. */
    2.20      private final Compiler compiler;
    2.21  
    2.22 @@ -78,7 +82,17 @@
    2.23          this.compiler             = compiler;
    2.24          this.outermost            = functionNode;
    2.25          this.outermostCompileUnit = outermostCompileUnit;
    2.26 -        this.log                  = compiler.getLogger();
    2.27 +        this.log                  = initLogger(compiler.getContext());
    2.28 +    }
    2.29 +
    2.30 +    @Override
    2.31 +    public DebugLogger initLogger(final Context context) {
    2.32 +        return context.getLogger(this.getClass());
    2.33 +    }
    2.34 +
    2.35 +    @Override
    2.36 +    public DebugLogger getLogger() {
    2.37 +        return log;
    2.38      }
    2.39  
    2.40      /**
    2.41 @@ -89,7 +103,7 @@
    2.42      FunctionNode split(final FunctionNode fn, final boolean top) {
    2.43          FunctionNode functionNode = fn;
    2.44  
    2.45 -        log.finest("Initiating split of '", functionNode.getName(), "'");
    2.46 +        log.fine("Initiating split of '", functionNode.getName(), "'");
    2.47  
    2.48          long weight = WeighNodes.weigh(functionNode);
    2.49  
    2.50 @@ -98,7 +112,7 @@
    2.51          assert lc.isEmpty() : "LexicalContext not empty";
    2.52  
    2.53          if (weight >= SPLIT_THRESHOLD) {
    2.54 -            log.finest("Splitting '", functionNode.getName(), "' as its weight ", weight, " exceeds split threshold ", SPLIT_THRESHOLD);
    2.55 +            log.info("Splitting '", functionNode.getName(), "' as its weight ", weight, " exceeds split threshold ", SPLIT_THRESHOLD);
    2.56              functionNode = (FunctionNode)functionNode.accept(this);
    2.57  
    2.58              if (functionNode.isSplit()) {
     3.1 --- a/src/jdk/nashorn/internal/runtime/Context.java	Mon Jun 15 15:49:14 2015 +0200
     3.2 +++ b/src/jdk/nashorn/internal/runtime/Context.java	Tue Jun 16 13:25:41 2015 +0200
     3.3 @@ -724,16 +724,8 @@
     3.4          // In strict mode, eval does not instantiate variables and functions
     3.5          // in the caller's environment. A new environment is created!
     3.6          if (strictFlag) {
     3.7 -            // Create a new scope object
     3.8 -            final ScriptObject strictEvalScope = global.newObject();
     3.9 -
    3.10 -            // bless it as a "scope"
    3.11 -            strictEvalScope.setIsScope();
    3.12 -
    3.13 -            // set given scope to be it's proto so that eval can still
    3.14 -            // access caller environment vars in the new environment.
    3.15 -            strictEvalScope.setProto(scope);
    3.16 -            scope = strictEvalScope;
    3.17 +            // Create a new scope object with given scope as its prototype
    3.18 +            scope = newScope(scope);
    3.19          }
    3.20  
    3.21          final ScriptFunction func = getProgramFunction(clazz, scope);
    3.22 @@ -748,6 +740,10 @@
    3.23          return ScriptRuntime.apply(func, evalThis);
    3.24      }
    3.25  
    3.26 +    private static ScriptObject newScope(final ScriptObject callerScope) {
    3.27 +        return new FunctionScope(PropertyMap.newMap(FunctionScope.class), callerScope);
    3.28 +    }
    3.29 +
    3.30      private static Source loadInternal(final String srcStr, final String prefix, final String resourcePath) {
    3.31          if (srcStr.startsWith(prefix)) {
    3.32              final String resource = resourcePath + srcStr.substring(prefix.length());
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/script/basic/JDK-8098807-payload.js	Tue Jun 16 13:25:41 2015 +0200
     4.3 @@ -0,0 +1,157 @@
     4.4 +/*
     4.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 + *
     4.8 + * This code is free software; you can redistribute it and/or modify it
     4.9 + * under the terms of the GNU General Public License version 2 only, as
    4.10 + * published by the Free Software Foundation.
    4.11 + *
    4.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    4.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.15 + * version 2 for more details (a copy is included in the LICENSE file that
    4.16 + * accompanied this code).
    4.17 + *
    4.18 + * You should have received a copy of the GNU General Public License version
    4.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    4.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.21 + *
    4.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.23 + * or visit www.oracle.com if you need additional information or have any
    4.24 + * questions.
    4.25 + */
    4.26 +
    4.27 +/**
    4.28 + * JDK-8098807:  Strict eval throws ClassCastException with large scripts
    4.29 + *
    4.30 + * @subtest
    4.31 + */
    4.32 +
    4.33 +function f() {}
    4.34 +
    4.35 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.36 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.37 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.38 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.39 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.40 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.41 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.42 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.43 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.44 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.45 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.46 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.47 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.48 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.49 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.50 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.51 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.52 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.53 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.54 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.55 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.56 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.57 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.58 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.59 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.60 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.61 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.62 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.63 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.64 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.65 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.66 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.67 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.68 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.69 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.70 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.71 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.72 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.73 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.74 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.75 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.76 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.77 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.78 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.79 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.80 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.81 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.82 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.83 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.84 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.85 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.86 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.87 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.88 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.89 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.90 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.91 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.92 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.93 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.94 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.95 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.96 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.97 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.98 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
    4.99 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.100 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.101 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.102 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.103 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.104 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.105 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.106 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.107 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.108 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.109 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.110 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.111 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.112 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.113 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.114 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.115 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.116 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.117 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.118 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.119 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.120 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.121 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.122 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.123 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.124 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.125 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.126 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.127 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.128 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.129 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.130 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.131 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.132 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.133 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.134 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.135 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.136 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.137 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.138 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.139 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.140 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.141 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.142 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.143 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.144 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.145 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.146 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.147 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.148 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.149 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.150 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.151 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.152 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.153 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.154 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.155 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.156 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.157 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.158 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.159 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
   4.160 +f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/script/basic/JDK-8098807.js	Tue Jun 16 13:25:41 2015 +0200
     5.3 @@ -0,0 +1,36 @@
     5.4 +/*
     5.5 + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     5.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.7 + * 
     5.8 + * This code is free software; you can redistribute it and/or modify it
     5.9 + * under the terms of the GNU General Public License version 2 only, as
    5.10 + * published by the Free Software Foundation.
    5.11 + * 
    5.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    5.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    5.15 + * version 2 for more details (a copy is included in the LICENSE file that
    5.16 + * accompanied this code).
    5.17 + * 
    5.18 + * You should have received a copy of the GNU General Public License version
    5.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    5.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    5.21 + * 
    5.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    5.23 + * or visit www.oracle.com if you need additional information or have any
    5.24 + * questions.
    5.25 + */
    5.26 +
    5.27 +/**
    5.28 + * JDK-8098807:  Strict eval throws ClassCastException with large scripts
    5.29 + *
    5.30 + * @test
    5.31 + * @run
    5.32 + * @option -scripting
    5.33 + */
    5.34 +
    5.35 +"use strict";
    5.36 +
    5.37 +var path = __DIR__ + "JDK-8098807-payload.js"
    5.38 +var source = readFully(path);
    5.39 +eval(source);

mercurial