# HG changeset patch # User Thomas Wuerthinger # Date 1305559607 -7200 # Node ID 026b21a81651c9ff90c92d8fa995d1b31632bddd # Parent c5739b99762a491db8102acbbd7cb87b07e73aa6# Parent 9836845a75e690a7d8091198cd7884a9bb408901 Merge. diff -r 9836845a75e6 -r 026b21a81651 doc/design/graal_compiler.pdf Binary file doc/design/graal_compiler.pdf has changed diff -r 9836845a75e6 -r 026b21a81651 doc/design/graal_compiler.tex --- a/doc/design/graal_compiler.tex Mon May 16 17:12:05 2011 +0200 +++ b/doc/design/graal_compiler.tex Mon May 16 17:26:47 2011 +0200 @@ -201,12 +201,12 @@ An \texttt{If} instruction can directly point to its true and false successors without any intermediate nodes. This makes the graph more compact and simplifies graph traversal. -Listing \ref{lst:cfg2} shows an example Java program with an if statement where both paths do not contain any instruction with side effects. +Listing~\ref{lst:cfg2} shows an example Java program with an if statement where both paths do not contain any instruction with side effects. The \texttt{If} instruction can directly point its true and false successors to a \texttt{Merge} instruction. A \texttt{Phi} node that selects the appropriate value is appended to the \texttt{Merge} instruction. The \texttt{Return} instruction then has a data dependency on the \texttt{Phi} node. -\begin{lstlisting}[label=lst:cfg2, caption=Control flow in the graph, captionpos=b] +\begin{lstlisting}[label=lst:cfg2, caption=Control flow in the graph., captionpos=b] if (condition) { return 0; } else { return 1; } \end{lstlisting} @@ -248,9 +248,9 @@ They are modelled as instructions with an additional control flow continuation that points to an \texttt{ExceptionDispatch} instruction. The exception dispatch instruction decides based on the type of the exception object whether the control should flow to the catch handler or to another exception dispatch. If there is no catch handler in the currently compiled method, then the control flows into the \texttt{Unwind} instruction that handles the exception by forwarding it to the caller. -Listing \ref{lst:exc1} shows an example Java program with nested try blocks and Figure \ref{fig:exc1} shows the corresponding compiler graph. +Listing~\ref{lst:exc1} shows an example Java program with nested try blocks and Figure \ref{fig:exc1} shows the corresponding compiler graph. -\begin{lstlisting}[label=lst:exc1, caption=Exception dispatch in the compiler graph, captionpos=b] +\begin{lstlisting}[label=lst:exc1, caption=Exception dispatch in the compiler graph., captionpos=b] try { m1(); try { m2(); } catch(ExtendedException e) { ... } @@ -326,10 +326,10 @@ Data flow in loops is modelled with special phi nodes at the beginning and the end of the loop. The \nodename{LoopEnd} instruction merges every value that flows into the next loop iteration in associated \nodename{LoopEndPhi} nodes. A corresponding \nodename{LoopBeginPhi} node that is associated with the loop header has a control flow dependency on the \nodename{LoopEndPhi} node. -Listing \ref{lst:loop} shows a simple counting loop that is used as an example in the rest of this section. -Figure \ref{fig:loop2} shows how the loop is modelled immediately after building the graph. +Listing~\ref{lst:loop} shows a simple counting loop that is used as an example in the rest of this section. +Figure~\ref{fig:loop2} shows how the loop is modelled immediately after building the graph. -\begin{lstlisting}[label=lst:loop, caption=Loop example, captionpos=b] +\begin{lstlisting}[label=lst:loop, caption=Loop example that counts from 0 to n-1., captionpos=b] for(int i=0; i