Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Eliminate double-compile and print pass list on failure.
  • Loading branch information
headius committed Oct 9, 2014
1 parent 11aaf09 commit b8823f8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions core/src/main/java/org/jruby/compiler/JITCompiler.java
Expand Up @@ -259,7 +259,7 @@ public void run() {
return;
} catch (Throwable t) {
if (config.isJitLogging()) {
log(method, className + "." + methodName, "could not compile", t.getMessage());
log(method, className + "." + methodName, "Could not compile; passes run: " + method.getIRMethod().getExecutedPasses(), t.getMessage());
if (config.isJitLoggingVerbose()) {
t.printStackTrace();
}
Expand Down Expand Up @@ -323,19 +323,14 @@ protected void compile() {

method.ensureInstrsReady();

// we try twice; once with passes to see if it will succeed and once without
// This may not be ok since we'll end up running passes specific to JIT
// CON FIXME: Really should clone scope before passes in any case
visitor.setPrepare(false);
bytecode = visitor.compileToBytecode(method.getIRMethod());

if (bytecode.length > Options.JIT_MAXSIZE.load()) {
throw new NotCompilableException("bytecode size " + bytecode.length + " too large in " + method.getIRMethod());
}

// reset and do the compile for real
visitor.reset();
bytecode = visitor.compileToBytecode(method.getIRMethod());

counts.compiledCount.incrementAndGet();
counts.compileTime.addAndGet(System.nanoTime() - start);
counts.codeSize.addAndGet(bytecode.length);
Expand Down

0 comments on commit b8823f8

Please sign in to comment.