# HG changeset patch # User Christian Humer # Date 1412868335 -7200 # Node ID f0792f868d7df0b64f7495680aab2fad2ecb0f41 # Parent c4cdee8566a4bd35daf573763ce73b3bc6ff8716 Truffle: improve documentation for compiler options. diff -r c4cdee8566a4 -r f0792f868d7d graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/CounterBasedCompilationPolicy.java --- 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) { diff -r c4cdee8566a4 -r f0792f868d7d graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TraceCompilationProfile.java --- /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; + } + +} diff -r c4cdee8566a4 -r f0792f868d7d graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java --- 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 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 TraceTrufflePerformanceWarnings = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print information for compilation results") public static final OptionValue TraceTruffleCompilation = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print information for compilation queuing") public static final OptionValue TraceTruffleCompilationDetails = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print a node count histogram after each compilation") public static final OptionValue 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 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 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 TraceTruffleCompilationCallTree = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print the expansion trees for each compilation") public static final OptionValue TraceTruffleExpansion = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print source secions for printed expansion trees") public static final OptionValue TraceTruffleExpansionSource = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print detailed information for the Truffle compilation cache") public static final OptionValue TraceTruffleCacheDetails = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Treat compilation exceptions as fatal exceptions that will exit the application") public static final OptionValue TruffleCompilationExceptionsAreFatal = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Treat compilation exceptions as thrown runtime exceptions") public static final OptionValue TruffleCompilationExceptionsAreThrown = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print information for inlining for each compilation.") public static final OptionValue TraceTruffleInlining = new OptionValue<>(false); - @Option(help = "") + @Option(help = "Print information for each splitted call site.") public static final OptionValue TraceTruffleSplitting = new OptionValue<>(false); @Option(help = "Print stack trace on transfer to interpreter") public static final OptionValue TraceTruffleTransferToInterpreter = new StableOptionValue<>(false);