changeset 11723:9b8e3b2986c5

add two options for compilation decisions based on time passed
author Christian Wirth <christian.wirth@oracle.com>
date Thu, 19 Sep 2013 10:38:00 +0200
parents ff05c78a7f64
children c8d0d5ff846e
files graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/CompilationPolicy.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/CompilationPolicy.java	Thu Sep 19 10:36:56 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/CompilationPolicy.java	Thu Sep 19 10:38:00 2013 +0200
@@ -90,14 +90,18 @@
 
     public boolean compileOrInline() {
         if (invokeCounter <= 0 && loopAndInvokeCounter <= 0) {
-            long timestamp = System.currentTimeMillis();
-            if ((timestamp - prevTimestamp) < 100) {
+            if (TruffleUseTimeForCompilationDecision.getValue()) {
+                long timestamp = System.currentTimeMillis();
+                if ((timestamp - prevTimestamp) < TruffleCompilationDecisionTime.getValue()) {
+                    return true;
+                }
+                this.invokeCounter = initialInvokeCounter;
+                this.loopAndInvokeCounter = compilationThreshold;
+                this.originalInvokeCounter = compilationThreshold;
+                this.prevTimestamp = timestamp;
+            } else {
                 return true;
             }
-            this.invokeCounter = initialInvokeCounter;
-            this.loopAndInvokeCounter = compilationThreshold;
-            this.originalInvokeCounter = compilationThreshold;
-            this.prevTimestamp = timestamp;
         }
         return false;
     }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java	Thu Sep 19 10:36:56 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java	Thu Sep 19 10:38:00 2013 +0200
@@ -71,7 +71,10 @@
     public static final OptionValue<Integer> TruffleInliningTrivialSize = new OptionValue<>(10);
     @Option(help = "")
     public static final OptionValue<Double> TruffleInliningMinFrequency = new OptionValue<>(0.3);
-
+    @Option(help = "")
+    public static final OptionValue<Boolean> TruffleUseTimeForCompilationDecision = new OptionValue<>(false);
+    @Option(help = "")
+    public static final OptionValue<Integer> TruffleCompilationDecisionTime = new OptionValue<>(100);
     // tracing
     @Option(help = "")
     public static final OptionValue<Boolean> TraceTruffleCompilation = new OptionValue<>(true);