diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/Truffle.java @ 15603:b7fb36e57da8

made Graal initialization be driven from Java to simplify sequencing and synchronization
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 May 2014 23:27:07 +0200
parents 51b2999299bc
children e52ad0d3b7d6
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/Truffle.java	Mon May 12 22:37:26 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/Truffle.java	Mon May 12 23:27:07 2014 +0200
@@ -33,7 +33,14 @@
 
     private static final TruffleRuntime RUNTIME;
 
-    private static native TruffleRuntime initializeRuntime();
+    /**
+     * Creates a new {@link TruffleRuntime} instance if the runtime has a specialized
+     * implementation.
+     *
+     * @throws UnsatisfiedLinkError if the runtime does not have a specialized implementation of
+     *             {@link TruffleRuntime}
+     */
+    private static native TruffleRuntime createRuntime();
 
     public static TruffleRuntime getRuntime() {
         return RUNTIME;
@@ -42,7 +49,7 @@
     static {
         TruffleRuntime runtime;
         try {
-            runtime = initializeRuntime();
+            runtime = createRuntime();
         } catch (UnsatisfiedLinkError e) {
             runtime = new DefaultTruffleRuntime();
         }