Skip to content

Commit

Permalink
Wrap all runtime JIT in try/catch to help cases like #4255.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Oct 30, 2016
1 parent f2b3a17 commit 35f4547
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions core/src/main/java/org/jruby/compiler/JITCompiler.java
Expand Up @@ -181,18 +181,22 @@ public void buildThresholdReached(ThreadContext context, final Compilable method

Runnable jitTask = getTaskFor(context, method);

if (config.getJitBackground() && config.getJitThreshold() > 0) {
try {
executor.submit(jitTask);
} catch (RejectedExecutionException ree) {
// failed to submit, just run it directly
try {
if (config.getJitBackground() && config.getJitThreshold() > 0) {
try {
executor.submit(jitTask);
} catch (RejectedExecutionException ree) {
// failed to submit, just run it directly
jitTask.run();
}
} else {
// Because are non-asynchonously build if the JIT threshold happens to be 0 we will have no ic yet.
method.ensureInstrsReady();
// just run directly
jitTask.run();
}
} else {
// Because are non-asynchonously build if the JIT threshold happens to be 0 we will have no ic yet.
method.ensureInstrsReady();
// just run directly
jitTask.run();
} catch (Exception e) {
throw new NotCompilableException(e);
}
}

Expand Down

0 comments on commit 35f4547

Please sign in to comment.