8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings

Thu, 14 Mar 2013 14:49:55 +0100

author
lagergren
date
Thu, 14 Mar 2013 14:49:55 +0100
changeset 139
390d44ba90cf
parent 138
60684aeba89c
child 140
d5d80b52cf1c

8009982: Lazy execution bugfix. Added lazy sunspider unit test. Added mandreel to compile-octane test. Fixed warnings
Reviewed-by: sundar, jlaskey

src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/CodeGenerator.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/Compiler.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/ir/FunctionNode.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/objects/Global.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/parser/Parser.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/Context.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/ScriptLoader.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/regexp/DefaultRegExp.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/regexp/RegExp.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/regexp/RegExpResult.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java file | annotate | diff | comparison | revisions
test/script/basic/compile-octane.js.EXPECTED file | annotate | diff | comparison | revisions
test/script/basic/run-octane.js file | annotate | diff | comparison | revisions
test/script/basic/runsunspider-eager.js file | annotate | diff | comparison | revisions
test/script/basic/runsunspider-lazy.js file | annotate | diff | comparison | revisions
test/script/basic/runsunspider.js file | annotate | diff | comparison | revisions
     1.1 --- a/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java	Tue Mar 12 21:17:47 2013 +0530
     1.2 +++ b/src/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java	Thu Mar 14 14:49:55 2013 +0100
     1.3 @@ -176,7 +176,7 @@
     1.4  
     1.5      // -- Internals only below this point
     1.6  
     1.7 -    private void checkConfigPermission() {
     1.8 +    private static void checkConfigPermission() {
     1.9          final SecurityManager sm = System.getSecurityManager();
    1.10          if (sm != null) {
    1.11              sm.checkPermission(new RuntimePermission("nashorn.setConfig"));
     2.1 --- a/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Tue Mar 12 21:17:47 2013 +0530
     2.2 +++ b/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Thu Mar 14 14:49:55 2013 +0100
     2.3 @@ -3230,8 +3230,7 @@
     2.4      }
     2.5  
     2.6      private void newFunctionObject(final FunctionNode functionNode) {
     2.7 -        final boolean    isLazy  = functionNode.isLazy();
     2.8 -        final Class<?>[] cparams = new Class<?>[] { RecompilableScriptFunctionData.class, ScriptObject.class };
     2.9 +        final boolean isLazy  = functionNode.isLazy();
    2.10  
    2.11          new ObjectCreator(this, new ArrayList<String>(), new ArrayList<Symbol>(), false, false) {
    2.12              @Override
    2.13 @@ -3246,7 +3245,7 @@
    2.14                  } else {
    2.15                      m.loadNull();
    2.16                  }
    2.17 -                m.invoke(constructorNoLookup(className, cparams));
    2.18 +                m.invoke(constructorNoLookup(className, RecompilableScriptFunctionData.class, ScriptObject.class));
    2.19              }
    2.20          }.makeObject(method);
    2.21      }
     3.1 --- a/src/jdk/nashorn/internal/codegen/Compiler.java	Tue Mar 12 21:17:47 2013 +0530
     3.2 +++ b/src/jdk/nashorn/internal/codegen/Compiler.java	Thu Mar 14 14:49:55 2013 +0100
     3.3 @@ -217,8 +217,6 @@
     3.4                  append(safeSourceName(functionNode.getSource()));
     3.5  
     3.6          this.scriptName = sb.toString();
     3.7 -
     3.8 -        LOG.info("Initializing compiler for '" + functionNode.getName() + "' scriptName = " + scriptName + ", root function: '" + functionNode.getName() + "' lazy=" + functionNode.isLazy());
     3.9      }
    3.10  
    3.11      /**
    3.12 @@ -361,7 +359,10 @@
    3.13          final Map<String, Class<?>> installedClasses = new HashMap<>();
    3.14  
    3.15          final String   rootClassName = firstCompileUnitName();
    3.16 -        final Class<?> rootClass     = install(rootClassName, bytecode.get(rootClassName));
    3.17 +        final byte[]   rootByteCode  = bytecode.get(rootClassName);
    3.18 +        final Class<?> rootClass     = install(rootClassName, rootByteCode);
    3.19 +
    3.20 +        int length = rootByteCode.length;
    3.21  
    3.22          installedClasses.put(rootClassName, rootClass);
    3.23  
    3.24 @@ -370,7 +371,10 @@
    3.25              if (className.equals(rootClassName)) {
    3.26                  continue;
    3.27              }
    3.28 -            installedClasses.put(className, install(className, entry.getValue()));
    3.29 +            final byte[] code = entry.getValue();
    3.30 +            length += code.length;
    3.31 +
    3.32 +            installedClasses.put(className, install(className, code));
    3.33          }
    3.34  
    3.35          for (final CompileUnit unit : compileUnits) {
    3.36 @@ -388,12 +392,32 @@
    3.37              }
    3.38          });
    3.39  
    3.40 -        LOG.info("Installed root class: " + rootClass + " and " + bytecode.size() + " compile unit classes");
    3.41 +        final StringBuilder sb;
    3.42 +        if (LOG.isEnabled()) {
    3.43 +            sb = new StringBuilder();
    3.44 +            sb.append("Installed class '").
    3.45 +                append(rootClass.getSimpleName()).
    3.46 +                append('\'').
    3.47 +                append(" bytes=").
    3.48 +                append(length).
    3.49 +                append('.');
    3.50 +            if (bytecode.size() > 1) {
    3.51 +                sb.append(' ').append(bytecode.size()).append(" compile units.");
    3.52 +            }
    3.53 +        } else {
    3.54 +            sb = null;
    3.55 +        }
    3.56  
    3.57          if (Timing.isEnabled()) {
    3.58              final long duration = System.currentTimeMillis() - t0;
    3.59              Timing.accumulateTime("[Code Installation]", duration);
    3.60 -            LOG.info("Installation time: " + duration + " ms");
    3.61 +            if (sb != null) {
    3.62 +                sb.append(" Install time: ").append(duration).append(" ms");
    3.63 +            }
    3.64 +        }
    3.65 +
    3.66 +        if (sb != null) {
    3.67 +            LOG.info(sb.toString());
    3.68          }
    3.69  
    3.70          return rootClass;
     4.1 --- a/src/jdk/nashorn/internal/ir/FunctionNode.java	Tue Mar 12 21:17:47 2013 +0530
     4.2 +++ b/src/jdk/nashorn/internal/ir/FunctionNode.java	Thu Mar 14 14:49:55 2013 +0100
     4.3 @@ -218,8 +218,9 @@
     4.4      private static final int HAS_ALL_VARS_IN_SCOPE = HAS_DEEP_WITH_OR_EVAL | IS_SPLIT | HAS_LAZY_CHILDREN;
     4.5      /** Does this function potentially need "arguments"? Note that this is not a full test, as further negative check of REDEFINES_ARGS is needed. */
     4.6      private static final int MAYBE_NEEDS_ARGUMENTS = USES_ARGUMENTS | HAS_EVAL;
     4.7 -    /** Does this function need the parent scope? It needs it if either it or its descendants use variables from it, or have a deep with or eval. */
     4.8 -    private static final int NEEDS_PARENT_SCOPE = USES_ANCESTOR_SCOPE | HAS_DEEP_WITH_OR_EVAL;
     4.9 +    /** Does this function need the parent scope? It needs it if either it or its descendants use variables from it, or have a deep with or eval.
    4.10 +     *  We also pessimistically need a parent scope if we have lazy children that have not yet been compiled */
    4.11 +    private static final int NEEDS_PARENT_SCOPE = USES_ANCESTOR_SCOPE | HAS_DEEP_WITH_OR_EVAL | HAS_LAZY_CHILDREN;
    4.12  
    4.13      /** What is the return type of this function? */
    4.14      private Type returnType = Type.UNKNOWN;
    4.15 @@ -724,13 +725,10 @@
    4.16       * their parent scope, functions that reference themselves, and non-strict functions that need an Arguments object
    4.17       * (since it exposes {@code arguments.callee} property) will need to have a callee parameter.
    4.18       *
    4.19 -     * We also conservatively need a callee if we have lazy children, i.e. nested function nodes that have not yet
    4.20 -     * been evaluated. _They_ may need the callee and we don't know it
    4.21 -     *
    4.22       * @return true if the function's generated Java method needs a {@code callee} parameter.
    4.23       */
    4.24      public boolean needsCallee() {
    4.25 -        return hasLazyChildren() || needsParentScope() || needsSelfSymbol() || (needsArguments() && !isStrictMode());
    4.26 +        return needsParentScope() || needsSelfSymbol() || (needsArguments() && !isStrictMode());
    4.27      }
    4.28  
    4.29      /**
    4.30 @@ -1076,7 +1074,7 @@
    4.31          } else {
    4.32              this.flags |= USES_ANCESTOR_SCOPE;
    4.33              final FunctionNode parentFn = findParentFunction();
    4.34 -            if(parentFn != null) {
    4.35 +            if (parentFn != null) {
    4.36                  parentFn.setUsesScopeSymbol(symbol);
    4.37              }
    4.38          }
     5.1 --- a/src/jdk/nashorn/internal/objects/Global.java	Tue Mar 12 21:17:47 2013 +0530
     5.2 +++ b/src/jdk/nashorn/internal/objects/Global.java	Thu Mar 14 14:49:55 2013 +0100
     5.3 @@ -1528,8 +1528,9 @@
     5.4          addOwnProperty(ScriptingFunctions.EXIT_NAME, Attribute.NOT_ENUMERABLE, UNDEFINED);
     5.5      }
     5.6  
     5.7 -    private void copyOptions(final ScriptObject options, final ScriptEnvironment scriptEnv) {
     5.8 +    private static void copyOptions(final ScriptObject options, final ScriptEnvironment scriptEnv) {
     5.9          AccessController.doPrivileged(new PrivilegedAction<Void>() {
    5.10 +            @Override
    5.11              public Void run() {
    5.12                  for (Field f : scriptEnv.getClass().getFields()) {
    5.13                      try {
     6.1 --- a/src/jdk/nashorn/internal/parser/Parser.java	Tue Mar 12 21:17:47 2013 +0530
     6.2 +++ b/src/jdk/nashorn/internal/parser/Parser.java	Thu Mar 14 14:49:55 2013 +0100
     6.3 @@ -126,7 +126,7 @@
     6.4      /** Namespace for function names where not explicitly given */
     6.5      private final Namespace namespace;
     6.6  
     6.7 -    private static DebugLogger LOG = new DebugLogger("parser");
     6.8 +    private static final DebugLogger LOG = new DebugLogger("parser");
     6.9  
    6.10      /**
    6.11       * Constructor
     7.1 --- a/src/jdk/nashorn/internal/runtime/Context.java	Tue Mar 12 21:17:47 2013 +0530
     7.2 +++ b/src/jdk/nashorn/internal/runtime/Context.java	Thu Mar 14 14:49:55 2013 +0100
     7.3 @@ -744,6 +744,7 @@
     7.4              global = (GlobalObject)Context.getGlobalTrusted();
     7.5              script = global.findCachedClass(source);
     7.6              if (script != null) {
     7.7 +                Compiler.LOG.fine("Code cache hit for " + source + " avoiding recompile.");
     7.8                  return script;
     7.9              }
    7.10          }
     8.1 --- a/src/jdk/nashorn/internal/runtime/ScriptLoader.java	Tue Mar 12 21:17:47 2013 +0530
     8.2 +++ b/src/jdk/nashorn/internal/runtime/ScriptLoader.java	Thu Mar 14 14:49:55 2013 +0100
     8.3 @@ -60,8 +60,7 @@
     8.4      synchronized Class<?> installClass(final String name, final byte[] data, final CodeSource cs) {
     8.5          if (cs == null) {
     8.6              return defineClass(name, data, 0, data.length, new ProtectionDomain(null, getPermissions(null)));
     8.7 -        } else {
     8.8 -            return defineClass(name, data, 0, data.length, cs);
     8.9          }
    8.10 +        return defineClass(name, data, 0, data.length, cs);
    8.11      }
    8.12  }
     9.1 --- a/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java	Tue Mar 12 21:17:47 2013 +0530
     9.2 +++ b/src/jdk/nashorn/internal/runtime/linker/JavaAdapterFactory.java	Thu Mar 14 14:49:55 2013 +0100
     9.3 @@ -412,6 +412,7 @@
     9.4      public static MethodHandle getConstructor(final Class<?> sourceType, final Class<?> targetType) throws Exception {
     9.5          final StaticClass adapterClass = getAdapterClassFor(new Class<?>[] { targetType });
     9.6          return AccessController.doPrivileged(new PrivilegedExceptionAction<MethodHandle>() {
     9.7 +            @Override
     9.8              public MethodHandle run() throws Exception {
     9.9                  return  MH.bindTo(Bootstrap.getLinkerServices().getGuardedInvocation(new LinkRequestImpl(NashornCallSiteDescriptor.get(
    9.10                      "dyn:new", MethodType.methodType(targetType, StaticClass.class, sourceType), 0), false,
    10.1 --- a/src/jdk/nashorn/internal/runtime/regexp/DefaultRegExp.java	Tue Mar 12 21:17:47 2013 +0530
    10.2 +++ b/src/jdk/nashorn/internal/runtime/regexp/DefaultRegExp.java	Thu Mar 14 14:49:55 2013 +0100
    10.3 @@ -95,14 +95,14 @@
    10.4              return null; // never matches or similar, e.g. a[]
    10.5          }
    10.6  
    10.7 -        RegExpMatcher matcher = this.matcher;
    10.8 +        RegExpMatcher currentMatcher = this.matcher;
    10.9  
   10.10 -        if (matcher == null || matcher.getInput() != str) {
   10.11 -            matcher = new DefaultMatcher(str);
   10.12 -            this.matcher = matcher;
   10.13 +        if (currentMatcher == null || matcher.getInput() != str) {
   10.14 +            currentMatcher = new DefaultMatcher(str);
   10.15 +            this.matcher  = currentMatcher;
   10.16          }
   10.17  
   10.18 -        return matcher;
   10.19 +        return currentMatcher;
   10.20      }
   10.21  
   10.22      class DefaultMatcher implements RegExpMatcher {
    11.1 --- a/src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java	Tue Mar 12 21:17:47 2013 +0530
    11.2 +++ b/src/jdk/nashorn/internal/runtime/regexp/JoniRegExp.java	Thu Mar 14 14:49:55 2013 +0100
    11.3 @@ -97,14 +97,14 @@
    11.4              return null;
    11.5          }
    11.6  
    11.7 -        RegExpMatcher matcher = this.matcher;
    11.8 +        RegExpMatcher currentMatcher = this.matcher;
    11.9  
   11.10 -        if (matcher == null || input != matcher.getInput()) {
   11.11 -            matcher = new JoniMatcher(input);
   11.12 -            this.matcher = matcher;
   11.13 +        if (currentMatcher == null || input != currentMatcher.getInput()) {
   11.14 +            currentMatcher = new JoniMatcher(input);
   11.15 +            this.matcher   = currentMatcher;
   11.16          }
   11.17  
   11.18 -        return matcher;
   11.19 +        return currentMatcher;
   11.20      }
   11.21  
   11.22      /**
    12.1 --- a/src/jdk/nashorn/internal/runtime/regexp/RegExp.java	Tue Mar 12 21:17:47 2013 +0530
    12.2 +++ b/src/jdk/nashorn/internal/runtime/regexp/RegExp.java	Thu Mar 14 14:49:55 2013 +0100
    12.3 @@ -156,7 +156,7 @@
    12.4       *
    12.5       * @param key the message key
    12.6       * @param str string argument
    12.7 -     * @throws jdk.nashorn.internal.runtime.ParserException
    12.8 +     * @throws jdk.nashorn.internal.runtime.ParserException unconditionally
    12.9       */
   12.10      protected static void throwParserException(final String key, final String str) throws ParserException {
   12.11          throw new ParserException(ECMAErrors.getMessage("parser.error.regex." + key, str));
    13.1 --- a/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java	Tue Mar 12 21:17:47 2013 +0530
    13.2 +++ b/src/jdk/nashorn/internal/runtime/regexp/RegExpFactory.java	Thu Mar 14 14:49:55 2013 +0100
    13.3 @@ -25,7 +25,6 @@
    13.4  
    13.5  package jdk.nashorn.internal.runtime.regexp;
    13.6  
    13.7 -import jdk.nashorn.internal.parser.Lexer;
    13.8  import jdk.nashorn.internal.runtime.ParserException;
    13.9  import jdk.nashorn.internal.runtime.options.Options;
   13.10  
   13.11 @@ -35,7 +34,6 @@
   13.12   */
   13.13  public class RegExpFactory {
   13.14  
   13.15 -
   13.16      private final static RegExpFactory instance;
   13.17  
   13.18      private final static String JDK  = "jdk";
   13.19 @@ -60,7 +58,8 @@
   13.20       * Creates a Regular expression from the given {@code pattern} and {@code flags} strings.
   13.21       *
   13.22       * @param pattern RegExp pattern string
   13.23 -     * @param flags RegExp flags string
   13.24 +     * @param flags   RegExp flags string
   13.25 +     * @return new RegExp
   13.26       * @throws ParserException if flags is invalid or pattern string has syntax error.
   13.27       */
   13.28      protected RegExp compile(final String pattern, final String flags) throws ParserException {
   13.29 @@ -71,8 +70,8 @@
   13.30       * Compile a regexp with the given {@code source} and {@code flags}.
   13.31       *
   13.32       * @param pattern RegExp pattern string
   13.33 -     * @param flags  flag string
   13.34 -     *
   13.35 +     * @param flags   flag string
   13.36 +     * @return new RegExp
   13.37       * @throws ParserException if invalid source or flags
   13.38       */
   13.39      public static RegExp create(final String pattern, final String flags) {
    14.1 --- a/src/jdk/nashorn/internal/runtime/regexp/RegExpResult.java	Tue Mar 12 21:17:47 2013 +0530
    14.2 +++ b/src/jdk/nashorn/internal/runtime/regexp/RegExpResult.java	Thu Mar 14 14:49:55 2013 +0100
    14.3 @@ -80,11 +80,11 @@
    14.4  
    14.5      /**
    14.6       * Get the group with the given index or the empty string if group index is not valid.
    14.7 -     * @param index the group index
    14.8 +     * @param groupIndex the group index
    14.9       * @return the group or ""
   14.10       */
   14.11 -    public Object getGroup(int index) {
   14.12 -        return index >= 0 && index < groups.length ? groups[index] : "";
   14.13 +    public Object getGroup(final int groupIndex) {
   14.14 +        return groupIndex >= 0 && groupIndex < groups.length ? groups[groupIndex] : "";
   14.15      }
   14.16  
   14.17      /**
    15.1 --- a/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java	Tue Mar 12 21:17:47 2013 +0530
    15.2 +++ b/src/jdk/nashorn/internal/runtime/regexp/RegExpScanner.java	Thu Mar 14 14:49:55 2013 +0100
    15.3 @@ -182,8 +182,6 @@
    15.4       * @return Committed token
    15.5       */
    15.6      private boolean commit(final int n) {
    15.7 -        final int startIn = position;
    15.8 -
    15.9          switch (n) {
   15.10          case 1:
   15.11              sb.append(ch0);
    16.1 --- a/test/script/basic/compile-octane.js.EXPECTED	Tue Mar 12 21:17:47 2013 +0530
    16.2 +++ b/test/script/basic/compile-octane.js.EXPECTED	Thu Mar 14 14:49:55 2013 +0100
    16.3 @@ -16,6 +16,9 @@
    16.4  Compiling... gbemu.js
    16.5  Compiled OK: gbemu.js
    16.6  
    16.7 +Compiling... mandreel.js
    16.8 +Compiled OK: mandreel.js
    16.9 +
   16.10  Compiling... navier-stokes.js
   16.11  Compiled OK: navier-stokes.js
   16.12  
    17.1 --- a/test/script/basic/run-octane.js	Tue Mar 12 21:17:47 2013 +0530
    17.2 +++ b/test/script/basic/run-octane.js	Thu Mar 14 14:49:55 2013 +0100
    17.3 @@ -31,7 +31,8 @@
    17.4      "crypto.js", 
    17.5      "deltablue.js", 
    17.6      "earley-boyer.js", 
    17.7 -    "gbemu.js",	     
    17.8 +    "gbemu.js",
    17.9 +    "mandreel.js",
   17.10      "navier-stokes.js", 
   17.11      "pdfjs.js",
   17.12      "raytrace.js",
   17.13 @@ -49,6 +50,12 @@
   17.14      { name: "gbemu.js" },
   17.15  ];
   17.16  
   17.17 +
   17.18 +//TODO mandreel can be compiled as a test, but not run multiple times unless modified to not have global state
   17.19 +var compileOnly = {
   17.20 +    "mandreel.js" : true
   17.21 +};
   17.22 +
   17.23  var dir = (typeof(__DIR__) == 'undefined') ? "test/script/basic/" : __DIR__;
   17.24  
   17.25  // TODO: why is this path hard coded when it's defined in project properties?
   17.26 @@ -63,6 +70,10 @@
   17.27      return str.indexOf(suffix, str.length - suffix.length) !== -1;
   17.28  }
   17.29  
   17.30 +function should_compile_only(name) {
   17.31 +    return (typeof compile_only !== 'undefined') || compileOnly[name] === true;
   17.32 +}
   17.33 +
   17.34  function run_one_benchmark(arg, iters) {
   17.35  
   17.36      var file_name;
   17.37 @@ -77,14 +88,18 @@
   17.38      }
   17.39      file_name = file[file.length - 1];
   17.40  
   17.41 -    if (typeof compile_only !== 'undefined') {
   17.42 +    var compile_and_return = should_compile_only(file_name);
   17.43 +    if (compile_and_return) {
   17.44 +	if (typeof compile_only === 'undefined') { //for a run, skip compile onlies, don't even compile them
   17.45 +	    return;
   17.46 +	}
   17.47  	print("Compiling... " + file_name);
   17.48      }
   17.49  
   17.50      load(path + 'base.js');
   17.51      load(arg);
   17.52      
   17.53 -    if (typeof compile_only !== 'undefined') {
   17.54 +    if (compile_and_return) {
   17.55  	print("Compiled OK: " + file_name);
   17.56  	print("");
   17.57  	return;
   17.58 @@ -164,7 +179,7 @@
   17.59  
   17.60  function run_suite(tests, iters) {
   17.61      for (var idx = 0; idx < tests.length; idx++) {
   17.62 -	run_one_benchmark(tests[idx], iters, false);
   17.63 +	run_one_benchmark(tests[idx], iters);
   17.64      }
   17.65  }
   17.66  
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/test/script/basic/runsunspider-eager.js	Thu Mar 14 14:49:55 2013 +0100
    18.3 @@ -0,0 +1,33 @@
    18.4 +/*
    18.5 + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    18.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    18.7 + * 
    18.8 + * This code is free software; you can redistribute it and/or modify it
    18.9 + * under the terms of the GNU General Public License version 2 only, as
   18.10 + * published by the Free Software Foundation.
   18.11 + * 
   18.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   18.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   18.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   18.15 + * version 2 for more details (a copy is included in the LICENSE file that
   18.16 + * accompanied this code).
   18.17 + * 
   18.18 + * You should have received a copy of the GNU General Public License version
   18.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   18.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   18.21 + * 
   18.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   18.23 + * or visit www.oracle.com if you need additional information or have any
   18.24 + * questions.
   18.25 + */
   18.26 +
   18.27 +/**
   18.28 + * runsunspider : runs the sunspider tests and checks for compliance
   18.29 + *
   18.30 + * @test
   18.31 + * @option -timezone=PST
   18.32 + * @runif external.sunspider
   18.33 + */
   18.34 +
   18.35 +load(__DIR__ + "runsunspider.js");
   18.36 +
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/test/script/basic/runsunspider-lazy.js	Thu Mar 14 14:49:55 2013 +0100
    19.3 @@ -0,0 +1,34 @@
    19.4 +/*
    19.5 + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    19.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.7 + * 
    19.8 + * This code is free software; you can redistribute it and/or modify it
    19.9 + * under the terms of the GNU General Public License version 2 only, as
   19.10 + * published by the Free Software Foundation.
   19.11 + * 
   19.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   19.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   19.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   19.15 + * version 2 for more details (a copy is included in the LICENSE file that
   19.16 + * accompanied this code).
   19.17 + * 
   19.18 + * You should have received a copy of the GNU General Public License version
   19.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   19.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   19.21 + * 
   19.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   19.23 + * or visit www.oracle.com if you need additional information or have any
   19.24 + * questions.
   19.25 + */
   19.26 +
   19.27 +/**
   19.28 + * runsunspider : runs the sunspider tests and checks for compliance
   19.29 + *
   19.30 + * @test
   19.31 + * @option -timezone=PST
   19.32 + * @option --lazy-compilation
   19.33 + * @runif external.sunspider
   19.34 + */
   19.35 +
   19.36 +load(__DIR__ + "runsunspider.js");
   19.37 +
    20.1 --- a/test/script/basic/runsunspider.js	Tue Mar 12 21:17:47 2013 +0530
    20.2 +++ b/test/script/basic/runsunspider.js	Thu Mar 14 14:49:55 2013 +0100
    20.3 @@ -24,39 +24,11 @@
    20.4  /**
    20.5   * runsunspider : runs the sunspider tests and checks for compliance
    20.6   *
    20.7 - * @test
    20.8 - * @option -timezone=PST
    20.9 - * @runif external.sunspider
   20.10 - */
   20.11 -
   20.12 -/*
   20.13 - * Copyright (c) 2010-2011, Oracle and/or its affiliates. All rights reserved.
   20.14 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   20.15 - *
   20.16 - * This code is free software; you can redistribute it and/or modify it
   20.17 - * under the terms of the GNU General Public License version 2 only, as
   20.18 - * published by the Free Software Foundation.  Oracle designates this
   20.19 - * particular file as subject to the "Classpath" exception as provided
   20.20 - * by Oracle in the LICENSE file that accompanied this code.
   20.21 - *
   20.22 - * This code is distributed in the hope that it will be useful, but WITHOUT
   20.23 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   20.24 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   20.25 - * version 2 for more details (a copy is included in the LICENSE file that
   20.26 - * accompanied this code).
   20.27 - *
   20.28 - * You should have received a copy of the GNU General Public License version
   20.29 - * 2 along with this work; if not, write to the Free Software Foundation,
   20.30 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   20.31 - *
   20.32 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   20.33 - * or visit www.oracle.com if you need additional information or have any
   20.34 - * questions.
   20.35 + * @subtest
   20.36   */
   20.37  
   20.38  /**
   20.39   * This is not a test, but a test "framework" for running sunspider tests.
   20.40 - *
   20.41   */
   20.42  
   20.43  function assertEq(a, b) {

mercurial