# HG changeset patch # User Thomas Wuerthinger # Date 1307537407 -7200 # Node ID 5d4aa5672d3d5ad988819be17df1677439f474a4 # Parent 5fd2b31f50ee8b0decd4831cbaa875de55dad4c0 Small fix to design document. diff -r 5fd2b31f50ee -r 5d4aa5672d3d graal/com.oracle.max.graal.doc.initial/graal_compiler.pdf Binary file graal/com.oracle.max.graal.doc.initial/graal_compiler.pdf has changed diff -r 5fd2b31f50ee -r 5d4aa5672d3d graal/com.oracle.max.graal.doc.initial/graal_compiler.tex --- a/graal/com.oracle.max.graal.doc.initial/graal_compiler.tex Wed Jun 08 14:17:19 2011 +0200 +++ b/graal/com.oracle.max.graal.doc.initial/graal_compiler.tex Wed Jun 08 14:50:07 2011 +0200 @@ -29,6 +29,11 @@ \newcommand\ls[1]{\mynote{LS}{#1}} \newcommand\nodename[1]{\texttt{#1}} +\hyphenpenalty=0 +\doublehyphendemerits=0 +\finalhyphendemerits=0 +\clubpenalty10000 +\widowpenalty10000 \smartqed % flush right qed marks, e.g. at end of proof @@ -166,7 +171,7 @@ \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} -\begin{figure}[h] +\begin{figure}[ht] \centering \begin{digraphenv}{scale=0.5}{graphdirections} \node{node1}{Node} @@ -211,6 +216,7 @@ 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. +Figure~\ref{fig:loopexits} shows the corresponding compiler graph. 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. @@ -220,7 +226,7 @@ else { return 1; } \end{lstlisting} -\begin{figure}[h] +\begin{figure}[ht] \centering \begin{digraphenv}{scale=0.5}{cfg2} \textnode{entry}{Entry} @@ -242,13 +248,13 @@ \control{merge}{return} \end{digraphenv} \caption{A simple loop with two exits.} - \label{fig:exc1} + \label{fig:loopexits} \end{figure} \section{Exceptions} \label{sec:Exceptions} -We do not throw runtime exceptions (e.g., \texttt{IndexOutOf\-BoundsException}, \texttt{NullPointerException}, or \texttt{Out\-Of\-MemoryException}), but deoptimize instead. +We do not throw runtime exceptions (e.g., \texttt{IndexOutOf\-BoundsException}, \texttt{Null\-Pointer\-Exception}, or \texttt{Out\-Of\-Memory\-Exception}), but deoptimize instead. This reduces the places in the compiled code where an exact bytecode location and debug information must be known. Additionally, this greatly reduces the number of exception handler edges in the compiled code. The main advantage of this technique is however, that we are free in moving around bounds checks, memory allocation, memory accesses with implicit null checks, etc. @@ -268,7 +274,7 @@ } catch(Exception e) { ... } \end{lstlisting} -\begin{figure}[h] +\begin{figure}[ht] \centering \begin{digraphenv}{scale=0.5}{exc1} \textnode{entry}{Entry} @@ -309,7 +315,7 @@ An algorithm that traverses the control flow has to explicitely decide whether it wants to incorporate backedges (i.e., special case of the treatment of \nodename{LoopEnd}) or ignore them. Figure \ref{fig:loop1} shows a simple example with a loop with a single entry and two exits. -\begin{figure}[h] +\begin{figure}[ht] \centering \begin{digraphenv}{scale=0.5}{layout1} \textnode{BeforeLoop}{Loop entry} @@ -342,7 +348,7 @@ for(int i=0; i