# HG changeset patch # User Thomas Wuerthinger # Date 1379106730 -7200 # Node ID e9fc19eb3efb39c6711154d552b2472d6b0f6379 # Parent 2bd626188d31932dd32075defe853e509638104d# Parent a0566c8dcabfb68233b06f9cc1e10c6c46685ac3 Merge. diff -r a0566c8dcabf -r e9fc19eb3efb 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 Fri Sep 13 17:54:59 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Fri Sep 13 23:12:10 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 a0566c8dcabf -r e9fc19eb3efb 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 Fri Sep 13 17:54:59 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Fri Sep 13 23:12:10 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 a0566c8dcabf -r e9fc19eb3efb 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 Fri Sep 13 17:54:59 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Fri Sep 13 23:12:10 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);