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

Reviewed-by: attila
This commit is contained in:
Marcus Lagergren 2014-10-06 10:43:57 +02:00
parent 1949d10887
commit d2a36ed370
2 changed files with 13 additions and 6 deletions

View File

@ -458,12 +458,14 @@ public final class Compiler implements Loggable {
@Override
public DebugLogger initLogger(final Context ctxt) {
final boolean optimisticTypes = ctxt.getEnv()._optimistic_types;
return ctxt.getLogger(this.getClass(), new Consumer<DebugLogger>() {
@Override
public void accept(final DebugLogger newLogger) {
if (!Compiler.this.getScriptEnvironment()._lazy_compilation) {
newLogger.warning("WARNING: Running with lazy compilation switched off. This is not a default setting.");
}
newLogger.warning("Optimistic types are ", optimisticTypes ? "ENABLED." : "DISABLED.");
}
});
}
@ -541,9 +543,10 @@ public final class Compiler implements Loggable {
* @throws CompilationException if error occurs during compilation
*/
public FunctionNode compile(final FunctionNode functionNode, final CompilationPhases phases) throws CompilationException {
log.finest("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
log.indent();
if (log.isEnabled()) {
log.info("Starting compile job for ", DebugLogger.quote(functionNode.getName()), " phases=", quote(phases.getDesc()));
log.indent();
}
final String name = DebugLogger.quote(functionNode.getName());
@ -560,7 +563,7 @@ public final class Compiler implements Loggable {
long time = 0L;
for (final CompilationPhase phase : phases) {
log.fine(phase, " starting for ", quote(name));
log.fine(phase, " starting for ", name);
try {
newFunctionNode = phase.apply(this, phases, newFunctionNode);
@ -588,8 +591,11 @@ public final class Compiler implements Loggable {
log.unindent();
if (info) {
final StringBuilder sb = new StringBuilder();
sb.append("Compile job for ").append(newFunctionNode.getSource()).append(':').append(quote(newFunctionNode.getName())).append(" finished");
final StringBuilder sb = new StringBuilder("Finished compile job for ");
sb.append(newFunctionNode.getSource()).
append(':').
append(quote(newFunctionNode.getName()));
if (time > 0L && timeLogger != null) {
assert env.isTimingEnabled();
sb.append(" in ").append(time).append(" ms");

View File

@ -203,6 +203,7 @@ nashorn.option.lazy.compilation = {
nashorn.option.optimistic.types = { \
name="--optimistic-types", \
short_name="-ot", \
is_undocumented=true, \
desc="Use optimistic type assumptions with deoptimizing recompilation.", \
default=true \