# HG changeset patch # User Miguel Garcia # Date 1399980009 -7200 # Node ID e90ec3e5e45b0c3d526959e3f098213be9c11c9f # Parent 25ccd455f751de1d32c407626bdcf0d6ee592b2c [inlining] documentation diff -r 25ccd455f751 -r e90ec3e5e45b graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java Tue May 13 16:51:41 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java Tue May 13 13:20:09 2014 +0200 @@ -93,6 +93,68 @@ return inliningCount; } + /** + *

+ * The space of inlining decisions is explored depth-first with the help of a stack realized by + * {@link InliningData}. At any point in time, its topmost element consist of: + *

+ *

+ * + *

+ * The bottom-most element in the stack consists of: + *

+ * + *

+ * + *

+ * The stack grows and shrinks as choices are made among the alternatives below: + *

    + *
  1. + * not worth inlining: pop any remaining graphs not yet delved into, pop the current invocation. + *
  2. + *
  3. + * process next invoke: delve into one of the callsites hosted in the current candidate graph, + * determine whether any inlining should be performed in it
  4. + *
  5. + * try to inline: move past the current inlining candidate (remove it from the topmost element). + * If that was the last one then try to inline the callsite that is (still) in the topmost + * element of {@link InliningData}, and then remove such callsite.
  6. + *
+ *

+ * + *

+ * Some facts about the alternatives above: + *

+ *

+ * + */ @Override protected void run(final StructuredGraph graph, final HighTierContext context) { final InliningData data = new InliningData(graph, context.getAssumptions());