changeset 17161:499804c831fc

use compilation thread even for synchronous Truffle compilations
author Lukas Stadler <lukas.stadler@oracle.com>
date Fri, 19 Sep 2014 14:24:09 +0200
parents adaecbc405cb
children 4a955509b98a
files graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
+            }
         }
     }