8059231: Verify that octane raytrace now works with optimistic types turned off. Add better logging for optimistic types in the compiler.

Mon, 06 Oct 2014 10:43:57 +0200

author
lagergren
date
Mon, 06 Oct 2014 10:43:57 +0200
changeset 1031
9b24fc6da691
parent 1030
7eba45a08557
child 1032
724bb760e386

8059231: Verify that octane raytrace now works with optimistic types turned off. Add better logging for optimistic types in the compiler.
Reviewed-by: attila, hannesw, sundar

src/jdk/nashorn/internal/codegen/Compiler.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/resources/Options.properties file | annotate | diff | comparison | revisions
     1.1 --- a/src/jdk/nashorn/internal/codegen/Compiler.java	Thu Oct 02 16:30:49 2014 +0200
     1.2 +++ b/src/jdk/nashorn/internal/codegen/Compiler.java	Mon Oct 06 10:43:57 2014 +0200
     1.3 @@ -458,12 +458,14 @@
     1.4  
     1.5      @Override
     1.6      public DebugLogger initLogger(final Context ctxt) {
     1.7 +        final boolean optimisticTypes = ctxt.getEnv()._optimistic_types;
     1.8          return ctxt.getLogger(this.getClass(), new Consumer<DebugLogger>() {
     1.9              @Override
    1.10              public void accept(final DebugLogger newLogger) {
    1.11                  if (!Compiler.this.getScriptEnvironment()._lazy_compilation) {
    1.12                      newLogger.warning("WARNING: Running with lazy compilation switched off. This is not a default setting.");
    1.13                  }
    1.14 +                newLogger.warning("Optimistic types are ", optimisticTypes ? "ENABLED." : "DISABLED.");
    1.15              }
    1.16          });
    1.17      }
    1.18 @@ -541,9 +543,10 @@
    1.19       * @throws CompilationException if error occurs during compilation
    1.20       */
    1.21      public FunctionNode compile(final FunctionNode functionNode, final CompilationPhases phases) throws CompilationException {
    1.22 -
    1.23 -        log.finest("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
    1.24 -        log.indent();
    1.25 +        if (log.isEnabled()) {
    1.26 +            log.info("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
    1.27 +            log.indent();
    1.28 +        }
    1.29  
    1.30          final String name = DebugLogger.quote(functionNode.getName());
    1.31  
    1.32 @@ -560,7 +563,7 @@
    1.33          long time = 0L;
    1.34  
    1.35          for (final CompilationPhase phase : phases) {
    1.36 -            log.fine(phase, " starting for ", quote(name));
    1.37 +            log.fine(phase, " starting for ", name);
    1.38  
    1.39              try {
    1.40                  newFunctionNode = phase.apply(this, phases, newFunctionNode);
    1.41 @@ -588,8 +591,11 @@
    1.42          log.unindent();
    1.43  
    1.44          if (info) {
    1.45 -            final StringBuilder sb = new StringBuilder();
    1.46 -            sb.append("Compile job for ").append(newFunctionNode.getSource()).append(':').append(quote(newFunctionNode.getName())).append(" finished");
    1.47 +            final StringBuilder sb = new StringBuilder("Finished compile job for ");
    1.48 +            sb.append(newFunctionNode.getSource()).
    1.49 +                append(':').
    1.50 +                append(quote(newFunctionNode.getName()));
    1.51 +
    1.52              if (time > 0L && timeLogger != null) {
    1.53                  assert env.isTimingEnabled();
    1.54                  sb.append(" in ").append(time).append(" ms");
     2.1 --- a/src/jdk/nashorn/internal/runtime/resources/Options.properties	Thu Oct 02 16:30:49 2014 +0200
     2.2 +++ b/src/jdk/nashorn/internal/runtime/resources/Options.properties	Mon Oct 06 10:43:57 2014 +0200
     2.3 @@ -203,6 +203,7 @@
     2.4  
     2.5  nashorn.option.optimistic.types = {                                                                      \
     2.6      name="--optimistic-types",                                                                           \
     2.7 +    short_name="-ot",                                                                                    \
     2.8      is_undocumented=true,                                                                                \
     2.9      desc="Use optimistic type assumptions with deoptimizing recompilation.", \
    2.10      default=true                                   \

mercurial