changeset 2687:77e106760633

Additional subsection on inlining.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Mon, 16 May 2011 19:26:40 +0200
parents 017253860bbb
children 3396862d4cee
files doc/design/graal_compiler.pdf doc/design/graal_compiler.tex
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
Binary file doc/design/graal_compiler.pdf has changed
--- a/doc/design/graal_compiler.tex	Mon May 16 17:53:02 2011 +0200
+++ b/doc/design/graal_compiler.tex	Mon May 16 19:26:40 2011 +0200
@@ -163,8 +163,6 @@
     \end{itemize}
     \item Only inputs and successors can be changed, and changes to them will update the usages and predecessors.
     \item Every node must be able to support cloning and serialization.
-    \item Inlining should always be performed as embedding one graph into another graph.
-    \item Nodes cannot be reassigned to another graph, they are cloned instead.
     \item The edges of a node also define \textit{happens-before} and \textit{happens-after} relationships as shown in Figure~\ref{fig:directions}.
 \end{itemize}
 
@@ -192,6 +190,17 @@
   \label{fig:directions}
 \end{figure}
 
+\subsection{Inlining}
+Inlining is always performed by embedding one graph into another graph.
+Nodes cannot be reassigned to another graph, they are cloned instead.
+Therefore, inlining is performed by copying and rewiring the nodes of the inlined method into the graph of the outer method.
+While the copying will decrease compilation performance, it enables us to cache the graph for the inlined method, optimize it independently from the outer method, and use the optimized graph for subsequent inlinings.
+We do not expect a significant negative impact on overall compilation performance.
+
+We are able to perform the inlining at any point during the compilation of a method and can therefore selectively expand the inlining if a certain optimization turns out to depend on the inlining of a method.
+An example for this would be when the escape analysis finds out that a certain object only escapes because of one method call and this method call is not inlined, because the penalty was to high.
+In this case, we can chose to nevertheless inline the method in order to increase the chances for finding out that the object does not escape.
+
 \section{Control Flow}
 
 Control flow is managed in way where the predecessor node contains direct pointers to its successor nodes.