Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java @ 21573:ffdd2ec86f42
Truffle/Debugging: temporary patches so the DebugEngine will work (partially) with the new TruffleVM framework.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Wed, 27 May 2015 20:52:21 -0700 |
parents | fc376e0b80ba |
children | a880844225e4 |
comparison
equal
deleted
inserted
replaced
21572:d6d7e51d9206 | 21573:ffdd2ec86f42 |
---|---|
179 while (repeats-- > 0) { | 179 while (repeats-- > 0) { |
180 main.invoke(null); | 180 main.invoke(null); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 public static void run(Source source) throws IOException { | |
185 TruffleVM vm = TruffleVM.newVM().build(); | |
186 assert vm.getLanguages().containsKey("application/x-sl"); | |
187 vm.eval(new File(source.getPath()).toURI()); | |
188 Symbol main = vm.findGlobalSymbol("main"); | |
189 if (main == null) { | |
190 throw new SLException("No function main() defined in SL source file."); | |
191 } | |
192 main.invoke(null); | |
193 } | |
194 | |
184 /** | 195 /** |
185 * Parse and run the specified SL source. Factored out in a separate method so that it can also | 196 * Parse and run the specified SL source. Factored out in a separate method so that it can also |
186 * be used by the unit test harness. | 197 * be used by the unit test harness. |
187 */ | 198 */ |
188 public static long run(TruffleVM context, URI source, PrintWriter logOutput, PrintWriter out, int repeats, List<NodeFactory<? extends SLBuiltinNode>> currentBuiltins) throws IOException { | 199 public static long run(TruffleVM context, URI source, PrintWriter logOutput, PrintWriter out, int repeats, List<NodeFactory<? extends SLBuiltinNode>> currentBuiltins) throws IOException { |