Skip to content

Commit

Permalink
[fix] Crash VM on compiler assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Nov 29, 2019
1 parent f48cac1 commit 3883484
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions com.sun.max/src/com/sun/max/vm/compiler/CompilationBroker.java
Expand Up @@ -500,20 +500,20 @@ public TargetMethod compile(ClassMethodActor cma, Nature nature, boolean isDeopt
// TODO: we don't ever want to be waiting on a compilation
return compilation.get();
}
} catch (Throwable t) {
} catch (CiBailout bailout) {
if (VMOptions.verboseOption.verboseCompilation) {
boolean lockDisabledSafepoints = Log.lock();
Log.printCurrentThread(false);
Log.println(": Compilation of " + cma + " by " + compilation.compiler + " failed with:");
t.printStackTrace(Log.out);
bailout.printStackTrace(Log.out);
Log.unlock(lockDisabledSafepoints);
}
if (failFast) {
throw t;
throw bailout;
}
if (!FailOverCompilation || retryRun || (baselineCompiler == null) || (isHosted() && compilation.compiler == optimizingCompiler)) {
// This is the final failure: no other compilers available or failover is disabled
throw FatalError.unexpected("Compilation of " + cma + " by " + compilation.compiler + " failed (final attempt)", t);
throw FatalError.unexpected("Compilation of " + cma + " by " + compilation.compiler + " failed (final attempt)", bailout);
}
// cannot retry if specific compilation nature is specified so fall back to previous compilations if
// available, else throw an exception
Expand All @@ -523,7 +523,7 @@ public TargetMethod compile(ClassMethodActor cma, Nature nature, boolean isDeopt
return compilation.prevCompilations.currentTargetMethod(nature);
} else {
throw FatalError.unexpected("Cannot retry compilation of " + cma
+ " because a specific compilation nature is specified (" + nature + ")", t);
+ " because a specific compilation nature is specified (" + nature + ")", bailout);
}
}
retryRun = true;
Expand All @@ -533,6 +533,8 @@ public TargetMethod compile(ClassMethodActor cma, Nature nature, boolean isDeopt
Log.println(": Retrying with " + selectRetryCompiler(cma, nature, compilation.compiler) + "...");
Log.unlock(lockDisabledSafepoints);
}
} catch (Throwable t) {
throw FatalError.unexpected("Compilation of " + cma + " by " + compilation.compiler + " failed", t);
}
}
}
Expand Down

0 comments on commit 3883484

Please sign in to comment.