# HG changeset patch # User Lukas Stadler # Date 1411129449 -7200 # Node ID 499804c831fce7b820134787317ac90edcc2d294 # Parent adaecbc405cb0381eb1671ff9f243040644be2df use compilation thread even for synchronous Truffle compilations diff -r adaecbc405cb -r 499804c831fc graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Fri Sep 19 13:49:00 2014 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Fri Sep 19 14:24:09 2014 +0200 @@ -334,11 +334,15 @@ } } }; - if (mayBeAsynchronous) { - Future future = compileQueue.submit(r); - this.compilations.put(optimizedCallTarget, future); - } else { - r.run(); + Future future = compileQueue.submit(r); + this.compilations.put(optimizedCallTarget, future); + + if (!mayBeAsynchronous) { + try { + future.get(); + } catch (InterruptedException | ExecutionException e) { + // silently ignored + } } }