# HG changeset patch # User bharadwaj # Date 1399365306 -7200 # Node ID 44d700e2fabaa5498024dc760ebaca74b2ceecf9 # Parent 589c3627fab83a107ccf15e4cc93a9548956aa91 made GraphKit.inlineInvoke recursively inline all invoke diff -r 589c3627fab8 -r 44d700e2faba graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Mon May 05 20:33:00 2014 -0700 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Tue May 06 10:35:06 2014 +0200 @@ -73,7 +73,7 @@ /** * Ensures a floating node is added to or already present in the graph via {@link Graph#unique}. - * + * * @return a node similar to {@code node} if one exists, otherwise {@code node} */ public T unique(T node) { @@ -103,7 +103,7 @@ /** * Creates and appends an {@link InvokeNode} for a call to a given method with a given set of * arguments. The method is looked up via reflection based on the declaring class and name. - * + * * @param declaringClass the class declaring the invoked method * @param name the name of the invoked method * @param args the arguments to the invocation @@ -151,7 +151,7 @@ /** * Determines if a given set of arguments is compatible with the signature of a given method. - * + * * @return true if {@code args} are compatible with the signature if {@code method} * @throws AssertionError if {@code args} are not compatible with the signature if * {@code method} @@ -186,16 +186,17 @@ } /** - * {@linkplain #inline Inlines} all invocations currently in the graph. + * Recursively {@linkplain #inline inlines} all invocations currently in the graph. */ public void inlineInvokes(SnippetReflectionProvider snippetReflection) { - for (InvokeNode invoke : graph.getNodes().filter(InvokeNode.class).snapshot()) { - inline(invoke, snippetReflection); + while (!graph.getNodes().filter(InvokeNode.class).isEmpty()) { + for (InvokeNode invoke : graph.getNodes().filter(InvokeNode.class).snapshot()) { + inline(invoke, snippetReflection); + } } // Clean up all code that is now dead after inlining. new DeadCodeEliminationPhase().apply(graph); - assert graph.getNodes().filter(InvokeNode.class).isEmpty(); } /** @@ -240,7 +241,7 @@ * emitting the code executed when the condition hold; and a call to {@link #elsePart} to start * emititng the code when the condition does not hold. It must be followed by a call to * {@link #endIf} to close the if-block. - * + * * @param condition The condition for the if-block * @param trueProbability The estimated probability the the condition is true */