# HG changeset patch # User Thomas Wuerthinger # Date 1397733445 -7200 # Node ID 039d8902bdb8e79306dda0f317d6fd674360c16e # Parent 19a98af07b63e0d9edbc04be0bffe46af8a34ed1# Parent bbd2583f4f1d832efe4e50478971ca26aa8aba15 Merge. diff -r bbd2583f4f1d -r 039d8902bdb8 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotOptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotOptimizedCallTarget.java Thu Apr 17 09:59:27 2014 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotOptimizedCallTarget.java Thu Apr 17 13:17:25 2014 +0200 @@ -53,10 +53,6 @@ return speculationLog; } - public boolean isOptimized() { - return isValid() || installedCodeTask != null; - } - @Override public Object call(Object... args) { return callBoundary(args); @@ -111,7 +107,6 @@ Future task = this.installedCodeTask; if (task != null) { task.cancel(true); - this.installedCodeTask = null; logOptimizingUnqueued(this, oldNode, newNode, reason); compilationProfile.reportInvalidated(); } @@ -140,7 +135,7 @@ Future codeTask = this.installedCodeTask; if (codeTask != null) { if (codeTask.isCancelled() || codeTask.isDone()) { - installedCodeTask = null; + // System.out.println("done or cancelled => set null " + codeTask.isCancelled()); return false; } return true; @@ -160,23 +155,26 @@ } } - private InstalledCode receiveInstalledCode() { + @Override + public void exceptionWhileCompiling(Throwable t) { + compilationEnabled = false; + logOptimizingFailed(this, t.getMessage()); + if (t instanceof BailoutException) { + // Bailout => move on. + } else { + if (TruffleCompilationExceptionsAreFatal.getValue()) { + t.printStackTrace(OUT); + System.exit(-1); + } + } + } + + private void receiveInstalledCode() { try { - return installedCodeTask.get(); + // Force task completion. + installedCodeTask.get(); } catch (InterruptedException | ExecutionException e) { - compilationEnabled = false; - logOptimizingFailed(this, e.getMessage()); - if (e.getCause() instanceof BailoutException) { - // Bailout => move on. - } else { - if (TraceTruffleCompilationExceptions.getValue()) { - e.printStackTrace(OUT); - } - if (TruffleCompilationExceptionsAreFatal.getValue()) { - System.exit(-1); - } - } - return null; + exceptionWhileCompiling(e.getCause()); } } diff -r bbd2583f4f1d -r 039d8902bdb8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Thu Apr 17 09:59:27 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Thu Apr 17 13:17:25 2014 +0200 @@ -188,4 +188,6 @@ } + public abstract void exceptionWhileCompiling(Throwable e); + } diff -r bbd2583f4f1d -r 039d8902bdb8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Thu Apr 17 09:59:27 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Thu Apr 17 13:17:25 2014 +0200 @@ -118,11 +118,12 @@ public Future compile(final OptimizedCallTarget compilable) { return compileQueue.submit(new Callable() { @Override - public InstalledCode call() throws Exception { + public InstalledCode call() { try (Scope s = Debug.scope("Truffle", new TruffleDebugJavaMethod(compilable))) { return compileMethodImpl(compilable); } catch (Throwable e) { - throw Debug.handle(e); + compilable.exceptionWhileCompiling(e); + return null; } } }); diff -r bbd2583f4f1d -r 039d8902bdb8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Thu Apr 17 09:59:27 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Thu Apr 17 13:17:25 2014 +0200 @@ -94,9 +94,7 @@ @Option(help = "") public static final OptionValue TraceTruffleCacheDetails = new OptionValue<>(false); @Option(help = "") - public static final OptionValue TraceTruffleCompilationExceptions = new OptionValue<>(true); - @Option(help = "") - public static final OptionValue TruffleCompilationExceptionsAreFatal = new OptionValue<>(true); + public static final OptionValue TruffleCompilationExceptionsAreFatal = new OptionValue<>(false); @Option(help = "") public static final OptionValue TraceTruffleInlining = new OptionValue<>(false); @Option(help = "")