changeset 17408:f0792f868d7d

Truffle: improve documentation for compiler options.
author Christian Humer <christian.humer@gmail.com>
date Thu, 09 Oct 2014 17:25:35 +0200
parents c4cdee8566a4
children 4c0dcd164718
files graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/CounterBasedCompilationPolicy.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TraceCompilationProfile.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java
diffstat 3 files changed, 82 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/CounterBasedCompilationPolicy.java	Thu Oct 09 17:25:59 2014 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/CounterBasedCompilationPolicy.java	Thu Oct 09 17:25:35 2014 +0200
@@ -27,7 +27,8 @@
     private boolean compilationFailed;
 
     public boolean shouldCompile(CompilationProfile profile) {
-        return !compilationFailed && profile.getInterpreterCallCount() >= profile.getCompilationCallThreshold() && profile.getInterpreterCallAndLoopCount() >= profile.getCompilationCallAndLoopThreshold();
+        return !compilationFailed && profile.getInterpreterCallCount() >= profile.getCompilationCallThreshold() &&
+                        profile.getInterpreterCallAndLoopCount() >= profile.getCompilationCallAndLoopThreshold();
     }
 
     public void recordCompilationFailure(Throwable t) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TraceCompilationProfile.java	Thu Oct 09 17:25:35 2014 +0200
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.truffle;
+
+public class TraceCompilationProfile extends CompilationProfile {
+
+    private int directCallCount;
+    private int indirectCallCount;
+    private int inlinedCallCount;
+
+    public TraceCompilationProfile(int compilationThreshold, int initialInvokeCounter) {
+        super(compilationThreshold, initialInvokeCounter);
+    }
+
+    @Override
+    public void reportIndirectCall() {
+        indirectCallCount++;
+    }
+
+    @Override
+    public void reportDirectCall() {
+        directCallCount++;
+    }
+
+    @Override
+    public void reportInlinedCall() {
+        inlinedCallCount++;
+    }
+
+    public int getIndirectCallCount() {
+        return indirectCallCount;
+    }
+
+    public int getDirectCallCount() {
+        return directCallCount;
+    }
+
+    public int getInlinedCallCount() {
+        return inlinedCallCount;
+    }
+
+    public int getTotalCallCount() {
+        return directCallCount + indirectCallCount + inlinedCallCount;
+    }
+
+}
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java	Thu Oct 09 17:25:59 2014 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java	Thu Oct 09 17:25:35 2014 +0200
@@ -94,33 +94,33 @@
     public static final OptionValue<Boolean> TruffleArgumentTypeSpeculation = new StableOptionValue<>(true);
 
     // tracing
-    @Option(help = "Prints potential performance problems of the guest language implementation.")
+    @Option(help = "Print potential performance problems")
     public static final OptionValue<Boolean> TraceTrufflePerformanceWarnings = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print information for compilation results")
     public static final OptionValue<Boolean> TraceTruffleCompilation = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print information for compilation queuing")
     public static final OptionValue<Boolean> TraceTruffleCompilationDetails = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print a node count histogram after each compilation")
     public static final OptionValue<Boolean> TraceTruffleCompilationHistogram = new OptionValue<>(false);
-    @Option(help = "Prints out all polymorphic and generic nodes after compilation.")
+    @Option(help = "Print all polymorphic and generic nodes after each compilation")
     public static final OptionValue<Boolean> TraceTruffleCompilationPolymorphism = new OptionValue<>(false);
-    @Option(help = "Prints out all polymorphic and generic nodes after compilation.")
+    @Option(help = "Print all polymorphic and generic nodes after each compilation")
     public static final OptionValue<Boolean> TraceTruffleCompilationAST = new OptionValue<>(false);
-    @Option(help = "Prints out all calls of a compiled method.")
+    @Option(help = "Print the inlined call tree for each compiled method")
     public static final OptionValue<Boolean> TraceTruffleCompilationCallTree = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print the expansion trees for each compilation")
     public static final OptionValue<Boolean> TraceTruffleExpansion = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print source secions for printed expansion trees")
     public static final OptionValue<Boolean> TraceTruffleExpansionSource = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print detailed information for the Truffle compilation cache")
     public static final OptionValue<Boolean> TraceTruffleCacheDetails = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Treat compilation exceptions as fatal exceptions that will exit the application")
     public static final OptionValue<Boolean> TruffleCompilationExceptionsAreFatal = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Treat compilation exceptions as thrown runtime exceptions")
     public static final OptionValue<Boolean> TruffleCompilationExceptionsAreThrown = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print information for inlining for each compilation.")
     public static final OptionValue<Boolean> TraceTruffleInlining = new OptionValue<>(false);
-    @Option(help = "")
+    @Option(help = "Print information for each splitted call site.")
     public static final OptionValue<Boolean> TraceTruffleSplitting = new OptionValue<>(false);
     @Option(help = "Print stack trace on transfer to interpreter")
     public static final OptionValue<Boolean> TraceTruffleTransferToInterpreter = new StableOptionValue<>(false);