diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java @ 18962:cfb85e1f4ca5

Prevent polluting SLFunctionRegistry (via SLNodeFactory.createRead()) with LHS names of assignment
author Paul Woegerer <paul.woegerer@oracle.com>
date Tue, 27 Jan 2015 14:24:59 +0100
parents 0ef23ff7d5a1
children d1c1cd2530d7
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java	Tue Jan 27 14:11:52 2015 +0100
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLMain.java	Tue Jan 27 14:24:59 2015 +0100
@@ -140,7 +140,7 @@
      * Parse and run the specified SL source. Factored out in a separate method so that it can also
      * be used by the unit test harness.
      */
-    public static void run(SLContext context, Source source, PrintStream logOutput, int repeats) {
+    public static long run(SLContext context, Source source, PrintStream logOutput, int repeats) {
         if (logOutput != null) {
             logOutput.println("== running on " + Truffle.getRuntime().getName());
             // logOutput.println("Source = " + source.getCode());
@@ -163,6 +163,7 @@
         boolean dumpASTToIGV = false;
 
         printScript("before execution", context, logOutput, printASTToLog, printSourceAttributionToLog, dumpASTToIGV);
+        long totalRuntime = 0;
         try {
             for (int i = 0; i < repeats; i++) {
                 long start = System.nanoTime();
@@ -176,6 +177,7 @@
                     context.getOutput().println(formatTypeError(ex));
                 }
                 long end = System.nanoTime();
+                totalRuntime += end - start;
 
                 if (logOutput != null && repeats > 1) {
                     logOutput.println("== iteration " + (i + 1) + ": " + ((end - start) / 1000000) + " ms");
@@ -185,7 +187,7 @@
         } finally {
             printScript("after execution", context, logOutput, printASTToLog, printSourceAttributionToLog, dumpASTToIGV);
         }
-        return;
+        return totalRuntime;
     }
 
     /**