# HG changeset patch # User Thomas Wuerthinger # Date 1378391800 -7200 # Node ID 2bd626188d31932dd32075defe853e509638104d # Parent be9e54fbb69928dbd1a7d78d7692a560feffaba0 Introduce TruffleMinInvokeThreshold flag. diff -r be9e54fbb699 -r 2bd626188d31 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Thu Sep 05 10:59:01 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Thu Sep 05 16:36:40 2013 +0200 @@ -65,7 +65,7 @@ if (truffleCompiler == null) { truffleCompiler = new TruffleCompilerImpl(); } - return new OptimizedCallTarget(rootNode, frameDescriptor, truffleCompiler, TruffleCompilationThreshold.getValue()); + return new OptimizedCallTarget(rootNode, frameDescriptor, truffleCompiler, TruffleMinInvokeThreshold.getValue(), TruffleCompilationThreshold.getValue()); } @Override diff -r be9e54fbb699 -r 2bd626188d31 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Thu Sep 05 10:59:01 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Thu Sep 05 16:36:40 2013 +0200 @@ -43,10 +43,10 @@ private static final PrintStream OUT = TTY.out().out(); private static final int MIN_INVOKES_AFTER_INLINING = 2; - protected OptimizedCallTarget(RootNode rootNode, FrameDescriptor descriptor, TruffleCompiler compiler, int compilationThreshold) { + protected OptimizedCallTarget(RootNode rootNode, FrameDescriptor descriptor, TruffleCompiler compiler, int invokeCounter, int compilationThreshold) { super(rootNode, descriptor); this.compiler = compiler; - this.invokeCounter = compilationThreshold >> 7; + this.invokeCounter = invokeCounter; this.loopAndInvokeCounter = compilationThreshold; this.originalInvokeCounter = compilationThreshold; this.rootNode.setCallTarget(this); @@ -185,7 +185,7 @@ @Override public void reportLoopCount(int count) { - loopAndInvokeCounter -= count; + loopAndInvokeCounter = Math.max(0, loopAndInvokeCounter - count); } @Override diff -r be9e54fbb699 -r 2bd626188d31 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 Sep 05 10:59:01 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Thu Sep 05 16:36:40 2013 +0200 @@ -46,6 +46,8 @@ @Option(help = "") public static final OptionValue TruffleCompilationThreshold = new OptionValue<>(1000); @Option(help = "") + public static final OptionValue TruffleMinInvokeThreshold = new OptionValue<>(3); + @Option(help = "") public static final OptionValue TruffleInvalidationReprofileCount = new OptionValue<>(3); @Option(help = "") public static final OptionValue TruffleReplaceReprofileCount = new OptionValue<>(10);