Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/Truffle.java @ 13331:51b2999299bc
make TruffleRuntime field final
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Sat, 14 Dec 2013 02:49:18 +0100 |
parents | 494b818b527c |
children | b7fb36e57da8 |
comparison
equal
deleted
inserted
replaced
13330:1f4c9729c9f0 | 13331:51b2999299bc |
---|---|
29 /** | 29 /** |
30 * Class for obtaining the Truffle runtime singleton object of this virtual machine. | 30 * Class for obtaining the Truffle runtime singleton object of this virtual machine. |
31 */ | 31 */ |
32 public class Truffle { | 32 public class Truffle { |
33 | 33 |
34 private static TruffleRuntime runtime; | 34 private static final TruffleRuntime RUNTIME; |
35 | 35 |
36 private static native TruffleRuntime initializeRuntime(); | 36 private static native TruffleRuntime initializeRuntime(); |
37 | 37 |
38 public static TruffleRuntime getRuntime() { | 38 public static TruffleRuntime getRuntime() { |
39 return runtime; | 39 return RUNTIME; |
40 } | 40 } |
41 | 41 |
42 static { | 42 static { |
43 TruffleRuntime runtime; | |
43 try { | 44 try { |
44 runtime = initializeRuntime(); | 45 runtime = initializeRuntime(); |
45 } catch (UnsatisfiedLinkError e) { | 46 } catch (UnsatisfiedLinkError e) { |
46 runtime = new DefaultTruffleRuntime(); | 47 runtime = new DefaultTruffleRuntime(); |
47 } | 48 } |
49 RUNTIME = runtime; | |
48 } | 50 } |
49 } | 51 } |