# HG changeset patch # User Thomas Wuerthinger # Date 1309543911 -7200 # Node ID 20058d88555bb8e704e818ac1d1cf1445ff5d7b9 # Parent 5c696a58e69296463f6656f42c000f1f6140509c Adjusted inlining decision (depend on max node size instead of max codeSize). diff -r 5c696a58e692 -r 20058d88555b graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java Fri Jul 01 19:39:29 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java Fri Jul 01 20:11:51 2011 +0200 @@ -44,7 +44,7 @@ public static boolean Intrinsify = true; public static boolean CacheGraphs = ____; public static boolean InlineWithTypeCheck = ____; - public static int MaximumInstructionCount = 37000; + public static int MaximumInstructionCount = 3000; public static float MaximumInlineRatio = 0.90f; public static int MaximumInlineSize = 35; public static int MaximumFreqInlineSize = 200; diff -r 5c696a58e692 -r 20058d88555b graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java Fri Jul 01 19:39:29 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java Fri Jul 01 20:11:51 2011 +0200 @@ -334,6 +334,12 @@ } break; } + if (!GraalOptions.Inline) { + break; + } + if (GraalOptions.TraceEscapeAnalysis || GraalOptions.PrintEscapeAnalysis) { + TTY.println("Trying inlining to get a non-escaping object for %d", node.id()); + } new InliningPhase(compilation, ir, invokes).apply(graph); new DeadCodeEliminationPhase().apply(graph); exits.clear(); diff -r 5c696a58e692 -r 20058d88555b graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Fri Jul 01 19:39:29 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Fri Jul 01 20:11:51 2011 +0200 @@ -1146,13 +1146,7 @@ assert x.predecessors().size() == 0 : "instruction should not have been appended yet"; assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")"; lastInstr.setNext(x); - lastInstr = x; - if (++stats.nodeCount >= GraalOptions.MaximumInstructionCount) { - // bailout if we've exceeded the maximum inlining size - throw new CiBailout("Method and/or inlining is too large"); - } - return x; } diff -r 5c696a58e692 -r 20058d88555b graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Fri Jul 01 19:39:29 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Fri Jul 01 20:11:51 2011 +0200 @@ -78,8 +78,7 @@ if (!invoke.isDeleted()) { RiMethod code = inlineInvoke(invoke, iterations, ratio); if (code != null) { - inliningSize += code.codeSize(); - if (inliningSize > GraalOptions.MaximumInstructionCount) { + if (graph.getNodeCount() > GraalOptions.MaximumInstructionCount) { break; } @@ -94,12 +93,6 @@ } } } - if (inliningSize > GraalOptions.MaximumInstructionCount) { - if (GraalOptions.TraceInlining) { - TTY.println("inlining stopped: MaximumInstructionCount reached"); - } - break; - } if (newInvokes.isEmpty()) { break; }