changeset 2894:d9ee2a573a55

Merge.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 08 Jun 2011 14:10:06 +0200
parents 5410e7a2873b (diff) 693e4e92346b (current diff)
children 5fd2b31f50ee 241798fa9d34
files graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeArray.java
diffstat 144 files changed, 6896 insertions(+), 8765 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Jun 08 13:06:45 2011 +0200
+++ b/.hgignore	Wed Jun 08 14:10:06 2011 +0200
@@ -10,6 +10,8 @@
 \.log$
 \.bak$
 \.aux$
+\.pdf$
+\.dot$
 ^doc/.*/dot_temp_
 ^doc/doxygen/.*$
 \.orig$
@@ -18,6 +20,7 @@
 /nbproject/private/
 ^graal/hotspot/java$
 ^scratch/
+^local/
 ^src/share/tools/hsdis/build/
 ^src/share/tools/IdealGraphVisualizer/[a-zA-Z0-9]*/build/
 ^src/share/tools/IdealGraphVisualizer/build/
Binary file doc/Goals.odt has changed
Binary file doc/IR.odt has changed
Binary file doc/IR.pdf has changed
--- a/doc/design/.project	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>GraalDocDesign</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>net.sourceforge.texlipse.builder.TexlipseBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>net.sourceforge.texlipse.builder.TexlipseNature</nature>
-	</natures>
-	<linkedResources>
-		<link>
-			<name>fleqn.clo</name>
-			<type>1</type>
-			<location>C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/fleqn.clo</location>
-		</link>
-	</linkedResources>
-</projectDescription>
--- a/doc/design/.texlipse	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#TeXlipse project settings
-#Fri Apr 29 14:13:11 CEST 2011
-builderNum=2
-outputDir=
-makeIndSty=
-bibrefDir=
-outputFormat=pdf
-tempDir=tmp
-mainTexFile=graal_compiler.tex
-outputFile=graal_compiler.pdf
-langSpell=en
-markDer=true
-srcDir=
Binary file doc/design/graal_compiler.pdf has changed
--- a/doc/design/graal_compiler.tex	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,846 +0,0 @@
-\documentclass[twocolumn]{svjour3}
-\usepackage{listings}
-\usepackage[pdftex]{graphicx}
-\usepackage{environ}
-\usepackage{amsmath}
-\usepackage{amsfonts}
-\usepackage[english]{babel}
-\usepackage[utf8]{inputenc} 
-\usepackage{lmodern}
-\usepackage[T1]{fontenc}
-\usepackage{color}
-
-\input{graphdrawing}
-
-\renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bf #1}
-
-\newcommand{\Sa}{{\Large$^*$}}
-\newcommand{\Sb}{{\Large$^\dag$}}
-\newcommand{\Sc}{{\Large$^\S$}}
-
-
-\newcommand{\mynote}[2]{
-\textcolor{red}{\fbox{\bfseries\sffamily\scriptsize#1}
-  {\small\textsf{\emph{#2}}}
-\fbox{\bfseries\sffamily\scriptsize }}}
-
-\newcommand\TODO[1]{\mynote{TODO}{#1}}
-\newcommand\cw[1]{\mynote{CW}{#1}}
-\newcommand\ls[1]{\mynote{LS}{#1}}
-\newcommand\nodename[1]{\texttt{#1}}
-
-
-
-\smartqed  % flush right qed marks, e.g. at end of proof
-
-\journalname{Graal Compiler Design}
-\def\makeheadbox{{%
-\hbox to0pt{\vbox{\baselineskip=10dd\hrule\hbox
-to\hsize{\vrule\kern3pt\vbox{\kern3pt
-\hbox{\bfseries The Graal Compiler - Design and Strategy}
-\kern3pt}\hfil\kern3pt\vrule}\hrule}%
-\hss}}}
-
-\begin{document}
-
-\author{Thomas W\"{u}rthinger \Sa, Lukas Stadler \Sc, Gilles Duboscq \Sa}
-\institute{\Sa Oracle, \Sc Johannes Kepler University, Linz}
-
-\date{Created: \today}
-
-\title{The Graal Compiler}
-\subtitle{Design and Strategy \\ \textcolor{red}{work in progress (Oracle internal)}}
-
-\maketitle
-
-\abstract{
-The Graal compiler (simply referred to as \emph{the compiler} in the rest of this document) aims at improving upon C1X, the Java port of the HotSpot client compiler, both in terms of modularity and peak performance.
-The compiler should work with the Maxine VM and the HotSpot VM.
-This document contains information about the proposed design and strategy for developing the compiler.}
-
-\section{Context}
-
-In 2009, the Maxine team started with creating C1X, a Java port of the HotSpot client compiler, and integrated it into the Maxine VM.
-Part of this effort was the development of a clear and clean compiler-runtime interface that allows the separation of the compiler and the VM.
-This compiler-runtime interface enables the use of one compiler for multiple VMs.
-In June 2010, we started integrating C1X into the HotSpot VM and we called the resulting system Graal~VM.
-Currently, the Graal~VM is fully functional and runs benchmarks (SciMark, DaCapo) at a similar speed as the HotSpot client compiler.
-
-\section{Goals}
-The compiler effort aims at rewriting the high-level intermediate representation of C1X with two main goals:
-\begin{description}
-\item[Modularity:] A modular design of the compiler should simplify the implementation of new languages, new back-ends, and new optimizations.
-\item[Peak Performance:] A more powerful intermediate representation should enable the implementation of aggressive optimizations that impact the peak performance of the resulting machine code.
-\end{description}
-
-\section{Design}
-For the implementation of the compiler, we rely on the following design decisions:
-\begin{description}
-\item[Graph Representation:]
-The compiler's intermediate representation is modeled as a graph with nodes that are connected with directed edges.
-There is only a single node base class and every node has an associated graph object that does not change during the node's lifetime.
-Every node is serializable and has an id that is unique within its graph.
-Every edge is classified as either a control flow edge (anti-dependency) or a data flow edge (dependency) and represented as a simple pointer from the source node to the target node.
-It is possible to replace a node with another node without traversing the full graph.
-The graph does not allow data flow edge cycles or control flow edge cycles.
-We achieve this by explicitly modeling loops (see Section~\ref{sec:loops}). 
-\item[Extensibility:]
-The compiler is extensible by allowing developers to add new compiler phases and new node subclasses without modifying the compiler's sources.
-A node has an abstract way of expressing its semantics and new compiler phases can ask compiler nodes for their properties and capabilities.
-We use the ``everything is an extension'' concept.
-Even standard compiler optimizations are internally modeled as extensions, to show that the extension mechanism exposes all necessary functionality.
-\item[Detailing:]
-The compilation starts with a graph that contains nodes that represent the operations of the source language (e.g., one node for an array store to an object array).
-During the compilation, the nodes are replaced with more detailed nodes (e.g., the array store node is split into a null check, a bounds check, a store check, and a memory access).
-Compiler phases can choose whether they want to work on the earlier versions of the graph (e.g., escape analysis) or on later versions (e.g., null check elimination).
-\item[Generality:]
-The compiler does not require Java as its input.
-This is achieved by having a graph as the starting point of the compilation and not a Java bytecode array.
-Building the graph from the Java bytecodes must happen before giving a method to the compiler.
-This enables front-ends for different languages (e.g., Ruby or JavaScript) to provide their own graph.
-Also, there is no dependency on a specific back-end, but the output of the compiler is a graph that can then be converted to a different representation in a final compiler phase.
-\end{description}
-
-\section{Milestones}
-\label{sec:mile}
-The compiler is being developed starting from the current C1X source code base.
-This helps us test the compiler at every intermediate development step on a variety of Java benchmarks.
-We define the following development milestones (see Section~\ref{sec:conclusions} for planned dates):
-\begin{description}
-\item[M1:] We have a fully working Graal~VM version with a stripped down C1X compiler that does not perform any optimization.
-\item[M2:] We modified the high-level intermediate representation to be based on the compiler graph data structure.
-\item[M3:] We have reimplemented and reenabled compiler optimizations in the compiler that previously existed in C1X.
-\item[M4:] We have reintegrated the new compiler into the Maxine VM and can use it as a Maxine VM bootstrapping compiler.
-\end{description}
-
-After those four milestones, we see three different possible further development directions that can be followed in parallel:
-\begin{itemize}
-  \item Removal of the XIR template mechanism and replacement with a snippet mechanism that works with the compiler graph.
-  \item Improvements for peak performance (loop optimizations, escape analysis, bounds check elimination, processing additional interpreter runtime feedback).
-  \item Implementation of a prototype front-end for a different language, e.g., JavaScript.
-\end{itemize}
-
-\section{Project Source Structure}
-In order to support the goal of a modular compiler, the code will be divided into the following source code projects (as subprojects of \textbf{com.oracle.max.graal}).
-
-\begin{description}
-    \item[graph] contains the abstract node implementation, the graph implementation and all the associated tools and auxiliary classes.
-    \item[nodes] contains the implementation of known basic nodes (e.g., phi nodes, control flow nodes, \ldots).
- 				 Additional node classes should go into separate projects and be specializations of the known basic nodes.
-    \item[java] contains code for building graphs from Java bytecodes and Java-specific nodes.
-    \item[opt] contains optimizations such as global value numbering or conditional constant propagation.
-    \item[compiler] contains the compiler, including:
-        \begin{itemize}
-            \item Scheduling of the compilation phases.
-            \item Implementation of the \emph{compiler interface} (CI).
-            \item Implementation of the final compilation phase that produces the low-level representation.
-            \item Machine code creation, including debug info.
-        \end{itemize}
-\end{description}
-
-
-\section{Graph}
-
-The \emph{intermediate representation}~(IR) of the compiler is designed as a directed graph.
-The graph allocates unique ids for new nodes and can be queried for the node corresponding to a given id as well as for an unordered list of nodes of the graph.
-Graphs can manage side data structures (e.g. dominator trees and temporary schedules), which will be automatically invalidated and lazily recomputed whenever the graph changes. These side data structures will usually be understood by more than one optimization.
-
-The nodes of the graph have the following properties:
-\begin{itemize}
-    \item Each node is always associated with a single graph and this association is immutable.
-    \item Each node has an immutable id that is unique within its associated graph.
-    \item Nodes can have a data dependency, which means that one node requires the result of another node as its input. The fact that the result of the first node needs to be computed before the second node can be executed introduces a partial order to the set of nodes.
-    \item Nodes can have a control flow dependency, which means that the execution of one node will be followed by the execution of another node. This includes conditional execution, memory access serialization and other reasons, and again introduces a partial order to the set of nodes.
-    \item Nodes can only have data and control dependencies to nodes which belong to the same graph.
-    \item Control dependencies and data dependencies each represent a \emph{directed acyclic graph} (DAG) on the same set of nodes. This means that data dependencies always point upwards, and control dependencies always point downwards in a drawing of the graph. Situations that normally incur cycles (like loops) are represented by special nodes (see Section~\ref{sec:loops}).
-	\item Ordering between nodes is specified only to the extent which is required to correctly express the semantics of a given program. This gives the compiler flexibility for the possible scheduling of a node and therefore wiggle room for optimizations. For algorithms that require a fixed ordering of nodes, a temporary schedule can always be generated.
-    \item Both data and control dependencies can be traversed in both directions, so that each node can be traversed in four directions (see Figure~\ref{fig:directions}):
-    \begin{itemize}
-        \item \emph{inputs} are all nodes that this node has data dependencies on.
-        \item \emph{usages} are all nodes whose inputs contain this node.
-        \item \emph{successors} are all nodes that have to be after this node in control flow.
-        \item \emph{predecessors} are all nodes whose successors contain this node.
-    \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 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]
-  \centering
-\begin{digraphenv}{scale=0.5}{graphdirections}
-\node{node1}{Node}
-\textnode{inputs}{inputs}
-\textnode{usages}{usages}
-\textnode{successors}{successors}
-\textnode{predecessors}{predecessors}
-\data{node1}{inputs}
-\control{node1}{successors}
-\data{usages}{node1}
-\control{predecessors}{node1}
-\node{node2}{Node}
-\textnode{before}{happens-before}
-\textnode{after}{happens-after}
-\data{node2}{before}
-\control{node2}{after}
-\data{after}{node2}
-\control{before}{node2}
-\end{digraphenv}
-  \caption{A node and its edges.}
-  \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.
-We reserve the term \textit{instruction} for nodes that are embedded in the control flow.
-This is opposite to the approach taken in the server compiler, where control flow and data flow edges point in the same direction.
-The advantage that we see in our approach is that there is no need for projection nodes in case of control flow splits.
-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.
-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]
-if (condition) { return 0; }
-else { return 1; }
-\end{lstlisting}
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{cfg2}
-\textnode{entry}{Entry}
-\textnode{condition}{condition}
-\textnode{const0}{0}
-\textnode{const1}{1}
-\nodesplit{if}{If}
-\control{entry}{if}
-\controllabel{if:succ1}{merge}
-\controllabel{if:succ2}{merge}
-\data{if}{condition}
-\node{merge}{Merge}
-\node{return}{Return}
-\nodetri{phi}{Phi}
-\datalabel{phi:in1}{merge}
-\datalabel{phi:in2}{const0}
-\datalabel{phi:in3}{const1}
-\data{return}{phi}
-\control{merge}{return}
-\end{digraphenv}
-  \caption{A simple loop with two exits.}
-  \label{fig:exc1}
-\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.
-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.
-
-There are only two kinds of instruction that need explicit exception edges, because they are the only instructions that can throw exceptions in compiled code: \texttt{Throw} instructions and \texttt{Invoke} instructions.
-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.
-
-\begin{lstlisting}[label=lst:exc1, caption=Exception dispatch in the compiler graph., captionpos=b]
-try { m1();
-  try { m2();
-  } catch(ExtendedException e) { ... }
-  m3();
-  throw exception;
-} catch(Exception e) { ... }
-\end{lstlisting}
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{exc1}
-\textnode{entry}{Entry}
-\textnode{catch1}{catch1}
-\textnode{catch2}{catch2}
-\nodesplit{m1}{Invoke m1}
-\nodesplit{m2}{Invoke m2}
-\nodesplit{m3}{Invoke m3}
-\nodesplit{dispatch1}{ExceptionDispatch}
-\nodesplit{dispatch2}{ExceptionDispatch}
-\node{throw}{Throw}
-\node{unwind}{Unwind}
-\control{entry}{m1}
-\controllabel{m1:succ1}{m2}
-\controllabel{m1:succ2}{dispatch2}
-\controllabel{m2:succ1}{m3}
-\controllabel{m2:succ2}{dispatch1}
-\controllabel{m3:succ1}{throw}
-\controllabel{m3:succ2}{dispatch2}
-\control{throw}{dispatch2}
-\controllabel{dispatch1:succ2}{catch1}
-\controllabel{dispatch1:succ1}{dispatch2}
-\controllabel{dispatch2:succ2}{catch2}
-\controllabel{dispatch2:succ1}{unwind}
-\end{digraphenv}
-  \caption{A simple loop with two exits.}
-  \label{fig:exc1}
-\end{figure}
-
-\section{Loops}
-\label{sec:loops}
-Loops form a first-class construct in the IR that is expressed by specialized IR nodes during all optimization phases.
-We only compile methods with a control flow where every loop has a single entry point.
-This entry point is a \nodename{LoopBegin} instruction.
-This instruction is connected to a \nodename{LoopEnd} instruction that merges all control flow paths that do not exit the loop.
-The edge between the \nodename{LoopBegin} and the \nodename{LoopEnd} is the backedge of the loop.
-It goes from the beginning to the end in order to make the graph acyclic.
-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]
-  \centering
-\begin{digraphenv}{scale=0.5}{layout1}
-\textnode{BeforeLoop}{Loop entry}
-\textnode{Exit1}{First loop exit}
-\textnode{Exit2}{Second loop exit}
-\nodesplit{LoopBegin}{LoopBegin}
-\node{LoopEnd}{LoopEnd}
-\nodesplit{If1}{If}
-\nodesplit{If2}{If}
-\controllabel{LoopBegin:succ1}{LoopEnd}
-\controllabel{LoopBegin:succ2}{If1}
-\controllabel{If1:succ1}{If2}
-\controllabel{If2:succ1}{LoopEnd}
-\controllabel{BeforeLoop}{LoopBegin}
-\controllabel{If1:succ2}{Exit1}
-\controllabel{If2:succ2}{Exit2}
-\end{digraphenv}
-  \caption{A simple loop with two exits.}
-  \label{fig:loop1}
-\end{figure}
-
-\subsection{Loop Phis}
-Data flow in loops is modeled 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.
-
-\begin{lstlisting}[label=lst:loop, caption=Loop example that counts from 0 to n-1., captionpos=b]
-for(int i=0; i<n; ++i) { }
-\end{lstlisting}
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{layout2}
-\textnode{BeforeLoop}{Loop entry}
-\textnode{Exit}{Loop exit}
-\textnode{n}{n}
-\textnode{Constant0}{0}
-\textnode{Constant1}{1}
-\nodesplit{LoopBegin}{LoopBegin}
-\node{LoopEnd}{LoopEnd}
-\nodesplit{If1}{If}
-\controllabel{LoopBegin:succ1}{LoopEnd}
-\controllabel{LoopBegin:succ2}{If1}
-\nodebi{Compare}{&lt;}
-\nodebi{LoopBeginPhi}{LoopBeginPhi}
-\nodebi{Add}{+}
-\datalabel{Add:in1}{LoopBeginPhi}
-\datalabel{Add:in2}{Constant1}
-\nodebi{LoopEndPhi}{LoopEndPhi}
-\control{LoopBeginPhi}{LoopEndPhi}
-\data{LoopEndPhi:in1}{LoopEnd}
-\data{LoopEndPhi:in2}{Add}
-\datalabel{LoopBeginPhi:in1}{LoopBegin}
-\datalabel{LoopBeginPhi:in2}{Constant0}
-\datalabel{Compare:in1}{LoopBeginPhi}
-\datalabel{Compare:in2}{n}
-\data{If1}{Compare}
-\controllabel{If1:succ1}{LoopEnd}
-\controllabel{BeforeLoop}{LoopBegin}
-\controllabel{If1:succ2}{Exit}
-\end{digraphenv}
-  \caption{Graph for a loop counting from 0 to n-1.}
-  \label{fig:loop2}
-\end{figure}
-
-\subsection{Loop Counters}
-The compiler is capable of recognizing variables that are only increased within a loop.
-A potential overflow of such a variable is prohibited with a guard before the loop (this is not necessary in this example, because the loop variable cannot overflow).
-Figure \ref{fig:loop3} shows the compiler graph of the example loop after the loop counter transformation.
-
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{layout3}
-\textnode{BeforeLoop}{Loop entry}
-\textnode{Exit}{Loop exit}
-\textnode{n}{n}
-\textnode{Constant0}{0}
-\textnode{Constant1}{1}
-\nodesplit{LoopBegin}{LoopBegin}
-\node{LoopEnd}{LoopEnd}
-\nodesplit{If1}{If}
-\controllabel{LoopBegin:succ1}{LoopEnd}
-\controllabel{LoopBegin:succ2}{If1}
-\nodebi{Compare}{&lt;}
-\nodetri{LoopCounter}{LoopCounter}
-\datalabel{LoopCounter:in1}{LoopBegin}
-\datalabeltext{LoopCounter:in2}{Constant0}{init}
-\datalabeltext{LoopCounter:in3}{Constant1}{stride}
-\datalabel{Compare:in1}{LoopCounter}
-\datalabel{Compare:in2}{n}
-\data{If1}{Compare}
-\controllabel{If1:succ1}{LoopEnd}
-\controllabel{BeforeLoop}{LoopBegin}
-\controllabel{If1:succ2}{Exit}
-\end{digraphenv}
-  \caption{Graph after loop counter transformation.}
-  \label{fig:loop3}
-\end{figure}
-
-\subsection{Bounded Loops}
-
-If the total maximum number of iterations of a loop is fixed, then the loop is converted into a bounded loop.
-The total number of iterations always denotes the number of full iterations of the loop with the control flowing from the loop begin to the loop end.
-If the total number of iterations is reached, the loop is exited directly from the loop header.
-In the example, we can infer from the loop exit with the comparison on the loop counter that the total number of iterations of the loop is limited to n.
-Figure \ref{fig:loop4} shows the compiler graph of the example loop after the bounded loop transformation.
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{layout4}
-\textnode{BeforeLoop}{Loop entry}
-\textnode{Exit}{Loop exit}
-\textnode{n}{n}
-\textnode{Constant0}{0}
-\textnode{Constant1}{1}
-\nodesplittri{LoopBegin}{BoundedLoopBegin}
-\node{LoopEnd}{LoopEnd}
-\controllabel{LoopBegin:succ1}{LoopEnd}
-\controllabel{LoopBegin:succ2}{LoopEnd}
-\controllabel{LoopBegin:succ3}{Exit}
-\nodetri{LoopCounter}{LoopCounter}
-\datalabel{LoopCounter:in1}{LoopBegin}
-\datalabeltext{LoopCounter:in2}{Constant0}{init}
-\datalabeltext{LoopCounter:in3}{Constant1}{stride}
-\data{LoopBegin}{n}
-\controllabel{BeforeLoop}{LoopBegin}
-\end{digraphenv}
-  \caption{Graph after bounded loop transformation.}
-  \label{fig:loop4}
-\end{figure}
-
-\subsection{Vectorization}
-
-If we have now a bounded loop with no additional loop exit and no associated phi nodes (only associated loop counters), we can vectorize the loop.
-We replace the loop header with a normal instruction that produces a vector of values from 0 to the number of loop iterations minus 1.
-The loop counters are replaced with \texttt{VectorAdd} and \texttt{VectorMul} nodes.
-The vectorization is only possible if every node of the loop can be replaced with a corresponding vector node.
-Figure \ref{fig:loop5} shows the compiler graph of the example loop after vectorization.
-The vector nodes all work on an ordered list of integer values and are subject to canonicalization and global value numbering like any other node.
-
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{layout5}
-\textnode{Entry}{Entry}
-\textnode{Exit}{Exit}
-\textnode{n}{n}
-\textnode{Constant0}{0}
-\textnode{Constant1}{1}
-\node{Vector}{Vector}
-\nodebi{VectorAdd}{VectorAdd}
-\nodebi{VectorMul}{VectorMul}
-\control{Entry}{Vector}
-\control{Vector}{Exit}
-\datalabel{VectorAdd:in1}{Vector}
-\datalabel{VectorAdd:in2}{Constant0}
-\datalabel{VectorMul:in1}{VectorAdd}
-\datalabel{VectorMul:in2}{Constant1}
-\data{Vector}{n}
-\end{digraphenv}
-  \caption{Graph after vectorization.}
-  \label{fig:loop5}
-\end{figure}
-
-
-\section{Frame States}
-A frame state captures the state of the program like it is seen in by an interpreter of the program.
-The frame state contains the information that is local to the current activation and will therefore disappear during SSA-form constructions or other compiler optimizations.
-For Java, the frame state is defined in terms of the Java bytecode specification (i.e., the values of the local variables, the operand stack, and the locked monitors).
-However, a frame state is not a concept specific to Java (e.g., the Crankshaft JavaScript engine uses frame states in their optimizing compiler to model the values of the AST interpreter).
-
-Frame states are necessary to support the deoptimization of the program, which is the precondition for performing aggressive optimizations that use optimistic assumptions.
-Therefore every point in the optimizing compiler that may revert execution back to the interpreter needs a valid frame state.
-However, the point where the interpreter continues execution need not correspond exactly to the execution position of the compiled code, because many Java bytecode instructions can be safely reexecuted.
-Thus, frame states need only be generated for the states after instructions that cannot be reexecuted, because they modify the state of the program.
-Examples for such instructions are:
-
-\begin{itemize}
-    \item Array stores (in Java bytecodes {\tt IASTORE, LASTORE, FASTORE, \\DASTORE, AASTORE, BASTORE, CASTORE, SASTORE})
-    \item Field stores (in Java bytecodes {\tt PUTSTATIC, PUTFIELD})
-    \item Method calls (in Java bytecodes {\tt INVOKEVIRTUAL, INVOKESPECIAL, \\INVOKESTATIC, INVOKEINTERFACE})
-    \item Synchronization (in Java bytecodes {\tt MONITORENTER, MONITOREXIT})
-\end{itemize}
-
-Within the graph a frame state is represented as a node that is attached to the instruction that caused it to be generated using a control dependency (see Figure~\ref{fig:fs1}).
-Frame states also have data dependencies on the contents of the state: the local variables and the expression stack.
-
-The frame state at the method beginning does not have to be explicitely in the graph, because it can always be reconstructed at a later stage.
-We save the frame state at control flow merges if there is at least one frame state on any control flow path between a node and its immediate dominator.
-
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{fs1}
-    \nodetrisplit{store1}{ArrayStore}
-    \nodebi{load1}{ArrayLoad}
-    \controllabel{store1:succ1}{load1}
-    \nodetrisplit{store2}{FieldStore}
-    \control{load1}{store2}
-    end [shape=plaintext, label="...", width="2.0"]
-    store2:succ1:s -> end:n [color=red];
-    %
-    \nodeframestate{fs1}{FrameState}
-    \controllabel{store1:succ2}{fs1}
-    \nodeframestate{fs2}{FrameState}
-    \controllabel{store2:succ2}{fs2}
-\end{digraphenv}
-  \caption{Simple example using two frame states.}
-  \label{fig:fs1}
-\end{figure}
-
-
-A deoptimization node needs a valid frame state that specifies the location and state where the interpreter should continue.
-The algorithm for constructing frame states makes sure that every possible location in the graph has a well-defined frame state that can be used by a deoptimization instruction.
-Therefore, there are no direct links between the deoptimization instruction and its frame state thus allowing the deoptimization instructions to move freely around.
-
-\subsection{Partial Escape Analysis}
-
-A partial escape analysis can help to further reduce the number of frame states.
-A field or array store does not create a new frame state, when the object that is modified did not have a chance to escape between its creation and the store.
-
-Listing~\ref{lst:escape1} shows an example of a method that creates two \texttt{Point} objects, connects them, and returns them.
-The object allocation of the first \texttt{Point} object does not need a frame state.
-We can always reexecute the \texttt{NEW} bytecode again in the interpreter.
-The \texttt{Point} object allocated by the compiler will then simply disappear after the next garbage collection.
-The following field store is a thread-local memory store, because the \texttt{Point} object did not have any chance to escape.
-Same applies to the assignment of the \texttt{next} field and the third field assignment.
-Therefore, the whole method \texttt{getPoint} does not need an explicit frame state, because at any time during execution of this method, we can deoptimize and continue execution in the interpreter at the first bytecode of the method.
-
-\begin{lstlisting}[label=lst:escape1, caption=Example method that needs no frame state., captionpos=b]
-void getPoint() {
-  Point p = new Point();
-  p.x = 1;
-  p.next = new Point();
-  p.next.x = 2;
-  return p;
-}
-\end{lstlisting}
-
-The reduction of frame states makes it easier for the compiler to perform memory optimizations like memory access coalescing.
-We believe that this reduction on frame states is the key to effective vectorization and other compiler optimizations where compilers of compilers of unmanaged languages have advantages.
-
-\subsection{Guards}
-A guard is a node that deoptimizes based on a conditional expression.
-Guards are not attached to a certain frame state, they can move around freely and will always use the correct frame state when the nodes are scheduled (i.e., the last emitted frame state).
-The node that is guarded by the deoptimization has a data dependency on the guard and the guard in turn has a data dependency on the condition.
-A guard must not be moved above any \texttt{If} nodes.
-Therefore, we use \texttt{Anchor} instructions after a control flow split and a data dependency from the guard to this anchor.
-The anchor is the most distant instruction that is postdominated by the guarded instruction and the guard can be scheduled anywhere between those two nodes.
-This ensures maximum flexibility for the guard instruction and guarantees that we only deoptimize if the control flow would have reached the guarded instruction (without taking exceptions into account).
-
-To illustrate the strengths of this approach, we show the graph for the Java code snippet shown in \ref{lst:guard1}.
-The example looks artificial, but in case of method inlining, this is a pattern that is not unlikely to be present in a normal Java program.
-Figure \ref{fig:guard0} shows the compiler graph for the example method after graph building.
-The field stores are both represented by a single instruction and the null check that is implicitely incorporated in the field store.
-
-\begin{lstlisting}[label=lst:guard1, caption=Example method that demonstrates the strengths of modelling the guards explicitely., captionpos=b]
-void init(Point p) {
-  if (p != null) {
-    p.x = 0;
-  }
-  p.y = 0;
-}
-\end{lstlisting}
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{guard0}
-	\textnode{entry}{Entry}
-    \nodesplit{if}{If}
-    \node{merge}{Merge}
-    \node{return}{Return}
-    \node{cmpnull}{NonNull}
-    \textnode{p}{p}
-	\textnode{const0}{0}
-    \nodebisplit{store1}{FieldStore x}
-    \nodebisplit{store2}{FieldStore y}
-    \nodeframestate{fs1}{FrameState}
-    \nodeframestate{fs2}{FrameState}
-    \datalabel{store1:in1}{p}
-    \datalabel{store2:in1}{p}
-    \datalabel{store1:in2}{const0}
-    \datalabel{store2:in2}{const0}
-    \control{entry}{if}
-    \data{if}{cmpnull}
-    \controllabel{if:succ1}{merge}
-    \controllabel{if:succ2}{store1}
-    \controllabel{store1:succ1}{merge}
-    \controllabel{store1:succ2}{fs1}
-    \control{merge}{store2}
-    \controllabel{store2:succ1}{return}
-    \controllabel{store2:succ2}{fs2}
-    \data{cmpnull}{p}
-\end{digraphenv}
-  \caption{Initial graph with the two field stores.}
-  \label{fig:guard0}
-\end{figure}
-
-Figure~\ref{fig:guard1} shows the example graph at a later compilation phase when the field store instructions are lowered to memory store instructions and explicitely modelled null check guards.
-The guards are attached to anchor instructions that delimit their possible schedule.
-The first guard must not be moved outside the \texttt{if} block; the second guard may be moved before the \texttt{If} instruction, because at this point it is already guaranteed that the second store is executed.
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{guard1}
-	\textnode{entry}{Entry}
-    \node{anchor1}{Anchor}
-    \node{anchor2}{Anchor}
-    \nodesplit{if}{If}
-    \node{merge}{Merge}
-    \node{return}{Return}
-    \node{cmpnull}{NonNull}
-    \textnode{p}{p}
-	\textnode{const0}{0}
-    \nodeguard{guard1}{Guard}
-    \nodeguard{guard2}{Guard}
-    \nodetrisplit{store1}{MemStore 16 (int)}
-    \nodetrisplit{store2}{MemStore 20 (int)}
-    \nodeframestate{fs1}{FrameState}
-    \nodeframestate{fs2}{FrameState}
-    \data{store1:in1}{p}
-    \data{store2:in1}{p}
-    \data{store1:in2}{const0}
-    \data{store2:in2}{const0}
-    \data{store1:in3}{guard1}
-    \data{store2:in3}{guard2}
-    \data{guard1:in1}{anchor2}
-    \data{guard2:in1}{anchor1}
-    \data{guard1:in2}{cmpnull}
-    \data{guard2:in2}{cmpnull}
-    \control{entry}{anchor1}
-    \control{anchor1}{if}
-    \data{if}{cmpnull}
-    \controllabel{if:succ1}{merge}
-    \controllabel{if:succ2}{anchor2}
-    \control{anchor2}{store1}
-    \controllabel{store1:succ1}{merge}
-    \controllabel{store1:succ2}{fs1}
-    \control{merge}{store2}
-    \controllabel{store2:succ1}{return}
-    \controllabel{store2:succ2}{fs2}
-    \data{cmpnull}{p}
-\end{digraphenv}
-  \caption{A load guarded by a null check guard.}
-  \label{fig:guard1}
-\end{figure}
-
-The first guard can be easily removed, because it is guarded by an \texttt{If} instruction that checks the same condition.
-Therefore we can remove the guard and the anchor from the graph and this gives us the graph shown in Figure \ref{fig:guard2}.
-
-There is another optimization for guard instructions: If two guards that are anchored to the true and false branch of the same \texttt{If} instruction have the same condition, they can be merged, so that the resulting guard is anchored at the most distant node of which the \texttt{If} instruction is a postdominator.
-
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{guard2}
-	\textnode{entry}{Entry}
-    \node{anchor1}{Anchor}
-    \nodesplit{if}{If}
-    \node{merge}{Merge}
-    \node{return}{Return}
-    \node{cmpnull}{NonNull}
-    \textnode{p}{p}
-	\textnode{const0}{0}
-    \nodeguard{guard2}{Guard}
-    \nodetrisplit{store1}{MemStore 16 (int)}
-    \nodetrisplit{store2}{MemStore 20 (int)}
-    \nodeframestate{fs1}{FrameState}
-    \nodeframestate{fs2}{FrameState}
-    \data{store1:in1}{p}
-    \data{store2:in1}{p}
-    \data{store1:in2}{const0}
-    \data{store2:in2}{const0}
-    \data{store2:in3}{guard2}
-    \data{guard2:in1}{anchor1}
-    \data{guard2:in2}{cmpnull}
-    \control{entry}{anchor1}
-    \control{anchor1}{if}
-    \data{if}{cmpnull}
-    \controllabel{if:succ1}{merge}
-    \controllabel{if:succ2}{store1}
-    \controllabel{store1:succ1}{merge}
-    \controllabel{store1:succ2}{fs1}
-    \control{merge}{store2}
-    \controllabel{store2:succ1}{return}
-    \controllabel{store2:succ2}{fs2}
-    \data{cmpnull}{p}  
-\end{digraphenv}
-  \caption{After removing redundant guards.}
-  \label{fig:guard2}
-\end{figure}
-
-The remaining guard can now be moved above the \texttt{If} condition and be used to eliminate the need for the \texttt{If} node.
-From this point on, the guard can however no longer be moved below the first memory store.
-We use a control dependency from the guard to the field store to express this condition.
-The link between the second store and the guard and the control flow merge instruction is no longer necessary.
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{guard3}
-	\textnode{entry}{Entry}
-    \node{anchor1}{Anchor}
-    \node{return}{Return}
-    \node{cmpnull}{NonNull}
-    \textnode{p}{p}
-	\textnode{const0}{0}
-    \nodeguard{guard2}{Guard}
-    \nodetrisplit{store1}{MemStore 16 (int)}
-    \nodetrisplit{store2}{MemStore 20 (int)}
-    \nodeframestate{fs1}{FrameState}
-    \nodeframestate{fs2}{FrameState}
-    \data{store1:in1}{p}
-    \data{store2:in1}{p}
-    \data{store1:in2}{const0}
-    \data{store2:in2}{const0}
-    \data{store2:in3}{guard2}
-    \data{guard2:in1}{anchor1}
-    \data{guard2:in2}{cmpnull}
-    \control{guard2}{store1}
-    \control{entry}{anchor1}
-    \control{anchor1}{store1}
-    \controllabel{store1:succ2}{fs1}
-    \control{store1}{store2}
-    \controllabel{store2:succ1}{return}
-    \controllabel{store2:succ2}{fs2}
-    \data{cmpnull}{p}  
-\end{digraphenv}
-  \caption{After eliminating an if with a guard.}
-  \label{fig:guard3}
-\end{figure}
-
-At some point during the compilation, guards need to be fixed, which means that appropriate data and control dependencies will be inserted so that they cannot move outside the scope of the associated frame state.
-This will generate deoptimization-free zones that can be targeted by the most aggressive optimizations.
-A simple algorithm for this removal of frame states would be to move all guards as far upwards as possible and then the guards are fixed using anchor nodes.
-In our example, the guard is already fixed, so there is no deoptimization point that uses any of the memory store frame states.
-Therefore we can delete the frame states from the graph (see Figure \ref{fig:guard4}).
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{guard4}
-	\textnode{entry}{Entry}
-    \node{anchor1}{Anchor}
-    \node{return}{Return}
-    \node{cmpnull}{NonNull}
-    \textnode{p}{p}
-	\textnode{const0}{0}
-    \nodeguard{guard2}{Guard}
-    \nodetrisplit{store1}{MemStore 16 (int)}
-    \nodetrisplit{store2}{MemStore 20 (int)}
-    \data{store1:in1}{p}
-    \data{store2:in1}{p}
-    \data{store1:in2}{const0}
-    \data{store2:in2}{const0}
-    \data{store2:in3}{guard2}
-    \data{guard2:in1}{anchor1}
-    \data{guard2:in2}{cmpnull}
-    \control{guard2}{store1}
-    \control{entry}{anchor1}
-    \control{anchor1}{store1}
-    \control{store1}{store2}
-    \controllabel{store2:succ1}{return}
-    \data{cmpnull}{p}  
-\end{digraphenv}
-  \caption{After removing the frame states.}
-  \label{fig:guard4}
-\end{figure}
-
-Now we can use memory coalescing to combine the two stores without frame state to adjacent locations in the same object.
-This is only possible if the first store does not have a frame state.
-Figure \ref{fig:guard5} shows the resulting graph.
-
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{guard5}
-	\textnode{entry}{Entry}
-    \node{anchor1}{Anchor}
-    \node{return}{Return}
-    \node{cmpnull}{NonNull}
-    \textnode{p}{p}
-	\textnode{const0}{0}
-    \nodeguard{guard2}{Guard}
-    \nodetrisplit{store1}{MemStore 16 (long)}
-    \data{store1:in1}{p}
-    \data{store1:in2}{const0}
-    \data{guard2:in1}{anchor1}
-    \data{guard2:in2}{cmpnull}
-    \control{guard2}{store1}
-    \control{entry}{anchor1}
-    \control{anchor1}{store1}
-    \controllabel{store1:succ1}{return}
-    \data{cmpnull}{p}  
-\end{digraphenv}
-  \caption{After coalescing the two memory stores.}
-  \label{fig:guard5}
-\end{figure}
-
-A memory store that immediately follows a null check guard instruction on the same object, can be combined into a store with an implicit null check (that deoptimizes instead of throwing the exception).
-Therefore, we can remove the guard again and also the anchor is no longer necessary.
-Figure~\ref{fig:guard6} shows now that fully optimized graph that is generated for Listing~\ref{lst:guard1}.
-
-\begin{figure}[h]
-  \centering
-\begin{digraphenv}{scale=0.5}{guard6}
-	\textnode{entry}{Entry}
-    \node{return}{Return}
-    \textnode{p}{p}
-	\textnode{const0}{0}
-    \nodetrisplit{store1}{DeoptimizingMemStore 16 (long)}
-    \data{store1:in1}{p}
-    \data{store1:in2}{const0}
-    \control{entry}{store1}
-    \controllabel{store1:succ1}{return}
-\end{digraphenv}
-  \caption{Fully optimized method.}
-  \label{fig:guard6}
-\end{figure}
-
-
-\section{Conclusions}
-\label{sec:conclusions}
-This document sketched the strategy for the Graph compiler.
-We already reached M1 (as defined in Section~\ref{sec:mile}) and have the following plans for M2 to M4:
-\begin{description}
-\item[M2:] June 30th, 2011
-\item[M3:] August 15th, 2011
-\item[M4:] September 30th, 2011
-\end{description}
-After we reach M4, we want to create a new project road map that further improves the Graal compiler with respect to its two main goals: Modularity and peak performance.
-
-\end{document}
Binary file doc/design/graph_test.pdf has changed
--- a/doc/design/graph_test.tex	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-\documentclass[twocolumn]{svjour3}
-\usepackage[pdftex]{graphicx}
-\usepackage{environ}
-\usepackage{amsmath}
-\usepackage{amsfonts}
-\usepackage[english]{babel}
-\usepackage[utf8]{inputenc} 
-\usepackage{lmodern}
-\usepackage[T1]{fontenc}
-\usepackage{color}
-
-\input{graphdrawing}
-
-\renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bf #1}
-
-\newcommand{\Sa}{{\Large$^*$}}
-\newcommand{\Sb}{{\Large$^\dag$}}
-\newcommand{\Sc}{{\Large$^\S$}}
-
-\smartqed  % flush right qed marks, e.g. at end of proof
-
-\journalname{Test}
-\def\makeheadbox{{%
-\hbox to0pt{\vbox{\baselineskip=10dd\hrule\hbox
-to\hsize{\vrule\kern3pt\vbox{\kern3pt
-\hbox{\bfseries Test}
-\kern3pt}\hfil\kern3pt\vrule}\hrule}%
-\hss}}}
-
-\begin{document}
-
-\author{}
-\institute{}
-
-\date{Created: \today}
-
-\title{Test}
-\subtitle{}
-
-\maketitle
-
-\begin{digraphenv}{scale=0.5}{layout1}
-    \nodestart
-    \nodeend
-    \data{a}{start}
-    \data{b}{start}
-    \node{a}{a}
-    \node{b}{b}
-    \nodesplit{if}{if}
-    \node{nop}{nop}
-    \nodebi{add}{+}
-    \controllabel{if:succ1}{nop}
-    \controllabel{if:succ2}{add}
-    \datalabel{add:in1}{a}
-    \datalabel{add:in2}{b}
-    \control{nop}{end}
-\end{digraphenv}
-
-\begin{digraphenv}{scale=0.5}{layout2}
-    \node{node1}{nop}
-    \nodebi{node2}{+}
-    \nodetri{node3}{phi}
-    \nodesplit{node4}{if}
-\end{digraphenv}
-
-\begin{digraphenv}{scale=0.5}{layout3}
-    \node{a}{a}
-    \node{b}{b}
-    \nodesplit{if}{if}
-    \node{nop}{nop}
-    \nodebi{add}{+}
-    \controllabel{if:succ1}{nop}
-    \controllabel{if:succ2}{add}
-    \datalabel{add:in1}{a}
-    \datalabel{add:in2}{b}
-\end{digraphenv}
-
-\begin{digraphenv}{scale=0.5}{layout4}
-    \node{arr}{arr}
-    \node{i}{i}
-    \node{j}{j}
-    \node{v}{v}
-    \nodetri{astore1}{astore}
-    \datalabel{astore1:in1}{arr}
-    \datalabel{astore1:in2}{i}
-    \datalabel{astore1:in3}{v}
-    \nodebi{add}{+}
-    \datalabel{add:in1}{i}
-    \datalabel{add:in2}{j}
-    \nodetri{astore2}{astore}
-    \datalabel{astore2:in1}{arr}
-    \datalabel{astore2:in2}{add}
-    \datalabel{astore2:in3}{v}
-    \cnode{fs}{framestate}{lightblue}
-    \control{fs}{astore2}
-    \data{fs}{astore1}
-%    \data{fs}{arr}
-%    \data{fs}{i}
-%    \data{fs}{j}
-%    \data{fs}{v}
-    \control{astore1}{astore2}
-\end{digraphenv}
-
-\begin{digraphenv}{scale=0.5}{layout5}
-    \nodestart
-    \nodeend
-    % input projections
-    \node{a}{proj:a}
-    \node{b}{proj:b}
-    \data{a}{start}
-    \data{b}{start}
-    % if
-    \nodebi{cmp1}{&lt;}
-    \datalabel{cmp1:in1}{a}
-    \datalabel{cmp1:in2}{b}
-    \nodesplit{if}{if}
-    \data{if}{cmp1}
-    \control{start}{if}
-    % branches
-    \nodebi{add1}{+}
-    \datalabel{add1:in1}{a}
-    \datalabel{add1:in2}{b}
-    \nodebi{sub1}{-}
-    \datalabel{sub1:in1}{a}
-    \datalabel{sub1:in2}{b}
-    \controllabel{if:succ1}{add1}
-    \controllabel{if:succ2}{sub1}
-    % merge
-    \nodebi{merge}{merge}
-    \control{add1}{merge}
-    \control{sub1}{merge}
-    % phi
-    \nodebi{phi1}{phi}
-    \datalabel{phi1:in1}{add1}
-    \datalabel{phi1:in2}{sub1}
-    % ret
-    \node{ret}{ret}
-    \data{ret}{phi1}
-    \control{merge}{ret}
-    \control{ret}{end}
-\end{digraphenv}
-
-\end{document}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/doc/design/graphdrawing.tex	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-
-% graph drawing
-\newwrite\dotfile 
-\newcommand{\digraph}[3][scale=1]{ 
-  \immediate\openout\dotfile=dot_temp_#2.dot 
-  \immediate\write\dotfile{digraph #2 { margin=0; pad=0; concentrate=false; \string#3}} 
-  \immediate\closeout\dotfile
-  \immediate\write18{bash -c "dot -Tpdf dot_temp_#2.dot > dot_temp_#2.pdf"}  
-  \IfFileExists{dot_temp_#2.pdf}
-  % the pdf exists: include it 
-  { \includegraphics[#1]{dot_temp_#2} } 
-  % the pdf was not created - show a hint
-  { \fbox{ \begin{tabular}{l} 
-        The file \texttt{dot_temp_#2.pdf} hasn't been created from 
-        \texttt{dot_temp_#2.dot} yet. \\
-        We attempted to create it with:\\
-        `\texttt{dot -Tpdf dot_temp_#2.dot > dot_temp_#2.pdf}' \\
-        but that seems not to have worked. You need to execute `\texttt{pdflatex}' with \\
-        the `\texttt{-shell-escape} option.
-      \end{tabular}} 
-  } 
-}
-
-\NewEnviron{digraphenv}[2]{\digraph[#1]{#2}{ nodesep="0.1"; ranksep="0.08 equally"; \BODY }}
-
-\newcommand{\control}[2]{#1:successors:s -> #2:predecessors:n [color=red];}
-\newcommand{\controllabel}[2]{#1:s -> #2:predecessors:n [color=red];}
-\newcommand{\data}[2]{#2:usages:s -> #1:inputs [color=black,dir=back];}
-\newcommand{\datalabel}[2]{#2:usages:s -> #1:n [color=black,dir=back];}
-\newcommand{\datalabeltext}[3]{#2:usages:s -> #1:n [color=black,dir=back,label="#3"];}
-
-\newcommand{\textnode}[2]{#1 [shape=plaintext, label="#2"]}
-\newcommand{\genericnodestart}[1]{#1 [shape=plaintext, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD CELLPADDING="0"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR><TD WIDTH="15" HEIGHT="5" PORT="predecessors" BGCOLOR="rosybrown1"></TD></TR></TABLE></TD><TD COLSPAN="2" CELLPADDING="0" ALIGN="RIGHT"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR>}
-\newcommand{\genericnodeend}[0]{</TR></TABLE></TD><TD CELLPADDING="0"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR><TD WIDTH="15" HEIGHT="5" PORT="usages" BGCOLOR="lightgrey"></TD></TR></TABLE></TD></TR></TABLE>>]}
-\newcommand{\portinput}[1]{<TD WIDTH="15" HEIGHT="5" PORT="#1" BGCOLOR="lightgrey"></TD>}
-\newcommand{\portsuccessor}[1]{<TD WIDTH="15" HEIGHT="5" PORT="#1" BGCOLOR="rosybrown1"></TD>}
-\newcommand{\portempty}[0]{<TD WIDTH="15" HEIGHT="5"></TD>}
-\newcommand{\genericnodelabel}[2]{</TR></TABLE></TD></TR><TR><TD BORDER="1" COLSPAN="3" BGCOLOR="#2"><FONT POINT-SIZE="12">#1</FONT></TD></TR><TR><TD COLSPAN="2" CELLPADDING="0" ALIGN="RIGHT"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR>}
-
-\newcommand{\nodestart}[0]{start [shape=plaintext, rank=source, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD COLSPAN="3"><TABLE BORDER="0"><TR><TD></TD> \genericnodelabel{start}{lightyellow} \portsuccessor{successors} \portempty \genericnodeend }
-
-\newcommand{\nodeend}[0]{\genericnodestart{end} \portempty \portinput{inputs} \genericnodelabel{end}{lightyellow} <TD></TD></TR></TABLE></TD><TD></TD></TR></TABLE>>]}
-
-\newcommand{\nodeconst}[2]{#1 [margin="0.05, 0.05", shape=plaintext, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD BORDER="1" BGCOLOR="white"><FONT POINT-SIZE="12">#2</FONT></TD></TR><TR><TD WIDTH="15" HEIGHT="5" PORT="usages" BGCOLOR="lightgrey"></TD></TR></TABLE>>]}
-\newcommand{\nodeframestate}[2]{#1 [margin="0.05, 0.05", shape=plaintext, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD WIDTH="15" HEIGHT="5" PORT="predecessors" BGCOLOR="rosybrown1"></TD><TD WIDTH="15" HEIGHT="5"></TD><TD HEIGHT="5" PORT="inputs" BGCOLOR="lightgrey"></TD></TR><TR><TD BORDER="1" COLSPAN="3" BGCOLOR="lightblue"><FONT POINT-SIZE="12">#2</FONT></TD></TR></TABLE>>]}
-
-
-\newcommand{\node}[2]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \genericnodeend }
-\newcommand{\nodebi}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \genericnodeend }
-\newcommand{\nodetri}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \portempty \genericnodeend }
-\newcommand{\nodequad}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \portinput{in4} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \portempty \portempty \genericnodeend }
-\newcommand{\nodesplit}[2]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \genericnodeend }
-\newcommand{\nodequadsplit}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \portinput{in4} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portempty \portempty \genericnodeend }
-\newcommand{\nodetrisplit}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portempty \genericnodeend }
-\newcommand{\nodesplittri}[2]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portsuccessor{succ3} \genericnodeend }
-\newcommand{\nodebisplit}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portempty \genericnodeend }
-
-\newcommand{\nodeguard}[2]{\cnodebi{#1}{#2}{rosybrown1}}
-
-\newcommand{\cnode}[3]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{#3} \portsuccessor{successors} \portempty \genericnodeend }
-\newcommand{\cnodebi}[3]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \genericnodelabel{#2}{#3} \portsuccessor{successors} \portempty \genericnodeend }
-\newcommand{\cnodetri}[3]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \genericnodelabel{#2}{#3} \portsuccessor{successors} \portempty \portempty \genericnodeend }
-\newcommand{\cnodesplit}[3]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{#3} \portsuccessor{succ1} \portsuccessor{succ2} \genericnodeend }
-
-% this doesn't work:
-%\newenvironment{graphfigure}[2]{\begin{figure}[h] \label{fig:#1} \centering \begin{digraphenv}{scale=0.5}{#1}}{\end{digraphenv} \caption{#2} \end{figure}}
-
-%%%%%%%%%%%%%% example:
-
-% \begin{digraphenv}{scale=0.5}{MyGraph}
-% \node{start}{start}
-% \node{end}{end}
-% % input projections
-% \node{a}{proj:a}
-% \node{b}{proj:b}
-% \data{a}{start}
-% \data{b}{start}
-% % if
-% \nodebi{cmp1}{&lt;}
-% \datalabel{cmp1:in1}{a}
-% \datalabel{cmp1:in2}{b}
-% \nodesplit{if}{if}
-% \data{if}{cmp1}
-% \control{start}{if}
-% % branches
-% \nodebi{add1}{+}
-% \datalabel{add1:in1}{a}
-% \datalabel{add1:in2}{b}
-% \nodebi{sub1}{-}
-% \datalabel{sub1:in1}{a}
-% \datalabel{sub1:in2}{b}
-% \controllabel{if:succ1}{add1}
-% \controllabel{if:succ2}{sub1}
-% % merge
-% \nodebi{merge}{merge}
-% \control{add1}{merge}
-% \control{sub1}{merge}
-% % phi
-% \nodebi{phi1}{phi}
-% \datalabel{phi1:in1}{add1}
-% \datalabel{phi1:in2}{sub1}
-% % ret
-% \node{ret}{ret}
-% \data{ret}{phi1}
-% \control{merge}{ret}
-% \control{ret}{end}
-% \end{digraphenv}
-
-%%%%%%%%%%%%%%%
--- a/doc/design/svglov3.clo	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-% SVJour3 DOCUMENT CLASS OPTION SVGLOV3 -- for standardised journals
-%
-% This is an enhancement for the LaTeX
-% SVJour3 document class for Springer journals
-%
-%%
-%%
-%% \CharacterTable
-%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%%   Digits        \0\1\2\3\4\5\6\7\8\9
-%%   Exclamation   \!     Double quote  \"     Hash (number) \#
-%%   Dollar        \$     Percent       \%     Ampersand     \&
-%%   Acute accent  \'     Left paren    \(     Right paren   \)
-%%   Asterisk      \*     Plus          \+     Comma         \,
-%%   Minus         \-     Point         \.     Solidus       \/
-%%   Colon         \:     Semicolon     \;     Less than     \<
-%%   Equals        \=     Greater than  \>     Question mark \?
-%%   Commercial at \@     Left bracket  \[     Backslash     \\
-%%   Right bracket \]     Circumflex    \^     Underscore    \_
-%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
-%%   Right brace   \}     Tilde         \~}
-\ProvidesFile{svglov3.clo}
-              [2006/02/03 v3.1
-      style option for standardised journals]
-\typeout{SVJour Class option: svglov3.clo for standardised journals}
-\def\validfor{svjour3}
-\ExecuteOptions{final,10pt,runningheads}
-% No size changing allowed, hence a "copy" of size10.clo is included
-\renewcommand\normalsize{%
-\if@twocolumn
-   \@setfontsize\normalsize\@xpt{12.5pt}%
-\else
-   \if@smallext
-      \@setfontsize\normalsize\@xpt\@xiipt
-   \else
-      \@setfontsize\normalsize{9.5pt}{11.5pt}%
-   \fi
-\fi
-   \abovedisplayskip=3 mm plus6pt minus 4pt
-   \belowdisplayskip=3 mm plus6pt minus 4pt
-   \abovedisplayshortskip=0.0 mm plus6pt
-   \belowdisplayshortskip=2 mm plus4pt minus 4pt
-   \let\@listi\@listI}
-\normalsize
-\newcommand\small{%
-\if@twocolumn
-   \@setfontsize\small{8.5pt}\@xpt
-\else
-   \if@smallext
-      \@setfontsize\small\@viiipt{9.5pt}%
-   \else
-      \@setfontsize\small\@viiipt{9.25pt}%
-   \fi
-\fi
-   \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
-   \abovedisplayshortskip \z@ \@plus2\p@
-   \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
-   \def\@listi{\leftmargin\leftmargini
-               \parsep 0\p@ \@plus1\p@ \@minus\p@
-               \topsep 4\p@ \@plus2\p@ \@minus4\p@
-               \itemsep0\p@}%
-   \belowdisplayskip \abovedisplayskip
-}
-\let\footnotesize\small
-\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
-\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
-\if@twocolumn
-   \newcommand\large{\@setfontsize\large\@xiipt\@xivpt}
-   \newcommand\LARGE{\@setfontsize\LARGE{16pt}{18pt}}
-\else
-   \newcommand\large{\@setfontsize\large\@xipt\@xiipt}
-   \newcommand\LARGE{\@setfontsize\LARGE{13pt}{15pt}}
-\fi
-\newcommand\Large{\@setfontsize\Large\@xivpt{16dd}}
-\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
-\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
-%
-\def\runheadhook{\rlap{\smash{\lower6.5pt\hbox to\textwidth{\hrulefill}}}}
-\if@twocolumn
-\setlength{\textwidth}{17.4cm}
-\setlength{\textheight}{234mm}
-\AtEndOfClass{\setlength\columnsep{6mm}}
-\else
-   \if@smallext
-      \setlength{\textwidth}{11.9cm}
-      \setlength{\textheight}{19.4cm}
-   \else
-      \setlength{\textwidth}{12.2cm}
-      \setlength{\textheight}{19.8cm}
-   \fi
-\fi
-%
-\AtBeginDocument{%
-\@ifundefined{@journalname}
- {\typeout{Unknown journal: specify \string\journalname\string{%
-<name of your journal>\string} in preambel^^J}}{}}
-%
-\endinput
-%%
-%% End of file `svglov3.clo'.
--- a/doc/design/svjour3.cls	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1431 +0,0 @@
-% SVJour3 DOCUMENT CLASS -- version 3.2 for LaTeX2e
-%
-% LaTeX document class for Springer journals
-%
-%%
-%%
-%% \CharacterTable
-%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%%   Digits        \0\1\2\3\4\5\6\7\8\9
-%%   Exclamation   \!     Double quote  \"     Hash (number) \#
-%%   Dollar        \$     Percent       \%     Ampersand     \&
-%%   Acute accent  \'     Left paren    \(     Right paren   \)
-%%   Asterisk      \*     Plus          \+     Comma         \,
-%%   Minus         \-     Point         \.     Solidus       \/
-%%   Colon         \:     Semicolon     \;     Less than     \<
-%%   Equals        \=     Greater than  \>     Question mark \?
-%%   Commercial at \@     Left bracket  \[     Backslash     \\
-%%   Right bracket \]     Circumflex    \^     Underscore    \_
-%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
-%%   Right brace   \}     Tilde         \~}
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesClass{svjour3}[2007/05/08 v3.2
-^^JLaTeX document class for Springer journals]
-\newcommand\@ptsize{}
-\newif\if@restonecol
-\newif\if@titlepage
-\@titlepagefalse
-\DeclareOption{a4paper}
-   {\setlength\paperheight {297mm}%
-    \setlength\paperwidth  {210mm}}
-\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
-\DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
-\DeclareOption{draft}{\setlength\overfullrule{5pt}}
-\DeclareOption{final}{\setlength\overfullrule{0pt}}
-\DeclareOption{fleqn}{\input{fleqn.clo}\AtBeginDocument{\mathindent\z@}%
-\AtBeginDocument{\@ifpackageloaded{amsmath}{\@mathmargin\z@}{}}%
-\PassOptionsToPackage{fleqn}{amsmath}}
-%%%
-\DeclareOption{onecolumn}{}
-\DeclareOption{smallcondensed}{}
-\DeclareOption{twocolumn}{\@twocolumntrue\ExecuteOptions{fleqn}}
-\newif\if@smallext\@smallextfalse
-\DeclareOption{smallextended}{\@smallexttrue}
-\let\if@mathematic\iftrue
-\let\if@numbook\iffalse
-\DeclareOption{numbook}{\let\if@envcntsect\iftrue
-  \AtEndOfPackage{%
-   \renewcommand\thefigure{\thesection.\@arabic\c@figure}%
-   \renewcommand\thetable{\thesection.\@arabic\c@table}%
-   \renewcommand\theequation{\thesection.\@arabic\c@equation}%
-   \@addtoreset{figure}{section}%
-   \@addtoreset{table}{section}%
-   \@addtoreset{equation}{section}%
-  }%
-}
-\DeclareOption{openbib}{%
-  \AtEndOfPackage{%
-   \renewcommand\@openbib@code{%
-      \advance\leftmargin\bibindent
-      \itemindent -\bibindent
-      \listparindent \itemindent
-      \parsep \z@
-      }%
-   \renewcommand\newblock{\par}}%
-}
-\DeclareOption{natbib}{%
-\AtEndOfClass{\RequirePackage{natbib}%
-% Changing some parameters of NATBIB
-\setlength{\bibhang}{\parindent}%
-%\setlength{\bibsep}{0mm}%
-\let\bibfont=\small
-\def\@biblabel#1{#1.}%
-\newcommand{\etal}{et al.}%
-\bibpunct{(}{)}{;}{a}{}{,}}}
-%
-\let\if@runhead\iffalse
-\DeclareOption{runningheads}{\let\if@runhead\iftrue}
-\let\if@smartrunh\iffalse
-\DeclareOption{smartrunhead}{\let\if@smartrunh\iftrue}
-\DeclareOption{nosmartrunhead}{\let\if@smartrunh\iffalse}
-\let\if@envcntreset\iffalse
-\DeclareOption{envcountreset}{\let\if@envcntreset\iftrue}
-\let\if@envcntsame\iffalse
-\DeclareOption{envcountsame}{\let\if@envcntsame\iftrue}
-\let\if@envcntsect\iffalse
-\DeclareOption{envcountsect}{\let\if@envcntsect\iftrue}
-\let\if@referee\iffalse
-\DeclareOption{referee}{\let\if@referee\iftrue}
-\def\makereferee{\def\baselinestretch{2}}
-\let\if@instindent\iffalse
-\DeclareOption{instindent}{\let\if@instindent\iftrue}
-\let\if@smartand\iffalse
-\DeclareOption{smartand}{\let\if@smartand\iftrue}
-\let\if@spthms\iftrue
-\DeclareOption{nospthms}{\let\if@spthms\iffalse}
-%
-% language and babel dependencies
-\DeclareOption{deutsch}{\def\switcht@@therlang{\switcht@deutsch}%
-\gdef\svlanginfo{\typeout{Man spricht deutsch.}\global\let\svlanginfo\relax}}
-\DeclareOption{francais}{\def\switcht@@therlang{\switcht@francais}%
-\gdef\svlanginfo{\typeout{On parle francais.}\global\let\svlanginfo\relax}}
-\let\switcht@@therlang\relax
-\let\svlanginfo\relax
-%
-\AtBeginDocument{\@ifpackageloaded{babel}{%
-\@ifundefined{extrasenglish}{}{\addto\extrasenglish{\switcht@albion}}%
-\@ifundefined{extrasUKenglish}{}{\addto\extrasUKenglish{\switcht@albion}}%
-\@ifundefined{extrasfrenchb}{}{\addto\extrasfrenchb{\switcht@francais}}%
-\@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht@deutsch}}%
-\@ifundefined{extrasngerman}{}{\addto\extrasngerman{\switcht@deutsch}}%
-}{\switcht@@therlang}%
-}
-%
-\def\ClassInfoNoLine#1#2{%
-   \ClassInfo{#1}{#2\@gobble}%
-}
-\let\journalopt\@empty
-\DeclareOption*{%
-\InputIfFileExists{sv\CurrentOption.clo}{%
-\global\let\journalopt\CurrentOption}{%
-\ClassWarning{Springer-SVJour3}{Specified option or subpackage
-"\CurrentOption" not found -}\OptionNotUsed}}
-\ExecuteOptions{a4paper,twoside,10pt,instindent}
-\ProcessOptions
-%
-\ifx\journalopt\@empty\relax
-\ClassInfoNoLine{Springer-SVJour3}{extra/valid Springer sub-package (-> *.clo)
-\MessageBreak not found in option list of \string\documentclass
-\MessageBreak  - autoactivating "global" style}{}
-\input{svglov3.clo}
-\else
-\@ifundefined{validfor}{%
-\ClassError{Springer-SVJour3}{Possible option clash for sub-package
-\MessageBreak "sv\journalopt.clo" - option file not valid
-\MessageBreak for this class}{Perhaps you used an option of the old
-Springer class SVJour!}
-}{}
-\fi
-%
-\if@smartrunh\AtEndDocument{\islastpageeven\getlastpagenumber}\fi
-%
-\newcommand{\twocoltest}[2]{\if@twocolumn\def\@gtempa{#2}\else\def\@gtempa{#1}\fi
-\@gtempa\makeatother}
-\newcommand{\columncase}{\makeatletter\twocoltest}
-%
-\DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{"00}
-\DeclareMathSymbol{\Delta}{\mathalpha}{letters}{"01}
-\DeclareMathSymbol{\Theta}{\mathalpha}{letters}{"02}
-\DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{"03}
-\DeclareMathSymbol{\Xi}{\mathalpha}{letters}{"04}
-\DeclareMathSymbol{\Pi}{\mathalpha}{letters}{"05}
-\DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{"06}
-\DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{"07}
-\DeclareMathSymbol{\Phi}{\mathalpha}{letters}{"08}
-\DeclareMathSymbol{\Psi}{\mathalpha}{letters}{"09}
-\DeclareMathSymbol{\Omega}{\mathalpha}{letters}{"0A}
-%
-\setlength\parindent{15\p@}
-\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@}
-\setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@}
-\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@}
-\setlength\headheight{12\p@}
-\setlength\headsep   {14.50dd}
-\setlength\topskip   {10\p@}
-\setlength\footskip{30\p@}
-\setlength\maxdepth{.5\topskip}
-%
-\@settopoint\textwidth
-\setlength\marginparsep {10\p@}
-\setlength\marginparpush{5\p@}
-\setlength\topmargin{-10pt}
-\if@twocolumn
-   \setlength\oddsidemargin {-30\p@}
-   \setlength\evensidemargin{-30\p@}
-\else
-   \setlength\oddsidemargin {\z@}
-   \setlength\evensidemargin{\z@}
-\fi
-\setlength\marginparwidth  {48\p@}
-\setlength\footnotesep{8\p@}
-\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
-\setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
-\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
-\setlength\intextsep   {20\p@ \@plus 2\p@ \@minus 2\p@}
-\setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
-\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
-\setlength\@fptop{0\p@}
-\setlength\@fpsep{12\p@ \@plus 2\p@ \@minus 2\p@}
-\setlength\@fpbot{0\p@ \@plus 1fil}
-\setlength\@dblfptop{0\p@}
-\setlength\@dblfpsep{12\p@ \@plus 2\p@ \@minus 2\p@}
-\setlength\@dblfpbot{0\p@ \@plus 1fil}
-\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
-\def\@listi{\leftmargin\leftmargini
-            \parsep \z@
-            \topsep 6\p@ \@plus2\p@ \@minus4\p@
-            \itemsep\parsep}
-\let\@listI\@listi
-\@listi
-\def\@listii {\leftmargin\leftmarginii
-              \labelwidth\leftmarginii
-              \advance\labelwidth-\labelsep
-              \topsep    \z@
-              \parsep    \topsep
-              \itemsep   \parsep}
-\def\@listiii{\leftmargin\leftmarginiii
-              \labelwidth\leftmarginiii
-              \advance\labelwidth-\labelsep
-              \topsep    \z@
-              \parsep    \topsep
-              \itemsep   \parsep}
-\def\@listiv {\leftmargin\leftmarginiv
-              \labelwidth\leftmarginiv
-              \advance\labelwidth-\labelsep}
-\def\@listv  {\leftmargin\leftmarginv
-              \labelwidth\leftmarginv
-              \advance\labelwidth-\labelsep}
-\def\@listvi {\leftmargin\leftmarginvi
-              \labelwidth\leftmarginvi
-              \advance\labelwidth-\labelsep}
-%
-\setlength\lineskip{1\p@}
-\setlength\normallineskip{1\p@}
-\renewcommand\baselinestretch{}
-\setlength\parskip{0\p@ \@plus \p@}
-\@lowpenalty   51
-\@medpenalty  151
-\@highpenalty 301
-\setcounter{topnumber}{4}
-\renewcommand\topfraction{.9}
-\setcounter{bottomnumber}{2}
-\renewcommand\bottomfraction{.7}
-\setcounter{totalnumber}{6}
-\renewcommand\textfraction{.1}
-\renewcommand\floatpagefraction{.85}
-\setcounter{dbltopnumber}{3}
-\renewcommand\dbltopfraction{.85}
-\renewcommand\dblfloatpagefraction{.85}
-\def\ps@headings{%
-    \let\@oddfoot\@empty\let\@evenfoot\@empty
-    \def\@evenhead{\small\csname runheadhook\endcsname
-    \rlap{\thepage}\hfil\leftmark\unskip}%
-    \def\@oddhead{\small\csname runheadhook\endcsname
-    \ignorespaces\rightmark\hfil\llap{\thepage}}%
-    \let\@mkboth\@gobbletwo
-    \let\sectionmark\@gobble
-    \let\subsectionmark\@gobble
-    }
-% make indentations changeable
-\def\setitemindent#1{\settowidth{\labelwidth}{#1}%
-        \leftmargini\labelwidth
-        \advance\leftmargini\labelsep
-   \def\@listi{\leftmargin\leftmargini
-        \labelwidth\leftmargini\advance\labelwidth by -\labelsep
-        \parsep=\parskip
-        \topsep=\medskipamount
-        \itemsep=\parskip \advance\itemsep by -\parsep}}
-\def\setitemitemindent#1{\settowidth{\labelwidth}{#1}%
-        \leftmarginii\labelwidth
-        \advance\leftmarginii\labelsep
-\def\@listii{\leftmargin\leftmarginii
-        \labelwidth\leftmarginii\advance\labelwidth by -\labelsep
-        \parsep=\parskip
-        \topsep=\z@
-        \itemsep=\parskip \advance\itemsep by -\parsep}}
-% labels of description
-\def\descriptionlabel#1{\hspace\labelsep #1\hfil}
-% adjusted environment "description"
-% if an optional parameter (at the first two levels of lists)
-% is present, its width is considered to be the widest mark
-% throughout the current list.
-\def\description{\@ifnextchar[{\@describe}{\list{}{\labelwidth\z@
-          \itemindent-\leftmargin \let\makelabel\descriptionlabel}}}
-\let\enddescription\endlist
-%
-\def\describelabel#1{#1\hfil}
-\def\@describe[#1]{\relax\ifnum\@listdepth=0
-\setitemindent{#1}\else\ifnum\@listdepth=1
-\setitemitemindent{#1}\fi\fi
-\list{--}{\let\makelabel\describelabel}}
-%
-\newdimen\logodepth
-\logodepth=1.2cm
-\newdimen\headerboxheight
-\headerboxheight=163pt % 18 10.5dd-lines - 2\baselineskip
-\if@twocolumn\else\advance\headerboxheight by-14.5mm\fi
-\newdimen\betweenumberspace          % dimension for space between
-\betweenumberspace=3.33pt            % number and text of titles.
-\newdimen\aftertext                  % dimension for space after
-\aftertext=5pt                       % text of title.
-\newdimen\headlineindent             % dimension for space between
-\headlineindent=1.166cm              % number and text of headings.
-\if@mathematic
-   \def\runinend{} % \enspace}
-   \def\floatcounterend{\enspace}
-   \def\sectcounterend{}
-\else
-   \def\runinend{.}
-   \def\floatcounterend{.\ }
-   \def\sectcounterend{.}
-\fi
-\def\email#1{\emailname: #1}
-\def\keywords#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
-\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
-}\noindent\keywordname\enspace\ignorespaces#1\par}}
-%
-\def\subclassname{{\bfseries Mathematics Subject Classification
-(2000)}\enspace}
-\def\subclass#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
-\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
-}\noindent\subclassname\ignorespaces#1\par}}
-%
-\def\PACSname{\textbf{PACS}\enspace}
-\def\PACS#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
-\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
-}\noindent\PACSname\ignorespaces#1\par}}
-%
-\def\CRclassname{{\bfseries CR Subject Classification}\enspace}
-\def\CRclass#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
-\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
-}\noindent\CRclassname\ignorespaces#1\par}}
-%
-\def\ESMname{\textbf{Electronic Supplementary Material}\enspace}
-\def\ESM#1{\par\addvspace\medskipamount
-\noindent\ESMname\ignorespaces#1\par}
-%
-\newcounter{inst}
-\newcounter{auth}
-\def\authdepth{2}
-\newdimen\instindent
-\newbox\authrun
-\newtoks\authorrunning
-\newbox\titrun
-\newtoks\titlerunning
-\def\authorfont{\bfseries}
-
-\def\combirunning#1{\gdef\@combi{#1}}
-\def\@combi{}
-\newbox\combirun
-%
-\def\ps@last{\def\@evenhead{\small\rlap{\thepage}\hfil
-\lastevenhead}}
-\newcounter{lastpage}
-\def\islastpageeven{\@ifundefined{lastpagenumber}
-{\setcounter{lastpage}{0}}{\setcounter{lastpage}{\lastpagenumber}}
-\ifnum\value{lastpage}>0
-   \ifodd\value{lastpage}%
-   \else
-      \if@smartrunh
-         \thispagestyle{last}%
-      \fi
-   \fi
-\fi}
-\def\getlastpagenumber{\clearpage
-\addtocounter{page}{-1}%
-   \immediate\write\@auxout{\string\gdef\string\lastpagenumber{\thepage}}%
-   \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}}}%
-   \addtocounter{page}{1}}
-
-\def\journalname#1{\gdef\@journalname{#1}}
-
-\def\dedication#1{\gdef\@dedic{#1}}
-\def\@dedic{}
-
-\let\@date\undefined
-\def\notused{~}
-
-\def\institute#1{\gdef\@institute{#1}}
-
-\def\offprints#1{\begingroup
-\def\protect{\noexpand\protect\noexpand}\xdef\@thanks{\@thanks
-\protect\footnotetext[0]{\unskip\hskip-15pt{\itshape Send offprint requests
-to\/}: \ignorespaces#1}}\endgroup\ignorespaces}
-
-%\def\mail#1{\gdef\@mail{#1}}
-%\def\@mail{}
-
-\def\@thanks{}
-
-\def\@fnsymbol#1{\ifcase#1\or\star\or{\star\star}\or{\star\star\star}%
-   \or \dagger\or \ddagger\or
-   \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger
-   \or \ddagger\ddagger \else\@ctrerr\fi\relax}
-%
-%\def\invthanks#1{\footnotetext[0]{\kern-\bibindent#1}}
-%
-\def\nothanksmarks{\def\thanks##1{\protected@xdef\@thanks{\@thanks
-        \protect\footnotetext[0]{\kern-\bibindent##1}}}}
-%
-\def\subtitle#1{\gdef\@subtitle{#1}}
-\def\@subtitle{}
-
-\def\headnote#1{\gdef\@headnote{#1}}
-\def\@headnote{}
-
-\def\papertype#1{\gdef\paper@type{\MakeUppercase{#1}}}
-\def\paper@type{}
-
-\def\ch@ckobl#1#2{\@ifundefined{@#1}
- {\typeout{SVJour3 warning: Missing
-\expandafter\string\csname#1\endcsname}%
-  \csname #1\endcsname{#2}}
- {}}
-%
-\def\ProcessRunnHead{%
-    \def\\{\unskip\ \ignorespaces}%
-    \def\thanks##1{\unskip{}}%
-    \instindent=\textwidth
-    \advance\instindent by-\headlineindent
-    \if!\the\titlerunning!\else
-      \edef\@title{\the\titlerunning}%
-    \fi
-    \global\setbox\titrun=\hbox{\small\rmfamily\unboldmath\ignorespaces\@title
-                                \unskip}%
-    \ifdim\wd\titrun>\instindent
-       \typeout{^^JSVJour3 Warning: Title too long for running head.}%
-       \typeout{Please supply a shorter form with \string\titlerunning
-                \space prior to \string\maketitle}%
-       \global\setbox\titrun=\hbox{\small\rmfamily
-       Title Suppressed Due to Excessive Length}%
-    \fi
-    \xdef\@title{\copy\titrun}%
-%
-    \if!\the\authorrunning!
-    \else
-      \setcounter{auth}{1}%
-      \edef\@author{\the\authorrunning}%
-    \fi
-    \ifnum\value{inst}>\authdepth
-       \def\stripauthor##1\and##2\endauthor{%
-       \protected@xdef\@author{##1\unskip\unskip\if!##2!\else\ et al.\fi}}%
-       \expandafter\stripauthor\@author\and\endauthor
-    \else
-       \gdef\and{\unskip, \ignorespaces}%
-       {\def\and{\noexpand\protect\noexpand\and}%
-       \protected@xdef\@author{\@author}}
-    \fi
-    \global\setbox\authrun=\hbox{\small\rmfamily\unboldmath\ignorespaces
-                                 \@author\unskip}%
-    \ifdim\wd\authrun>\instindent
-    \typeout{^^JSVJour3 Warning: Author name(s) too long for running head.
-             ^^JPlease supply a shorter form with \string\authorrunning
-             \space prior to \string\maketitle}%
-    \global\setbox\authrun=\hbox{\small\rmfamily Please give a shorter version
-          with: {\tt\string\authorrunning\space and
-             \string\titlerunning\space prior to \string\maketitle}}%
-    \fi
-    \xdef\@author{\copy\authrun}%
-    \markboth{\@author}{\@title}%
-}
-%
-\let\orithanks=\thanks
-\def\thanks#1{\ClassWarning{SVJour3}{\string\thanks\space may only be
-used inside of \string\title, \string\author,\MessageBreak
-and \string\date\space prior to \string\maketitle}}
-%
-\def\maketitle{\par\let\thanks=\orithanks
-\ch@ckobl{journalname}{Noname}
-\ch@ckobl{date}{the date of receipt and acceptance should be inserted
-later}
-\ch@ckobl{title}{A title should be given}
-\ch@ckobl{author}{Name(s) and initial(s) of author(s) should be given}
-\ch@ckobl{institute}{Address(es) of author(s) should be given}
-\begingroup
-%
-    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
-    \def\@makefnmark{$^{\@thefnmark}$}%
-    \renewcommand\@makefntext[1]{%
-    \noindent
-    \hb@xt@\bibindent{\hss\@makefnmark\enspace}##1\vrule height0pt
-    width0pt depth8pt}
-%
- \def\lastand{\ifnum\value{inst}=2\relax
-                 \unskip{} \andname\
-              \else
-                 \unskip, \andname\
-              \fi}%
- \def\and{\stepcounter{auth}\relax
-          \if@smartand
-             \ifnum\value{auth}=\value{inst}%
-                \lastand
-             \else
-                \unskip,
-             \fi
-          \else
-             \unskip,
-          \fi}%
- \thispagestyle{empty}
- \ifnum \col@number=\@ne
-   \@maketitle
- \else
-   \twocolumn[\@maketitle]%
- \fi
-%
- \global\@topnum\z@
- \if!\@thanks!\else
-    \@thanks
-\insert\footins{\vskip-3pt\hrule\@width\if@twocolumn\columnwidth
-\else 38mm\fi\vskip3pt}%
- \fi
- {\def\thanks##1{\unskip{}}%
- \def\iand{\\[5pt]\let\and=\nand}%
- \def\nand{\ifhmode\unskip\nobreak\fi\ $\cdot$ }%
- \let\and=\nand
- \def\at{\\\let\and=\iand}%
- \footnotetext[0]{\kern-\bibindent
- \ignorespaces\@institute}\vspace{5dd}}%
-%\if!\@mail!\else
-%   \footnotetext[0]{\kern-\bibindent\mailname\
-%   \ignorespaces\@mail}%
-%\fi
-%
- \if@runhead
-    \ProcessRunnHead
- \fi
-%
- \endgroup
- \setcounter{footnote}{0}
- \global\let\thanks\relax
- \global\let\maketitle\relax
- \global\let\@maketitle\relax
- \global\let\@thanks\@empty
- \global\let\@author\@empty
- \global\let\@date\@empty
- \global\let\@title\@empty
- \global\let\@subtitle\@empty
- \global\let\title\relax
- \global\let\author\relax
- \global\let\date\relax
- \global\let\and\relax}
-
-\def\makeheadbox{{%
-\hbox to0pt{\vbox{\baselineskip=10dd\hrule\hbox
-to\hsize{\vrule\kern3pt\vbox{\kern3pt
-\hbox{\bfseries\@journalname\ manuscript No.}
-\hbox{(will be inserted by the editor)}
-\kern3pt}\hfil\kern3pt\vrule}\hrule}%
-\hss}}}
-%
-\def\rubric{\setbox0=\hbox{\small\strut}\@tempdima=\ht0\advance
-\@tempdima\dp0\advance\@tempdima2\fboxsep\vrule\@height\@tempdima
-\@width\z@}
-\newdimen\rubricwidth
-%
-\def\@maketitle{\newpage
-\normalfont
-\vbox to0pt{\if@twocolumn\vskip-39pt\else\vskip-49pt\fi
-\nointerlineskip
-\makeheadbox\vss}\nointerlineskip
-\vbox to 0pt{\offinterlineskip\rubricwidth=\columnwidth
-%%%%\vskip-12.5pt          % -12.5pt
-\if@twocolumn\else % one column journal
-   \divide\rubricwidth by144\multiply\rubricwidth by89 % perform golden section
-   \vskip-\topskip
-\fi
-\hrule\@height0.35mm\noindent
-\advance\fboxsep by.25mm
-\global\advance\rubricwidth by0pt
-\rubric
-\vss}\vskip19.5pt    % war 9pt
-%
-\if@twocolumn\else
- \gdef\footnoterule{%
-  \kern-3\p@
-  \hrule\@width38mm     % \columnwidth  \rubricwidth
-  \kern2.6\p@}
-\fi
-%
- \setbox\authrun=\vbox\bgroup
-     \if@twocolumn
-        \hrule\@height10.5mm\@width0\p@
-     \else
-        \hrule\@height 2mm\@width0\p@
-     \fi
-     \pretolerance=10000
-     \rightskip=0pt plus 4cm
-    \nothanksmarks
-%   \if!\@headnote!\else
-%     \noindent
-%     {\LARGE\normalfont\itshape\ignorespaces\@headnote\par}\vskip 3.5mm
-%   \fi
-    {\LARGE\bfseries
-     \noindent\ignorespaces
-     \@title \par}\vskip 17pt\relax
-    \if!\@subtitle!\else
-      {\large\bfseries
-      \pretolerance=10000
-      \rightskip=0pt plus 3cm
-      \vskip-12pt
-%     \noindent\ignorespaces\@subtitle \par}\vskip 11.24pt\relax
-      \noindent\ignorespaces\@subtitle \par}\vskip 17pt\relax
-    \fi
-    {\authorfont
-    \setbox0=\vbox{\setcounter{auth}{1}\def\and{\stepcounter{auth} }%
-                   \hfuzz=2\textwidth\def\thanks##1{}\@author}%
-    \setcounter{footnote}{0}%
-    \global\value{inst}=\value{auth}%
-    \setcounter{auth}{1}%
-    \if@twocolumn
-       \rightskip43mm plus 4cm minus 3mm
-    \else % one column journal
-       \rightskip=\linewidth
-       \advance\rightskip by-\rubricwidth
-       \advance\rightskip by0pt plus 4cm minus 3mm
-    \fi
-%
-\def\and{\unskip\nobreak\enskip{\boldmath$\cdot$}\enskip\ignorespaces}%
-    \noindent\ignorespaces\@author\vskip7.23pt}
-%
-    \small
-    \if!\@dedic!\else
-       \par
-       \normalsize\it
-       \addvspace\baselineskip
-       \noindent\@dedic
-    \fi
- \egroup % end of header box
- \@tempdima=\headerboxheight
- \advance\@tempdima by-\ht\authrun
- \unvbox\authrun
- \ifdim\@tempdima>0pt
-    \vrule width0pt height\@tempdima\par
- \fi
- \noindent{\small\@date\if@twocolumn\vskip 7.2mm\else\vskip 5.2mm\fi}
- \global\@minipagetrue
- \global\everypar{\global\@minipagefalse\global\everypar{}}%
-%\vskip22.47pt
-}
-%
-\if@mathematic
-   \def\vec#1{\ensuremath{\mathchoice
-                     {\mbox{\boldmath$\displaystyle\mathbf{#1}$}}
-                     {\mbox{\boldmath$\textstyle\mathbf{#1}$}}
-                     {\mbox{\boldmath$\scriptstyle\mathbf{#1}$}}
-                     {\mbox{\boldmath$\scriptscriptstyle\mathbf{#1}$}}}}
-\else
-   \def\vec#1{\ensuremath{\mathchoice
-                     {\mbox{\boldmath$\displaystyle#1$}}
-                     {\mbox{\boldmath$\textstyle#1$}}
-                     {\mbox{\boldmath$\scriptstyle#1$}}
-                     {\mbox{\boldmath$\scriptscriptstyle#1$}}}}
-\fi
-%
-\def\tens#1{\ensuremath{\mathsf{#1}}}
-%
-\setcounter{secnumdepth}{3}
-\newcounter {section}
-\newcounter {subsection}[section]
-\newcounter {subsubsection}[subsection]
-\newcounter {paragraph}[subsubsection]
-\newcounter {subparagraph}[paragraph]
-\renewcommand\thesection      {\@arabic\c@section}
-\renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}
-\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
-\renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
-\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
-%
-\def\@hangfrom#1{\setbox\@tempboxa\hbox{#1}%
-      \hangindent \z@\noindent\box\@tempboxa}
-%
-\def\@seccntformat#1{\csname the#1\endcsname\sectcounterend
-\hskip\betweenumberspace}
-%
-% \newif\if@sectrule
-% \if@twocolumn\else\let\@sectruletrue=\relax\fi
-% \if@avier\let\@sectruletrue=\relax\fi
-% \def\makesectrule{\if@sectrule\global\@sectrulefalse\null\vglue-\topskip
-% \hrule\nobreak\parskip=5pt\relax\fi}
-% %
-% \let\makesectruleori=\makesectrule
-% \def\restoresectrule{\global\let\makesectrule=\makesectruleori\global\@sectrulefalse}
-% \def\nosectrule{\let\makesectrule=\restoresectrule}
-%
-\def\@startsection#1#2#3#4#5#6{%
-  \if@noskipsec \leavevmode \fi
-  \par
-  \@tempskipa #4\relax
-  \@afterindenttrue
-  \ifdim \@tempskipa <\z@
-    \@tempskipa -\@tempskipa \@afterindentfalse
-  \fi
-  \if@nobreak
-    \everypar{}%
-  \else
-    \addpenalty\@secpenalty\addvspace\@tempskipa
-  \fi
-% \ifnum#2=1\relax\@sectruletrue\fi
-  \@ifstar
-    {\@ssect{#3}{#4}{#5}{#6}}%
-    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
-%
-\def\@sect#1#2#3#4#5#6[#7]#8{%
-  \ifnum #2>\c@secnumdepth
-    \let\@svsec\@empty
-  \else
-    \refstepcounter{#1}%
-    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
-  \fi
-  \@tempskipa #5\relax
-  \ifdim \@tempskipa>\z@
-    \begingroup
-      #6{% \makesectrule
-        \@hangfrom{\hskip #3\relax\@svsec}%
-          \raggedright
-          \hyphenpenalty \@M%
-          \interlinepenalty \@M #8\@@par}%
-    \endgroup
-    \csname #1mark\endcsname{#7}%
-    \addcontentsline{toc}{#1}{%
-      \ifnum #2>\c@secnumdepth \else
-        \protect\numberline{\csname the#1\endcsname\sectcounterend}%
-      \fi
-      #7}%
-  \else
-    \def\@svsechd{%
-      #6{\hskip #3\relax
-      \@svsec #8\/\hskip\aftertext}%
-      \csname #1mark\endcsname{#7}%
-      \addcontentsline{toc}{#1}{%
-        \ifnum #2>\c@secnumdepth \else
-          \protect\numberline{\csname the#1\endcsname}%
-        \fi
-        #7}}%
-  \fi
-  \@xsect{#5}}
-%
-\def\@ssect#1#2#3#4#5{%
-  \@tempskipa #3\relax
-  \ifdim \@tempskipa>\z@
-    \begingroup
-      #4{% \makesectrule
-        \@hangfrom{\hskip #1}%
-          \interlinepenalty \@M #5\@@par}%
-    \endgroup
-  \else
-    \def\@svsechd{#4{\hskip #1\relax #5}}%
-  \fi
-  \@xsect{#3}}
-
-%
-% measures and setting of sections
-%
-\def\section{\@startsection{section}{1}{\z@}%
-    {-21dd plus-8pt minus-4pt}{10.5dd}
-     {\normalsize\bfseries\boldmath}}
-\def\subsection{\@startsection{subsection}{2}{\z@}%
-    {-21dd plus-8pt minus-4pt}{10.5dd}
-     {\normalsize\upshape}}
-\def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
-    {-13dd plus-8pt minus-4pt}{10.5dd}
-     {\normalsize\itshape}}
-\def\paragraph{\@startsection{paragraph}{4}{\z@}%
-    {-13pt plus-8pt minus-4pt}{\z@}{\normalsize\itshape}}
-
-\setlength\leftmargini  {\parindent}
-\leftmargin  \leftmargini
-\setlength\leftmarginii {\parindent}
-\setlength\leftmarginiii {1.87em}
-\setlength\leftmarginiv  {1.7em}
-\setlength\leftmarginv  {.5em}
-\setlength\leftmarginvi {.5em}
-\setlength  \labelsep  {.5em}
-\setlength  \labelwidth{\leftmargini}
-\addtolength\labelwidth{-\labelsep}
-\@beginparpenalty -\@lowpenalty
-\@endparpenalty   -\@lowpenalty
-\@itempenalty     -\@lowpenalty
-\renewcommand\theenumi{\@arabic\c@enumi}
-\renewcommand\theenumii{\@alph\c@enumii}
-\renewcommand\theenumiii{\@roman\c@enumiii}
-\renewcommand\theenumiv{\@Alph\c@enumiv}
-\newcommand\labelenumi{\theenumi.}
-\newcommand\labelenumii{(\theenumii)}
-\newcommand\labelenumiii{\theenumiii.}
-\newcommand\labelenumiv{\theenumiv.}
-\renewcommand\p@enumii{\theenumi}
-\renewcommand\p@enumiii{\theenumi(\theenumii)}
-\renewcommand\p@enumiv{\p@enumiii\theenumiii}
-\newcommand\labelitemi{\normalfont\bfseries --}
-\newcommand\labelitemii{\normalfont\bfseries --}
-\newcommand\labelitemiii{$\m@th\bullet$}
-\newcommand\labelitemiv{$\m@th\cdot$}
-
-\if@spthms
-% definition of the "\spnewtheorem" command.
-%
-% Usage:
-%
-%     \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font}
-% or  \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font}
-% or  \spnewtheorem*{env_nam}{caption}{cap_font}{body_font}
-%
-% New is "cap_font" and "body_font". It stands for
-% fontdefinition of the caption and the text itself.
-%
-% "\spnewtheorem*" gives a theorem without number.
-%
-% A defined spnewthoerem environment is used as described
-% by Lamport.
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\def\@thmcountersep{}
-\def\@thmcounterend{}
-\newcommand\nocaption{\noexpand\@gobble}
-\newdimen\spthmsep \spthmsep=5pt
-
-\def\spnewtheorem{\@ifstar{\@sthm}{\@Sthm}}
-
-% definition of \spnewtheorem with number
-
-\def\@spnthm#1#2{%
-  \@ifnextchar[{\@spxnthm{#1}{#2}}{\@spynthm{#1}{#2}}}
-\def\@Sthm#1{\@ifnextchar[{\@spothm{#1}}{\@spnthm{#1}}}
-
-\def\@spxnthm#1#2[#3]#4#5{\expandafter\@ifdefinable\csname #1\endcsname
-   {\@definecounter{#1}\@addtoreset{#1}{#3}%
-   \expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand
-     \csname the#3\endcsname \noexpand\@thmcountersep \@thmcounter{#1}}%
-   \expandafter\xdef\csname #1name\endcsname{#2}%
-   \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#4}{#5}}%
-                              \global\@namedef{end#1}{\@endtheorem}}}
-
-\def\@spynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname
-   {\@definecounter{#1}%
-   \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}%
-   \expandafter\xdef\csname #1name\endcsname{#2}%
-   \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#3}{#4}}%
-                               \global\@namedef{end#1}{\@endtheorem}}}
-
-\def\@spothm#1[#2]#3#4#5{%
-  \@ifundefined{c@#2}{\@latexerr{No theorem environment `#2' defined}\@eha}%
-  {\expandafter\@ifdefinable\csname #1\endcsname
-  {\global\@namedef{the#1}{\@nameuse{the#2}}%
-  \expandafter\xdef\csname #1name\endcsname{#3}%
-  \global\@namedef{#1}{\@spthm{#2}{\csname #1name\endcsname}{#4}{#5}}%
-  \global\@namedef{end#1}{\@endtheorem}}}}
-
-\def\@spthm#1#2#3#4{\topsep 7\p@ \@plus2\p@ \@minus4\p@
-\labelsep=\spthmsep\refstepcounter{#1}%
-\@ifnextchar[{\@spythm{#1}{#2}{#3}{#4}}{\@spxthm{#1}{#2}{#3}{#4}}}
-
-\def\@spxthm#1#2#3#4{\@spbegintheorem{#2}{\csname the#1\endcsname}{#3}{#4}%
-                    \ignorespaces}
-
-\def\@spythm#1#2#3#4[#5]{\@spopargbegintheorem{#2}{\csname
-       the#1\endcsname}{#5}{#3}{#4}\ignorespaces}
-
-\def\normalthmheadings{\def\@spbegintheorem##1##2##3##4{\trivlist\normalfont
-                 \item[\hskip\labelsep{##3##1\ ##2\@thmcounterend}]##4}
-\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
-      \item[\hskip\labelsep{##4##1\ ##2}]{##4(##3)\@thmcounterend\ }##5}}
-\normalthmheadings
-
-\def\reversethmheadings{\def\@spbegintheorem##1##2##3##4{\trivlist\normalfont
-                 \item[\hskip\labelsep{##3##2\ ##1\@thmcounterend}]##4}
-\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
-      \item[\hskip\labelsep{##4##2\ ##1}]{##4(##3)\@thmcounterend\ }##5}}
-
-% definition of \spnewtheorem* without number
-
-\def\@sthm#1#2{\@Ynthm{#1}{#2}}
-
-\def\@Ynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname
-   {\global\@namedef{#1}{\@Thm{\csname #1name\endcsname}{#3}{#4}}%
-    \expandafter\xdef\csname #1name\endcsname{#2}%
-    \global\@namedef{end#1}{\@endtheorem}}}
-
-\def\@Thm#1#2#3{\topsep 7\p@ \@plus2\p@ \@minus4\p@
-\@ifnextchar[{\@Ythm{#1}{#2}{#3}}{\@Xthm{#1}{#2}{#3}}}
-
-\def\@Xthm#1#2#3{\@Begintheorem{#1}{#2}{#3}\ignorespaces}
-
-\def\@Ythm#1#2#3[#4]{\@Opargbegintheorem{#1}
-       {#4}{#2}{#3}\ignorespaces}
-
-\def\@Begintheorem#1#2#3{#3\trivlist
-                           \item[\hskip\labelsep{#2#1\@thmcounterend}]}
-
-\def\@Opargbegintheorem#1#2#3#4{#4\trivlist
-      \item[\hskip\labelsep{#3#1}]{#3(#2)\@thmcounterend\ }}
-
-% initialize theorem environment
-
-\if@envcntsect
-   \def\@thmcountersep{.}
-   \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
-\else
-   \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape}
-   \if@envcntreset
-      \@addtoreset{theorem}{section}
-   \else
-      \@addtoreset{theorem}{chapter}
-   \fi
-\fi
-
-%definition of divers theorem environments
-\spnewtheorem*{claim}{Claim}{\itshape}{\rmfamily}
-\spnewtheorem*{proof}{Proof}{\itshape}{\rmfamily}
-\if@envcntsame % all environments like "Theorem" - using its counter
-   \def\spn@wtheorem#1#2#3#4{\@spothm{#1}[theorem]{#2}{#3}{#4}}
-\else % all environments with their own counter
-   \if@envcntsect % show section counter
-      \def\spn@wtheorem#1#2#3#4{\@spxnthm{#1}{#2}[section]{#3}{#4}}
-   \else % not numbered with section
-      \if@envcntreset
-         \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
-                                   \@addtoreset{#1}{section}}
-      \else
-         \let\spn@wtheorem=\@spynthm
-      \fi
-   \fi
-\fi
-%
-\let\spdefaulttheorem=\spn@wtheorem
-%
-\spn@wtheorem{case}{Case}{\itshape}{\rmfamily}
-\spn@wtheorem{conjecture}{Conjecture}{\itshape}{\rmfamily}
-\spn@wtheorem{corollary}{Corollary}{\bfseries}{\itshape}
-\spn@wtheorem{definition}{Definition}{\bfseries}{\rmfamily}
-\spn@wtheorem{example}{Example}{\itshape}{\rmfamily}
-\spn@wtheorem{exercise}{Exercise}{\bfseries}{\rmfamily}
-\spn@wtheorem{lemma}{Lemma}{\bfseries}{\itshape}
-\spn@wtheorem{note}{Note}{\itshape}{\rmfamily}
-\spn@wtheorem{problem}{Problem}{\bfseries}{\rmfamily}
-\spn@wtheorem{property}{Property}{\itshape}{\rmfamily}
-\spn@wtheorem{proposition}{Proposition}{\bfseries}{\itshape}
-\spn@wtheorem{question}{Question}{\itshape}{\rmfamily}
-\spn@wtheorem{solution}{Solution}{\bfseries}{\rmfamily}
-\spn@wtheorem{remark}{Remark}{\itshape}{\rmfamily}
-%
-\newenvironment{theopargself}
-    {\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
-         \item[\hskip\labelsep{##4##1\ ##2}]{##4##3\@thmcounterend\ }##5}
-     \def\@Opargbegintheorem##1##2##3##4{##4\trivlist
-         \item[\hskip\labelsep{##3##1}]{##3##2\@thmcounterend\ }}}{}
-\newenvironment{theopargself*}
-    {\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
-         \item[\hskip\labelsep{##4##1\ ##2}]{\hspace*{-\labelsep}##4##3\@thmcounterend}##5}
-     \def\@Opargbegintheorem##1##2##3##4{##4\trivlist
-         \item[\hskip\labelsep{##3##1}]{\hspace*{-\labelsep}##3##2\@thmcounterend}}}{}
-%
-\fi
-
-\def\@takefromreset#1#2{%
-    \def\@tempa{#1}%
-    \let\@tempd\@elt
-    \def\@elt##1{%
-        \def\@tempb{##1}%
-        \ifx\@tempa\@tempb\else
-            \@addtoreset{##1}{#2}%
-        \fi}%
-    \expandafter\expandafter\let\expandafter\@tempc\csname cl@#2\endcsname
-    \expandafter\def\csname cl@#2\endcsname{}%
-    \@tempc
-    \let\@elt\@tempd}
-
-\def\squareforqed{\hbox{\rlap{$\sqcap$}$\sqcup$}}
-\def\qed{\ifmmode\else\unskip\quad\fi\squareforqed}
-\def\smartqed{\def\qed{\ifmmode\squareforqed\else{\unskip\nobreak\hfil
-\penalty50\hskip1em\null\nobreak\hfil\squareforqed
-\parfillskip=0pt\finalhyphendemerits=0\endgraf}\fi}}
-
-% Define `abstract' environment
-\def\abstract{\topsep=0pt\partopsep=0pt\parsep=0pt\itemsep=0pt\relax
-\trivlist\item[\hskip\labelsep
-{\bfseries\abstractname}]\if!\abstractname!\hskip-\labelsep\fi}
-\if@twocolumn
-% \if@avier
-%   \def\endabstract{\endtrivlist\addvspace{5mm}\strich}
-%   \def\strich{\hrule\vskip1ptplus12pt}
-% \else
-    \def\endabstract{\endtrivlist\addvspace{3mm}}
-% \fi
-\else
-\fi
-%
-\newenvironment{verse}
-               {\let\\\@centercr
-                \list{}{\itemsep      \z@
-                        \itemindent   -1.5em%
-                        \listparindent\itemindent
-                        \rightmargin  \leftmargin
-                        \advance\leftmargin 1.5em}%
-                \item\relax}
-               {\endlist}
-\newenvironment{quotation}
-               {\list{}{\listparindent 1.5em%
-                        \itemindent    \listparindent
-                        \rightmargin   \leftmargin
-                        \parsep        \z@ \@plus\p@}%
-                \item\relax}
-               {\endlist}
-\newenvironment{quote}
-               {\list{}{\rightmargin\leftmargin}%
-                \item\relax}
-               {\endlist}
-\newcommand\appendix{\par\small
-  \setcounter{section}{0}%
-  \setcounter{subsection}{0}%
-  \renewcommand\thesection{\@Alph\c@section}}
-\setlength\arraycolsep{1.5\p@}
-\setlength\tabcolsep{6\p@}
-\setlength\arrayrulewidth{.4\p@}
-\setlength\doublerulesep{2\p@}
-\setlength\tabbingsep{\labelsep}
-\skip\@mpfootins = \skip\footins
-\setlength\fboxsep{3\p@}
-\setlength\fboxrule{.4\p@}
-\renewcommand\theequation{\@arabic\c@equation}
-\newcounter{figure}
-\renewcommand\thefigure{\@arabic\c@figure}
-\def\fps@figure{tbp}
-\def\ftype@figure{1}
-\def\ext@figure{lof}
-\def\fnum@figure{\figurename~\thefigure}
-\newenvironment{figure}
-               {\@float{figure}}
-               {\end@float}
-\newenvironment{figure*}
-               {\@dblfloat{figure}}
-               {\end@dblfloat}
-\newcounter{table}
-\renewcommand\thetable{\@arabic\c@table}
-\def\fps@table{tbp}
-\def\ftype@table{2}
-\def\ext@table{lot}
-\def\fnum@table{\tablename~\thetable}
-\newenvironment{table}
-               {\@float{table}}
-               {\end@float}
-\newenvironment{table*}
-               {\@dblfloat{table}}
-               {\end@dblfloat}
-%
-\def \@floatboxreset {%
-        \reset@font
-        \small
-        \@setnobreak
-        \@setminipage
-}
-%
-\newcommand{\tableheadseprule}{\noalign{\hrule height.375mm}}
-%
-\newlength\abovecaptionskip
-\newlength\belowcaptionskip
-\setlength\abovecaptionskip{10\p@}
-\setlength\belowcaptionskip{0\p@}
-\newcommand\leftlegendglue{}
-
-\def\fig@type{figure}
-
-\newdimen\figcapgap\figcapgap=3pt
-\newdimen\tabcapgap\tabcapgap=5.5pt
-
-\@ifundefined{floatlegendstyle}{\def\floatlegendstyle{\bfseries}}{}
-
-\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname
-  ext@#1\endcsname}{#1}{\protect\numberline{\csname
-  the#1\endcsname}{\ignorespaces #2}}\begingroup
-    \@parboxrestore
-    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
-  \endgroup}
-
-\def\capstrut{\vrule\@width\z@\@height\topskip}
-
-\@ifundefined{captionstyle}{\def\captionstyle{\normalfont\small}}{}
-
-\long\def\@makecaption#1#2{%
- \captionstyle
- \ifx\@captype\fig@type
-   \vskip\figcapgap
- \fi
- \setbox\@tempboxa\hbox{{\floatlegendstyle #1\floatcounterend}%
- \capstrut #2}%
- \ifdim \wd\@tempboxa >\hsize
-   {\floatlegendstyle #1\floatcounterend}\capstrut #2\par
- \else
-   \hbox to\hsize{\leftlegendglue\unhbox\@tempboxa\hfil}%
- \fi
- \ifx\@captype\fig@type\else
-   \vskip\tabcapgap
- \fi}
-
-\newdimen\figgap\figgap=1cc
-\long\def\@makesidecaption#1#2{%
-   \parbox[b]{\@tempdimb}{\captionstyle{\floatlegendstyle
-                                         #1\floatcounterend}#2}}
-\def\sidecaption#1\caption{%
-\setbox\@tempboxa=\hbox{#1\unskip}%
-\if@twocolumn
- \ifdim\hsize<\textwidth\else
-   \ifdim\wd\@tempboxa<\columnwidth
-      \typeout{Double column float fits into single column -
-            ^^Jyou'd better switch the environment. }%
-   \fi
- \fi
-\fi
-\@tempdimb=\hsize
-\advance\@tempdimb by-\figgap
-\advance\@tempdimb by-\wd\@tempboxa
-\ifdim\@tempdimb<3cm
-    \typeout{\string\sidecaption: No sufficient room for the legend;
-             using normal \string\caption. }%
-   \unhbox\@tempboxa
-   \let\@capcommand=\@caption
-\else
-   \let\@capcommand=\@sidecaption
-   \leavevmode
-   \unhbox\@tempboxa
-   \hfill
-\fi
-\refstepcounter\@captype
-\@dblarg{\@capcommand\@captype}}
-
-\long\def\@sidecaption#1[#2]#3{\addcontentsline{\csname
-  ext@#1\endcsname}{#1}{\protect\numberline{\csname
-  the#1\endcsname}{\ignorespaces #2}}\begingroup
-    \@parboxrestore
-    \@makesidecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
-  \endgroup}
-
-% Define `acknowledgement' environment
-\def\acknowledgement{\par\addvspace{17pt}\small\rmfamily
-\trivlist\if!\ackname!\item[]\else
-\item[\hskip\labelsep
-{\bfseries\ackname}]\fi}
-\def\endacknowledgement{\endtrivlist\addvspace{6pt}}
-\newenvironment{acknowledgements}{\begin{acknowledgement}}
-{\end{acknowledgement}}
-% Define `noteadd' environment
-\def\noteadd{\par\addvspace{17pt}\small\rmfamily
-\trivlist\item[\hskip\labelsep
-{\itshape\noteaddname}]}
-\def\endnoteadd{\endtrivlist\addvspace{6pt}}
-
-\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
-\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
-\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
-\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
-\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
-\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
-\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
-\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
-\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
-\newcommand\@pnumwidth{1.55em}
-\newcommand\@tocrmarg{2.55em}
-\newcommand\@dotsep{4.5}
-\setcounter{tocdepth}{1}
-\newcommand\tableofcontents{%
-    \section*{\contentsname}%
-    \@starttoc{toc}%
-    \addtocontents{toc}{\begingroup\protect\small}%
-    \AtEndDocument{\addtocontents{toc}{\endgroup}}%
-    }
-\newcommand*\l@part[2]{%
-  \ifnum \c@tocdepth >-2\relax
-    \addpenalty\@secpenalty
-    \addvspace{2.25em \@plus\p@}%
-    \begingroup
-      \setlength\@tempdima{3em}%
-      \parindent \z@ \rightskip \@pnumwidth
-      \parfillskip -\@pnumwidth
-      {\leavevmode
-       \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
-       \nobreak
-       \if@compatibility
-         \global\@nobreaktrue
-         \everypar{\global\@nobreakfalse\everypar{}}%
-      \fi
-    \endgroup
-  \fi}
-\newcommand*\l@section{\@dottedtocline{1}{0pt}{1.5em}}
-\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
-\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
-\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
-\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
-\newcommand\listoffigures{%
-    \section*{\listfigurename
-      \@mkboth{\listfigurename}%
-              {\listfigurename}}%
-    \@starttoc{lof}%
-    }
-\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
-\newcommand\listoftables{%
-    \section*{\listtablename
-      \@mkboth{\listtablename}{\listtablename}}%
-    \@starttoc{lot}%
-    }
-\let\l@table\l@figure
-\newdimen\bibindent
-\setlength\bibindent{\parindent}
-\def\@biblabel#1{#1.}
-\def\@lbibitem[#1]#2{\item[{[#1]}\hfill]\if@filesw
-      {\let\protect\noexpand
-       \immediate
-       \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
-\newenvironment{thebibliography}[1]
-     {\section*{\refname
-        \@mkboth{\refname}{\refname}}\small
-      \list{\@biblabel{\@arabic\c@enumiv}}%
-           {\settowidth\labelwidth{\@biblabel{#1}}%
-            \leftmargin\labelwidth
-            \advance\leftmargin\labelsep
-            \@openbib@code
-            \usecounter{enumiv}%
-            \let\p@enumiv\@empty
-            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
-      \sloppy\clubpenalty4000\widowpenalty4000%
-      \sfcode`\.\@m}
-     {\def\@noitemerr
-       {\@latex@warning{Empty `thebibliography' environment}}%
-      \endlist}
-%
-\newcount\@tempcntc
-\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
-  \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do
-    {\@ifundefined
-       {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bfseries
-        ?}\@warning
-       {Citation `\@citeb' on page \thepage \space undefined}}%
-    {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}%
-     \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne
-       \@citea\def\@citea{,\hskip0.1em\ignorespaces}\hbox{\csname b@\@citeb\endcsname}%
-     \else
-      \advance\@tempcntb\@ne
-      \ifnum\@tempcntb=\@tempcntc
-      \else\advance\@tempcntb\m@ne\@citeo
-      \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}}
-\def\@citeo{\ifnum\@tempcnta>\@tempcntb\else
-            \@citea\def\@citea{,\hskip0.1em\ignorespaces}%
-  \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else
-   {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else \def\@citea{--}\fi
-    \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi}
-%
-\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
-\let\@openbib@code\@empty
-\newenvironment{theindex}
-               {\if@twocolumn
-                  \@restonecolfalse
-                \else
-                  \@restonecoltrue
-                \fi
-                \columnseprule \z@
-                \columnsep 35\p@
-                \twocolumn[\section*{\indexname}]%
-                \@mkboth{\indexname}{\indexname}%
-                \thispagestyle{plain}\parindent\z@
-                \parskip\z@ \@plus .3\p@\relax
-                \let\item\@idxitem}
-               {\if@restonecol\onecolumn\else\clearpage\fi}
-\newcommand\@idxitem{\par\hangindent 40\p@}
-\newcommand\subitem{\@idxitem \hspace*{20\p@}}
-\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
-\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
-
-\if@twocolumn
- \renewcommand\footnoterule{%
-  \kern-3\p@
-  \hrule\@width\columnwidth
-  \kern2.6\p@}
-\else
- \renewcommand\footnoterule{%
-  \kern-3\p@
-  \hrule\@width.382\columnwidth
-  \kern2.6\p@}
-\fi
-\newcommand\@makefntext[1]{%
-    \noindent
-    \hb@xt@\bibindent{\hss\@makefnmark\enspace}#1}
-%
-\def\trans@english{\switcht@albion}
-\def\trans@french{\switcht@francais}
-\def\trans@german{\switcht@deutsch}
-\newenvironment{translation}[1]{\if!#1!\else
-\@ifundefined{selectlanguage}{\csname trans@#1\endcsname}{\selectlanguage{#1}}%
-\fi}{}
-% languages
-% English section
-\def\switcht@albion{%\typeout{English spoken.}%
- \def\abstractname{Abstract}%
- \def\ackname{Acknowledgements}%
- \def\andname{and}%
- \def\lastandname{, and}%
- \def\appendixname{Appendix}%
- \def\chaptername{Chapter}%
- \def\claimname{Claim}%
- \def\conjecturename{Conjecture}%
- \def\contentsname{Contents}%
- \def\corollaryname{Corollary}%
- \def\definitionname{Definition}%
- \def\emailname{E-mail}%
- \def\examplename{Example}%
- \def\exercisename{Exercise}%
- \def\figurename{Fig.}%
- \def\keywordname{{\bfseries Keywords}}%
- \def\indexname{Index}%
- \def\lemmaname{Lemma}%
- \def\contriblistname{List of Contributors}%
- \def\listfigurename{List of Figures}%
- \def\listtablename{List of Tables}%
- \def\mailname{{\itshape Correspondence to\/}:}%
- \def\noteaddname{Note added in proof}%
- \def\notename{Note}%
- \def\partname{Part}%
- \def\problemname{Problem}%
- \def\proofname{Proof}%
- \def\propertyname{Property}%
- \def\questionname{Question}%
- \def\refname{References}%
- \def\remarkname{Remark}%
- \def\seename{see}%
- \def\solutionname{Solution}%
- \def\tablename{Table}%
- \def\theoremname{Theorem}%
-}\switcht@albion % make English default
-%
-% French section
-\def\switcht@francais{\svlanginfo
-%\typeout{On parle francais.}%
- \def\abstractname{R\'esum\'e\runinend}%
- \def\ackname{Remerciements\runinend}%
- \def\andname{et}%
- \def\lastandname{ et}%
- \def\appendixname{Appendice}%
- \def\chaptername{Chapitre}%
- \def\claimname{Pr\'etention}%
- \def\conjecturename{Hypoth\`ese}%
- \def\contentsname{Table des mati\`eres}%
- \def\corollaryname{Corollaire}%
- \def\definitionname{D\'efinition}%
- \def\emailname{E-mail}%
- \def\examplename{Exemple}%
- \def\exercisename{Exercice}%
- \def\figurename{Fig.}%
- \def\keywordname{{\bfseries Mots-cl\'e\runinend}}%
- \def\indexname{Index}%
- \def\lemmaname{Lemme}%
- \def\contriblistname{Liste des contributeurs}%
- \def\listfigurename{Liste des figures}%
- \def\listtablename{Liste des tables}%
- \def\mailname{{\itshape Correspondence to\/}:}%
- \def\noteaddname{Note ajout\'ee \`a l'\'epreuve}%
- \def\notename{Remarque}%
- \def\partname{Partie}%
- \def\problemname{Probl\`eme}%
- \def\proofname{Preuve}%
- \def\propertyname{Caract\'eristique}%
-%\def\propositionname{Proposition}%
- \def\questionname{Question}%
- \def\refname{Bibliographie}%
- \def\remarkname{Remarque}%
- \def\seename{voyez}%
- \def\solutionname{Solution}%
-%\def\subclassname{{\it Subject Classifications\/}:}%
- \def\tablename{Tableau}%
- \def\theoremname{Th\'eor\`eme}%
-}
-%
-% German section
-\def\switcht@deutsch{\svlanginfo
-%\typeout{Man spricht deutsch.}%
- \def\abstractname{Zusammenfassung\runinend}%
- \def\ackname{Danksagung\runinend}%
- \def\andname{und}%
- \def\lastandname{ und}%
- \def\appendixname{Anhang}%
- \def\chaptername{Kapitel}%
- \def\claimname{Behauptung}%
- \def\conjecturename{Hypothese}%
- \def\contentsname{Inhaltsverzeichnis}%
- \def\corollaryname{Korollar}%
-%\def\definitionname{Definition}%
- \def\emailname{E-Mail}%
- \def\examplename{Beispiel}%
- \def\exercisename{\"Ubung}%
- \def\figurename{Abb.}%
- \def\keywordname{{\bfseries Schl\"usselw\"orter\runinend}}%
- \def\indexname{Index}%
-%\def\lemmaname{Lemma}%
- \def\contriblistname{Mitarbeiter}%
- \def\listfigurename{Abbildungsverzeichnis}%
- \def\listtablename{Tabellenverzeichnis}%
- \def\mailname{{\itshape Correspondence to\/}:}%
- \def\noteaddname{Nachtrag}%
- \def\notename{Anmerkung}%
- \def\partname{Teil}%
-%\def\problemname{Problem}%
- \def\proofname{Beweis}%
- \def\propertyname{Eigenschaft}%
-%\def\propositionname{Proposition}%
- \def\questionname{Frage}%
- \def\refname{Literatur}%
- \def\remarkname{Anmerkung}%
- \def\seename{siehe}%
- \def\solutionname{L\"osung}%
-%\def\subclassname{{\it Subject Classifications\/}:}%
- \def\tablename{Tabelle}%
-%\def\theoremname{Theorem}%
-}
-\newcommand\today{}
-\edef\today{\ifcase\month\or
-  January\or February\or March\or April\or May\or June\or
-  July\or August\or September\or October\or November\or December\fi
-  \space\number\day, \number\year}
-\setlength\columnsep{1.5cc}
-\setlength\columnseprule{0\p@}
-%
-\frenchspacing
-\clubpenalty=10000
-\widowpenalty=10000
-\def\thisbottomragged{\def\@textbottom{\vskip\z@ plus.0001fil
-\global\let\@textbottom\relax}}
-\pagestyle{headings}
-\pagenumbering{arabic}
-\if@twocolumn
-   \twocolumn
-\fi
-%\if@avier
-%   \onecolumn
-%   \setlength{\textwidth}{156mm}
-%   \setlength{\textheight}{226mm}
-%\fi
-\if@referee
-   \makereferee
-\fi
-\flushbottom
-\endinput
-%%
-%% End of file `svjour3.cls'.
--- a/doc/graal.doxy	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1661 +0,0 @@
-# Doxyfile 1.7.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file 
-# that follow. The default is UTF-8 which is also the encoding used for all 
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
-# iconv built into libc) for the transcoding. See 
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = GRAAL
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
-# if some version control system is used.
-
-PROJECT_NUMBER         = 
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = .
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
-# 4096 sub-directories (in 2 levels) under the output directory of each output 
-# format and will distribute the generated files over these directories. 
-# Enabling this option can be useful when feeding doxygen a huge amount of 
-# source files, where putting all generated files in the same directory would 
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
-# documentation generated by doxygen is written. Doxygen will use this 
-# information to generate all constant output in the proper language. 
-# The default language is English, other supported languages are: 
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
-# include brief member descriptions after the members that are listed in 
-# the file and class documentation (similar to JavaDoc). 
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
-# the brief description of a member or function before the detailed description. 
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator 
-# that is used to form the text in various listings. Each string 
-# in this list, if found as the leading text of the brief description, will be 
-# stripped from the text and the result after processing the whole list, is 
-# used as the annotated text. Otherwise, the brief description is used as-is. 
-# If left blank, the following values are used ("$name" is automatically 
-# replaced with the name of the entity): "The $name class" "The $name widget" 
-# "The $name file" "is" "provides" "specifies" "contains" 
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       = "The $name class" \
-                         "The $name widget" \
-                         "The $name file" \
-                         is \
-                         provides \
-                         specifies \
-                         contains \
-                         represents \
-                         a \
-                         an \
-                         the
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
-# Doxygen will generate a detailed section even if there is only a brief 
-# description.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
-# inherited members of a class in the documentation of that class as if those 
-# members were ordinary class members. Constructors, destructors and assignment 
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
-# path before files name in the file list and in the header files. If set 
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES        = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
-# can be used to strip a user-defined part of the path. Stripping is 
-# only done if one of the specified strings matches the left-hand part of 
-# the path. The tag can be used to show relative paths in the file list. 
-# If left blank the directory from which doxygen is run is used as the 
-# path to strip.
-
-STRIP_FROM_PATH        = 
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
-# the path mentioned in the documentation of a class, which tells 
-# the reader which header file to include in order to use a class. 
-# If left blank only the name of the header file containing the class 
-# definition is used. Otherwise one should specify the include paths that 
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    = 
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
-# (but less readable) file names. This can be useful is your file systems 
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
-# will interpret the first line (until the first dot) of a JavaDoc-style 
-# comment as the brief description. If set to NO, the JavaDoc 
-# comments will behave just like regular Qt-style comments 
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
-# interpret the first line (until the first dot) of a Qt-style 
-# comment as the brief description. If set to NO, the comments 
-# will behave just like regular Qt-style comments (thus requiring 
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
-# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
-# comments) as a brief description. This used to be the default behaviour. 
-# The new default is to treat a multi-line C++ comment block as a detailed 
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
-# a new page for each member. If set to NO, the documentation of a member will 
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE               = 8
-
-# This tag can be used to specify a number of aliases that acts 
-# as commands in the documentation. An alias has the form "name=value". 
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
-# put the command \sideeffect (or @sideeffect) in the documentation, which 
-# will result in a user-defined paragraph with heading "Side Effects:". 
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES                = 
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
-# sources only. Doxygen will then generate output that is more tailored for C. 
-# For instance, some of the names that are used will be different. The list 
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C  = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
-# sources only. Doxygen will then generate output that is more tailored for 
-# Java. For instance, namespaces will be presented as packages, qualified 
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA   = YES
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
-# sources only. Doxygen will then generate output that is more tailored for 
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
-# sources. Doxygen will then generate output that is tailored for 
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it 
-# parses. With this tag you can assign which parser to use for a given extension. 
-# Doxygen has a built-in mapping, but you can override or extend it using this 
-# tag. The format is ext=language, where ext is a file extension, and language 
-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, 
-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make 
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C 
-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions 
-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING      = 
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
-# to include (a tag file for) the STL sources as input, then you should 
-# set this tag to YES in order to let doxygen match functions declarations and 
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to 
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
-# Doxygen will parse them like normal C++ but will assume all classes use public 
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter 
-# and setter methods for a property. Setting this option to YES (the default) 
-# will make doxygen to replace the get and set methods by a property in the 
-# documentation. This will only work if the methods are indeed getting or 
-# setting a simple type. If this is not the case, or you want to show the 
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT   = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
-# tag is set to YES, then doxygen will reuse the documentation of the first 
-# member in the group (if any) for the other members of the group. By default 
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
-# the same type (for instance a group of public functions) to be put as a 
-# subgroup of that type (e.g. under the Public Functions section). Set it to 
-# NO to prevent subgrouping. Alternatively, this can be done per class using 
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
-# is documented as struct, union, or enum with the name of the typedef. So 
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
-# with name TypeT. When disabled the typedef will appear as a member of a file, 
-# namespace, or class. And the struct will be named TypeS. This can typically 
-# be useful for C code in case the coding convention dictates that all compound 
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
-# determine which symbols to keep in memory and which to flush to disk. 
-# When the cache is full, less often used symbols will be written to disk. 
-# For small to medium size projects (<1000 input files) the default value is 
-# probably good enough. For larger projects a too small cache size can cause 
-# doxygen to be busy swapping symbols to and from disk most of the time 
-# causing a significant performance penality. 
-# If the system has enough physical memory increasing the cache will improve the 
-# performance by keeping more symbols in memory. Note that the value works on 
-# a logarithmic scale so increasing the size by one will rougly double the 
-# memory usage. The cache size is given by this formula: 
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
-# documentation are documented, even if no documentation was available. 
-# Private class members and static file members will be hidden unless 
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
-# will be included in the documentation.
-
-EXTRACT_PRIVATE        = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
-# will be included in the documentation.
-
-EXTRACT_STATIC         = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
-# defined locally in source files will be included in the documentation. 
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. When set to YES local 
-# methods, which are defined in the implementation section but not in 
-# the interface are included in the documentation. 
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be 
-# extracted and appear in the documentation as a namespace called 
-# 'anonymous_namespace{file}', where file will be replaced with the base 
-# name of the file that contains the anonymous namespace. By default 
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
-# undocumented members of documented classes, files or namespaces. 
-# If set to NO (the default) these members will be included in the 
-# various overviews, but no documentation section is generated. 
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
-# undocumented classes that are normally visible in the class hierarchy. 
-# If set to NO (the default) these classes will be included in the various 
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
-# friend (class|struct|union) declarations. 
-# If set to NO (the default) these declarations will be included in the 
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
-# documentation blocks found inside the body of a function. 
-# If set to NO (the default) these blocks will be appended to the 
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation 
-# that is typed after a \internal command is included. If the tag is set 
-# to NO (the default) then the documentation will be excluded. 
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
-# file names in lower-case letters. If set to YES upper-case letters are also 
-# allowed. This is useful if you have classes or files whose names only differ 
-# in case and if your file system supports case sensitive file names. Windows 
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES       = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
-# will show members with their full class and namespace scopes in the 
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put a list of the files that are included by a file in the documentation 
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 
-# will list include files with double quotes in the documentation 
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES   = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
-# is inserted in the documentation for inline members.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
-# will sort the (detailed) documentation of file and class members 
-# alphabetically by member name. If set to NO the members will appear in 
-# declaration order.
-
-SORT_MEMBER_DOCS       = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
-# brief documentation of file, namespace and class members alphabetically 
-# by member name. If set to NO (the default) the members will appear in 
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen 
-# will sort the (brief and detailed) documentation of class members so that 
-# constructors and destructors are listed first. If set to NO (the default) 
-# the constructors will appear in the respective orders defined by 
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. 
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO 
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
-# hierarchy of group names into alphabetical order. If set to NO (the default) 
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
-# sorted by fully-qualified names, including namespaces. If set to 
-# NO (the default), the class list will be sorted only by class name, 
-# not including the namespace part. 
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
-# Note: This option applies only to the class list, not to the 
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or 
-# disable (NO) the todo list. This list is created by putting \todo 
-# commands in the documentation.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or 
-# disable (NO) the test list. This list is created by putting \test 
-# commands in the documentation.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or 
-# disable (NO) the bug list. This list is created by putting \bug 
-# commands in the documentation.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
-# disable (NO) the deprecated list. This list is created by putting 
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional 
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS       = 
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
-# the initial value of a variable or define consists of for it to appear in 
-# the documentation. If the initializer consists of more lines than specified 
-# here it will be hidden. Use a value of 0 to hide initializers completely. 
-# The appearance of the initializer of individual variables and defines in the 
-# documentation can be controlled using \showinitializer or \hideinitializer 
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
-# at the bottom of the documentation of classes and structs. If set to YES the 
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES        = YES
-
-# If the sources in your project are distributed over multiple directories 
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES       = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
-# This will remove the Files entry from the Quick Index and from the 
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
-# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
-# doxygen should invoke to get the current version for each file (typically from 
-# the version control system). Doxygen will invoke the program by executing (via 
-# popen()) the command <command> <input-file>, where <command> is the value of 
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
-# provided by doxygen. Whatever the program writes to standard output 
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    = 
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 
-# by doxygen. The layout file controls the global structure of the generated 
-# output files in an output format independent way. The create the layout file 
-# that represents doxygen's defaults, run doxygen with the -l option. 
-# You can optionally specify a file name after the option, if omitted 
-# DoxygenLayout.xml will be used as the name of the layout file.
-
-LAYOUT_FILE            = 
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated 
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are 
-# generated by doxygen. Possible values are YES and NO. If left blank 
-# NO is used.
-
-WARNINGS               = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
-# potential errors in the documentation, such as not documenting some 
-# parameters in a documented function, or documenting parameters that 
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
-# functions that are documented, but have no documentation for their parameters 
-# or return value. If set to NO (the default) doxygen will only warn about 
-# wrong or incomplete parameter documentation, but not about the absence of 
-# documentation.
-
-WARN_NO_PARAMDOC       = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that 
-# doxygen can produce. The string should contain the $file, $line, and $text 
-# tags, which will be replaced by the file and line number from which the 
-# warning originated and the warning text. Optionally the format may contain 
-# $version, which will be replaced by the version of the file (if it could 
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning 
-# and error messages should be written. If left blank the output is written 
-# to stderr.
-
-WARN_LOGFILE           = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain 
-# documented source files. You may enter file names like "myfile.cpp" or 
-# directories like "/usr/src/myproject". Separate the files or directories 
-# with spaces.
-
-INPUT                  = src
-
-# This tag can be used to specify the character encoding of the source files 
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
-# also the default input encoding. Doxygen uses libiconv (or the iconv built 
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
-# the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the 
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank the following patterns are tested: 
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS          = *.c \
-                         *.cc \
-                         *.cxx \
-                         *.cpp \
-                         *.c++ \
-                         *.d \
-                         *.java \
-                         *.ii \
-                         *.ixx \
-                         *.ipp \
-                         *.i++ \
-                         *.inl \
-                         *.h \
-                         *.hh \
-                         *.hxx \
-                         *.hpp \
-                         *.h++ \
-                         *.idl \
-                         *.odl \
-                         *.cs \
-                         *.php \
-                         *.php3 \
-                         *.inc \
-                         *.m \
-                         *.mm \
-                         *.dox \
-                         *.py \
-                         *.f90 \
-                         *.f \
-                         *.vhd \
-                         *.vhdl
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
-# should be searched for input files as well. Possible values are YES and NO. 
-# If left blank NO is used.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should 
-# excluded from the INPUT source files. This way you can easily exclude a 
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                = 
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
-# directories that are symbolic links (a Unix filesystem feature) are excluded 
-# from the input.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the 
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
-# certain files from those directories. Note that the wildcards are matched 
-# against the file with absolute path, so to exclude all test directories 
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       = 
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
-# (namespaces, classes, functions, etc.) that should be excluded from the 
-# output. The symbol name can be a fully qualified name, a word, or if the 
-# wildcard * is used, a substring. Examples: ANamespace, AClass, 
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        = 
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or 
-# directories that contain example code fragments that are included (see 
-# the \include command).
-
-EXAMPLE_PATH           = 
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank all files are included.
-
-EXAMPLE_PATTERNS       = *
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
-# searched for input files to be used with the \include or \dontinclude 
-# commands irrespective of the value of the RECURSIVE tag. 
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or 
-# directories that contain image that are included in the documentation (see 
-# the \image command).
-
-IMAGE_PATH             = 
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should 
-# invoke to filter for each input file. Doxygen will invoke the filter program 
-# by executing (via popen()) the command <filter> <input-file>, where <filter> 
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
-# input file. Doxygen will then use the output that the filter program writes 
-# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
-# ignored.
-
-INPUT_FILTER           = 
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
-# basis.  Doxygen will compare the file name with each pattern and apply the 
-# filter if there is a match.  The filters are a list of the form: 
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
-# is applied to all files.
-
-FILTER_PATTERNS        = 
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
-# INPUT_FILTER) will be used to filter the input files when producing source 
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
-# be generated. Documented entities will be cross-referenced with these sources. 
-# Note: To get rid of all source code in the generated output, make sure also 
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body 
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
-# doxygen to hide any special comment blocks from generated source code 
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES 
-# then for each documented function all documented 
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES 
-# then for each documented function all documented entities 
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
-# link to the source code.  Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code 
-# will point to the HTML generated by the htags(1) tool instead of doxygen 
-# built-in source browser. The htags tool is part of GNU's global source 
-# tagging system (see http://www.gnu.org/software/global/global.html). You 
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
-# will generate a verbatim copy of the header file for each class for 
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
-# of all compounds will be generated. Enable this if the project 
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX     = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all 
-# classes will be put under the same header in the alphabetical index. 
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX          = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
-# generate HTML output.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard header.
-
-HTML_HEADER            = 
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard footer.
-
-HTML_FOOTER            = 
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
-# style sheet that is used by each HTML page. It can be used to 
-# fine-tune the look of the HTML output. If the tag is left blank doxygen 
-# will generate a default style sheet. Note that doxygen will try to copy 
-# the style sheet file to the HTML output directory, so don't put your own 
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET        = 
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. 
-# Doxygen will adjust the colors in the stylesheet and background images 
-# according to this color. Hue is specified as an angle on a colorwheel, 
-# see http://en.wikipedia.org/wiki/Hue for more information. 
-# For instance the value 0 represents red, 60 is yellow, 120 is green, 
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. 
-# The allowed range is 0 to 359.
-
-HTML_COLORSTYLE_HUE    = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of 
-# the colors in the HTML output. For a value of 0 the output will use 
-# grayscales only. A value of 255 will produce the most vivid colors.
-
-HTML_COLORSTYLE_SAT    = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to 
-# the luminance component of the colors in the HTML output. Values below 
-# 100 gradually make the output lighter, whereas values above 100 make 
-# the output darker. The value divided by 100 is the actual gamma applied, 
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, 
-# and 100 does not change the gamma.
-
-HTML_COLORSTYLE_GAMMA  = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 
-# page will contain the date and time when the page was generated. Setting 
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP         = YES
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
-# files or namespaces will be aligned in HTML using tables. If set to 
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS     = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
-# documentation will contain sections that can be hidden and shown after the 
-# page has loaded. For this to work a browser that supports 
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files 
-# will be generated that can be used as input for Apple's Xcode 3 
-# integrated development environment, introduced with OSX 10.5 (Leopard). 
-# To create a documentation set, doxygen will generate a Makefile in the 
-# HTML output directory. Running make will produce the docset in that 
-# directory and running "make install" will install the docset in 
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
-# it at startup. 
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 
-# for more information.
-
-GENERATE_DOCSET        = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
-# feed. A documentation feed provides an umbrella under which multiple 
-# documentation sets from a single provider (such as a company or product suite) 
-# can be grouped.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
-# should uniquely identify the documentation set bundle. This should be a 
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify 
-# the documentation publisher. This should be a reverse domain-name style 
-# string, e.g. com.mycompany.MyDocSet.documentation.
-
-DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
-
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-
-DOCSET_PUBLISHER_NAME  = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
-# will be generated that can be used as input for tools like the 
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP      = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
-# be used to specify the file name of the resulting .chm file. You 
-# can add a path in front of the file if the result should not be 
-# written to the html output directory.
-
-CHM_FILE               = 
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
-# be used to specify the location (absolute path including file name) of 
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION           = 
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
-# controls if a separate .chi index file is generated (YES) or that 
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI           = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
-# content.
-
-CHM_INDEX_ENCODING     = 
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
-# controls whether a binary table of contents is generated (YES) or a 
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members 
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND             = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated 
-# that can be used as input for Qt's qhelpgenerator to generate a 
-# Qt Compressed Help (.qch) of the generated HTML documentation.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
-# be used to specify the file name of the resulting .qch file. 
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE               = 
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE          = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
-# Qt Help Project output. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to 
-# add. For more information please see 
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME   = 
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the 
-# custom filter to add. For more information please see 
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> 
-# Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS  = 
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 
-# project's 
-# filter section matches. 
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> 
-# Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS  = 
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
-# be used to specify the location of Qt's qhelpgenerator. 
-# If non-empty doxygen will try to run qhelpgenerator on the generated 
-# .qhp file.
-
-QHG_LOCATION           = 
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  
-# will be generated, which together with the HTML files, form an Eclipse help 
-# plugin. To install this plugin and make it available under the help contents 
-# menu in Eclipse, the contents of the directory containing the HTML and XML 
-# files needs to be copied into the plugins directory of eclipse. The name of 
-# the directory within the plugins directory should be the same as 
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before 
-# the help appears.
-
-GENERATE_ECLIPSEHELP   = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin 
-# the directory name containing the HTML and XML files should also have 
-# this name.
-
-ECLIPSE_DOC_ID         = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
-# top of each HTML page. The value NO (the default) enables the index and 
-# the value YES disables it.
-
-DISABLE_INDEX          = NO
-
-# This tag can be used to set the number of enum values (range [1..20]) 
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
-# structure should be generated to display hierarchical information. 
-# If the tag value is set to YES, a side panel will be generated 
-# containing a tree-like index structure (just like the one that 
-# is generated for HTML Help). For this to work a browser that supports 
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW      = YES
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES       = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
-# used to set the initial width (in pixels) of the frame in which the tree 
-# is shown.
-
-TREEVIEW_WIDTH         = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open 
-# links to external symbols imported via tag files in a separate window.
-
-EXT_LINKS_IN_WINDOW    = NO
-
-# Use this tag to change the font size of Latex formulas included 
-# as images in the HTML documentation. The default is 10. Note that 
-# when you change the font size after a successful doxygen run you need 
-# to manually remove any form_*.png images from the HTML output directory 
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE       = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images 
-# generated for formulas are transparent PNGs. Transparent PNGs are 
-# not supported properly for IE 6.0, but are supported on all modern browsers. 
-# Note that when changing this option you need to delete any form_*.png files 
-# in the HTML output before the changes have effect.
-
-FORMULA_TRANSPARENT    = YES
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box 
-# for the HTML output. The underlying search engine uses javascript 
-# and DHTML and should work on any modern browser. Note that when using 
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets 
-# (GENERATE_DOCSET) there is already a search function so this one should 
-# typically be disabled. For large projects the javascript based search engine 
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE           = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be 
-# implemented using a PHP enabled web server instead of at the web client 
-# using Javascript. Doxygen will generate the search PHP script and index 
-# file to put on the web server. The advantage of the server 
-# based approach is that it scales better to large projects and allows 
-# full text search. The disadvances is that it is more difficult to setup 
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
-# generate Latex output.
-
-GENERATE_LATEX         = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
-# invoked. If left blank `latex' will be used as the default command name. 
-# Note that when enabling USE_PDFLATEX this option is only used for 
-# generating bitmaps for formulas in the HTML output, but not in the 
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
-# generate index for LaTeX. If left blank `makeindex' will be used as the 
-# default command name.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
-# LaTeX documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE             = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES         = 
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
-# the generated latex document. The header should contain everything until 
-# the first chapter. If it is left blank doxygen will generate a 
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER           = 
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
-# contain links (just like the HTML output) instead of page references 
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS         = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
-# plain latex in the generated Makefile. Set this option to YES to get a 
-# higher quality PDF documentation.
-
-USE_PDFLATEX           = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
-# command to the generated LaTeX files. This will instruct LaTeX to keep 
-# running if errors occur, instead of asking the user for help. 
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE        = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
-# include the index chapters (such as File Index, Compound Index, etc.) 
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include 
-# source code with syntax highlighting in the LaTeX output. 
-# Note that which sources are shown also depends on other settings 
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE      = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
-# The RTF output is optimized for Word 97 and may not look very pretty with 
-# other RTF readers or editors.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
-# RTF documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
-# will contain hyperlink fields. The RTF file will 
-# contain links (just like the HTML output) instead of page references. 
-# This makes the output suitable for online browsing using WORD or other 
-# programs which support those fields. 
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's 
-# config file, i.e. a series of assignments. You only have to provide 
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE    = 
-
-# Set optional variables used in the generation of an rtf document. 
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE    = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
-# generate man pages
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to 
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION          = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
-# then it will generate one additional man file for each entity 
-# documented in the real man page(s). These additional files 
-# only source the real man page, but without them the man command 
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will 
-# generate an XML file that captures the structure of 
-# the code including all documentation.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_SCHEMA             = 
-
-# The XML_DTD tag can be used to specify an XML DTD, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_DTD                = 
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
-# dump the program listings (including syntax highlighting 
-# and cross-referencing information) to the XML output. Note that 
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
-# generate an AutoGen Definitions (see autogen.sf.net) file 
-# that captures the structure of the code including all 
-# documentation. Note that this feature is still experimental 
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
-# generate a Perl module file that captures the structure of 
-# the code including all documentation. Note that this 
-# feature is still experimental and incomplete at the 
-# moment.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
-# nicely formatted so it can be parsed by a human reader.  This is useful 
-# if you want to understand what is going on.  On the other hand, if this 
-# tag is set to NO the size of the Perl module output will be much smaller 
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file 
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
-# This is useful so different doxyrules.make files included by the same 
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX = 
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
-# evaluate all C-preprocessor directives found in the sources and include 
-# files.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
-# names in the source code. If set to NO (the default) only conditional 
-# compilation will be performed. Macro expansion can be done in a controlled 
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION        = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
-# then the macro expansion is limited to the macros specified with the 
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF     = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that 
-# contain include files that are not input files but should be processed by 
-# the preprocessor.
-
-INCLUDE_PATH           = 
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
-# patterns (like *.h and *.hpp) to filter out the header-files in the 
-# directories. If left blank, the patterns specified with FILE_PATTERNS will 
-# be used.
-
-INCLUDE_FILE_PATTERNS  = 
-
-# The PREDEFINED tag can be used to specify one or more macro names that 
-# are defined before the preprocessor is started (similar to the -D option of 
-# gcc). The argument of the tag is a list of macros of the form: name 
-# or name=definition (no spaces). If the definition and the = are 
-# omitted =1 is assumed. To prevent a macro definition from being 
-# undefined via #undef or recursively expanded use the := operator 
-# instead of the = operator.
-
-PREDEFINED             = 
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
-# this tag can be used to specify a list of macro names that should be expanded. 
-# The macro definition that is found in the sources will be used. 
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED      = 
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
-# doxygen's preprocessor will remove all function-like macros that are alone 
-# on a line, have an all uppercase name, and do not end with a semicolon. Such 
-# function macros are typically used for boiler-plate code, and will confuse 
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles. 
-# Optionally an initial location of the external documentation 
-# can be added for each tagfile. The format of a tag file without 
-# this location is as follows: 
-#   TAGFILES = file1 file2 ... 
-# Adding location for the tag files is done as follows: 
-#   TAGFILES = file1=loc1 "file2 = loc2" ... 
-# where "loc1" and "loc2" can be relative or absolute paths or 
-# URLs. If a location is present for each tag, the installdox tool 
-# does not have to be run to correct the links. 
-# Note that each tag file must have a unique name 
-# (where the name does NOT include the path) 
-# If a tag file is not located in the directory in which doxygen 
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES               = 
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE       = 
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
-# in the class index. If set to NO only the inherited external classes 
-# will be listed.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
-# in the modules index. If set to NO, only the current project's groups will 
-# be listed.
-
-EXTERNAL_GROUPS        = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script 
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
-# or super classes. Setting the tag to NO turns the diagrams off. Note that 
-# this option is superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
-# powerful graphs.
-
-CLASS_DIAGRAMS         = NO
-
-# You can define message sequence charts within doxygen comments using the \msc 
-# command. Doxygen will then run the mscgen tool (see 
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
-# the mscgen tool resides. If left empty the tool is assumed to be found in the 
-# default search path.
-
-MSCGEN_PATH            = 
-
-# If set to YES, the inheritance and collaboration graphs will hide 
-# inheritance and usage relations if the target is undocumented 
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS   = NO
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
-# available from the path. This tool is part of Graphviz, a graph visualization 
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT               = YES
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is 
-# allowed to run in parallel. When set to 0 (the default) doxygen will 
-# base this on the number of processors available in the system. You can set it 
-# explicitly to a value larger than 0 to get control over the balance 
-# between CPU load and processing speed.
-
-DOT_NUM_THREADS        = 0
-
-# By default doxygen will write a font called FreeSans.ttf to the output 
-# directory and reference it in all dot files that doxygen generates. This 
-# font does not include all possible unicode characters however, so when you need 
-# these (or just want a differently looking font) you can specify the font name 
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
-# which can be done by putting it in a standard location or by setting the 
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
-# containing the font.
-
-DOT_FONTNAME           = FreeSans.ttf
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
-# The default size is 10pt.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the output directory to look for the 
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
-# different font using DOT_FONTNAME you can set the path where dot 
-# can find it using this tag.
-
-DOT_FONTPATH           = 
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect inheritance relations. Setting this tag to YES will force the 
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect implementation dependencies (inheritance, containment, and 
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
-# collaboration diagrams in a style similar to the OMG's Unified Modeling 
-# Language.
-
-UML_LOOK               = YES
-
-# If set to YES, the inheritance and collaboration graphs will show the 
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
-# tags are set to YES then doxygen will generate a graph for each documented 
-# file showing the direct and indirect include dependencies of the file with 
-# other documented files.
-
-INCLUDE_GRAPH          = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
-# documented header file showing the documented files that directly or 
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
-# doxygen will generate a call dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable call graphs 
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
-# doxygen will generate a caller dependency graph for every global function 
-# or class method. Note that enabling this option will significantly increase 
-# the time of a run. So in most cases it will be better to enable caller 
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
-# then doxygen will show the dependencies a directory has on other directories 
-# in a graphical way. The dependency relations are determined by the #include 
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
-# generated by dot. Possible values are png, jpg, or gif 
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT       = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be 
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH               = 
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that 
-# contain dot files that are included in the documentation (see the 
-# \dotfile command).
-
-DOTFILE_DIRS           = 
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
-# nodes that will be shown in the graph. If the number of nodes in a graph 
-# becomes larger than this value, doxygen will truncate the graph, which is 
-# visualized by representing a node as a red box. Note that doxygen if the 
-# number of direct children of the root node in a graph is already larger than 
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 500
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
-# graphs generated by dot. A depth value of 3 means that only nodes reachable 
-# from the root by following a path via at most 3 edges will be shown. Nodes 
-# that lay further from the root node will be omitted. Note that setting this 
-# option to 1 or 2 may greatly reduce the computation time needed for large 
-# code bases. Also note that the size of a graph can be further restricted by 
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
-# background. This is disabled by default, because dot on Windows does not 
-# seem to support this out of the box. Warning: Depending on the platform used, 
-# enabling this option may lead to badly anti-aliased labels on the edges of 
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
-# files in one run (i.e. multiple -o and -T options on the command line). This 
-# makes dot run faster, but since only newer versions of dot (>1.8.10) 
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = YES
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
-# generate a legend page explaining the meaning of the various boxes and 
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
-# remove the intermediate dot files that are used to generate 
-# the various graphs.
-
-DOT_CLEANUP            = YES
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/C1XCompilation.java	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,310 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.oracle.max.graal.compiler;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.graal.compiler.alloc.*;
-import com.oracle.max.graal.compiler.asm.*;
-import com.oracle.max.graal.compiler.debug.*;
-import com.oracle.max.graal.compiler.gen.*;
-import com.oracle.max.graal.compiler.gen.LIRGenerator.*;
-import com.oracle.max.graal.compiler.graph.*;
-import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.observer.*;
-import com.oracle.max.graal.compiler.value.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-
-/**
- * This class encapsulates global information about the compilation of a particular method,
- * including a reference to the runtime, statistics about the compiled code, etc.
- */
-public final class C1XCompilation {
-
-    private static ThreadLocal<C1XCompilation> currentCompilation = new ThreadLocal<C1XCompilation>();
-
-    public final C1XCompiler compiler;
-    public final CiTarget target;
-    public final RiRuntime runtime;
-    public final RiMethod method;
-    public final RiRegisterConfig registerConfig;
-    public final CiStatistics stats;
-    public final CiAssumptions assumptions = new CiAssumptions();
-    public final FrameState placeholderState;
-
-    public CompilerGraph graph = new CompilerGraph();
-
-    private boolean hasExceptionHandlers;
-    private final C1XCompilation parent;
-
-    /**
-     * @see #setNotTypesafe()
-     * @see #isTypesafe()
-     */
-    private boolean typesafe = true;
-
-    private int nextID = 1;
-
-    private FrameMap frameMap;
-    private TargetMethodAssembler assembler;
-
-    private IR hir;
-
-    private LIRGenerator lirGenerator;
-
-    /**
-     * Creates a new compilation for the specified method and runtime.
-     *
-     * @param compiler the compiler
-     * @param method the method to be compiled or {@code null} if generating code for a stub
-     * @param osrBCI the bytecode index for on-stack replacement, if requested
-     * @param stats externally supplied statistics object to be used if not {@code null}
-     */
-    public C1XCompilation(C1XCompiler compiler, RiMethod method, int osrBCI, CiStatistics stats) {
-        if (osrBCI != -1) {
-            throw new CiBailout("No OSR supported");
-        }
-        this.parent = currentCompilation.get();
-        currentCompilation.set(this);
-        this.compiler = compiler;
-        this.target = compiler.target;
-        this.runtime = compiler.runtime;
-        this.method = method;
-        this.stats = stats == null ? new CiStatistics() : stats;
-        this.registerConfig = method == null ? compiler.globalStubRegisterConfig : runtime.getRegisterConfig(method);
-        this.placeholderState = method != null && method.minimalDebugInfo() ? new FrameState(method, 0, 0, 0, 0, graph) : null;
-
-        if (compiler.isObserved()) {
-            compiler.fireCompilationStarted(new CompilationEvent(this));
-        }
-    }
-
-    public void close() {
-        currentCompilation.set(parent);
-    }
-
-    public IR hir() {
-        return hir;
-    }
-
-    /**
-     * Records that this compilation has exception handlers.
-     */
-    public void setHasExceptionHandlers() {
-        hasExceptionHandlers = true;
-    }
-
-    /**
-     * Translates a given kind to a canonical architecture kind.
-     * This is an identity function for all but {@link CiKind#Word}
-     * which is translated to {@link CiKind#Int} or {@link CiKind#Long}
-     * depending on whether or not this is a {@linkplain #is64Bit() 64-bit}
-     * compilation.
-     */
-    public CiKind archKind(CiKind kind) {
-        if (kind.isWord()) {
-            return target.arch.is64bit() ? CiKind.Long : CiKind.Int;
-        }
-        return kind;
-    }
-
-    /**
-     * Determines if two given kinds are equal at the {@linkplain #archKind(CiKind) architecture} level.
-     */
-    public boolean archKindsEqual(CiKind kind1, CiKind kind2) {
-        return archKind(kind1) == archKind(kind2);
-    }
-
-    /**
-     * Records an assumption that the specified type has no finalizable subclasses.
-     *
-     * @param receiverType the type that is assumed to have no finalizable subclasses
-     * @return {@code true} if the assumption was recorded and can be assumed; {@code false} otherwise
-     */
-    public boolean recordNoFinalizableSubclassAssumption(RiType receiverType) {
-        return false;
-    }
-
-    /**
-     * Converts this compilation to a string.
-     *
-     * @return a string representation of this compilation
-     */
-    @Override
-    public String toString() {
-        return "compile: " + method;
-    }
-
-    /**
-     * Builds the block map for the specified method.
-     *
-     * @param method the method for which to build the block map
-     * @param osrBCI the OSR bytecode index; {@code -1} if this is not an OSR
-     * @return the block map for the specified method
-     */
-    public BlockMap getBlockMap(RiMethod method) {
-        BlockMap map = new BlockMap(method);
-        map.build();
-        if (compiler.isObserved()) {
-            String label = CiUtil.format("BlockListBuilder %f %r %H.%n(%p)", method, true);
-            compiler.fireCompilationEvent(new CompilationEvent(this, label, map, method.code().length));
-        }
-        stats.bytecodeCount += method.code().length;
-        return map;
-    }
-
-    /**
-     * Returns the frame map of this compilation.
-     * @return the frame map
-     */
-    public FrameMap frameMap() {
-        return frameMap;
-    }
-
-    public TargetMethodAssembler assembler() {
-        if (assembler == null) {
-            AbstractAssembler asm = compiler.backend.newAssembler(registerConfig);
-            assembler = new TargetMethodAssembler(asm);
-            assembler.setFrameSize(frameMap.frameSize());
-            assembler.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea());
-        }
-        return assembler;
-    }
-
-    public boolean hasExceptionHandlers() {
-        return hasExceptionHandlers;
-    }
-
-    public CiResult compile() {
-        CiTargetMethod targetMethod;
-        try {
-            emitHIR();
-            emitLIR();
-            targetMethod = emitCode();
-
-            if (C1XOptions.PrintMetrics) {
-                C1XMetrics.BytecodesCompiled += method.code().length;
-            }
-        } catch (CiBailout b) {
-            return new CiResult(null, b, stats);
-        } catch (Throwable t) {
-            if (C1XOptions.BailoutOnException) {
-                return new CiResult(null, new CiBailout("Exception while compiling: " + method, t), stats);
-            } else {
-                throw new RuntimeException(t);
-            }
-        } finally {
-            if (compiler.isObserved()) {
-                compiler.fireCompilationFinished(new CompilationEvent(this));
-            }
-        }
-
-        return new CiResult(targetMethod, null, stats);
-    }
-
-    public IR emitHIR() {
-        hir = new IR(this);
-        hir.build();
-        return hir;
-    }
-
-    public void initFrameMap(int numberOfLocks) {
-        frameMap = this.compiler.backend.newFrameMap(method, numberOfLocks);
-    }
-
-    private void emitLIR() {
-        if (C1XOptions.GenLIR) {
-            if (C1XOptions.PrintTimers) {
-                C1XTimers.LIR_CREATE.start();
-            }
-
-            initFrameMap(hir.maxLocks());
-
-            lirGenerator = compiler.backend.newLIRGenerator(this);
-
-            for (LIRBlock begin : hir.linearScanOrder()) {
-                lirGenerator.doBlock(begin);
-            }
-
-            if (C1XOptions.PrintTimers) {
-                C1XTimers.LIR_CREATE.stop();
-            }
-
-            if (C1XOptions.PrintLIR && !TTY.isSuppressed()) {
-                LIRList.printLIR(hir.linearScanOrder());
-            }
-
-            new LinearScan(this, hir, lirGenerator, frameMap()).allocate();
-        }
-    }
-
-    private CiTargetMethod emitCode() {
-        if (C1XOptions.GenLIR && C1XOptions.GenCode) {
-            final LIRAssembler lirAssembler = compiler.backend.newLIRAssembler(this);
-            lirAssembler.emitCode(hir.linearScanOrder());
-
-            // generate code for slow cases
-            lirAssembler.emitLocalStubs();
-
-            // generate deoptimization stubs
-            ArrayList<DeoptimizationStub> deoptimizationStubs = lirGenerator.deoptimizationStubs();
-            if (deoptimizationStubs != null) {
-                for (DeoptimizationStub stub : deoptimizationStubs) {
-                    lirAssembler.emitDeoptizationStub(stub);
-                }
-            }
-
-            // generate traps at the end of the method
-            lirAssembler.emitTraps();
-
-            CiTargetMethod targetMethod = assembler().finishTargetMethod(method, runtime, lirAssembler.registerRestoreEpilogueOffset, false);
-            if (assumptions.count() > 0) {
-                targetMethod.setAssumptions(assumptions);
-            }
-
-            if (compiler.isObserved()) {
-                compiler.fireCompilationEvent(new CompilationEvent(this, "After code generation", graph, false, true, targetMethod));
-            }
-
-            if (C1XOptions.PrintTimers) {
-                C1XTimers.CODE_CREATE.stop();
-            }
-            return targetMethod;
-        }
-
-        return null;
-    }
-
-    public int nextID() {
-        return nextID++;
-    }
-
-    public static C1XCompilation compilation() {
-        C1XCompilation compilation = currentCompilation.get();
-        assert compilation != null;
-        return compilation;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/C1XCompiler.java	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.max.graal.compiler;
-
-import java.util.*;
-
-import com.oracle.max.graal.compiler.debug.*;
-import com.oracle.max.graal.compiler.globalstub.*;
-import com.oracle.max.graal.compiler.observer.*;
-import com.oracle.max.graal.compiler.target.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
-
-/**
- * This class implements the compiler interface for C1X.
- *
- * @author Thomas Wuerthinger
- * @author Ben L. Titzer
- */
-public class C1XCompiler extends ObservableCompiler {
-
-    public final Map<Object, GlobalStub> stubs = new HashMap<Object, GlobalStub>();
-
-    /**
-     * The target that this compiler has been configured for.
-     */
-    public final CiTarget target;
-
-    /**
-     * The runtime that this compiler has been configured for.
-     */
-    public final RiRuntime runtime;
-
-    /**
-     * The XIR generator that lowers Java operations to machine operations.
-     */
-    public final RiXirGenerator xir;
-
-    /**
-     * The backend that this compiler has been configured for.
-     */
-    public final Backend backend;
-
-    public final RiRegisterConfig globalStubRegisterConfig;
-
-    public C1XCompiler(RiRuntime runtime, CiTarget target, RiXirGenerator xirGen, RiRegisterConfig globalStubRegisterConfig) {
-        this.runtime = runtime;
-        this.target = target;
-        this.xir = xirGen;
-        this.globalStubRegisterConfig = globalStubRegisterConfig;
-        this.backend = Backend.create(target.arch, this);
-        init();
-    }
-
-    public CiResult compileMethod(RiMethod method, int osrBCI, RiXirGenerator xirGenerator, CiStatistics stats) {
-        long startTime = 0;
-        int index = C1XMetrics.CompiledMethods++;
-        if (C1XOptions.PrintCompilation) {
-            TTY.print(String.format("C1X %4d %-70s %-45s | ", index, method.holder().name(), method.name()));
-            startTime = System.nanoTime();
-        }
-
-        CiResult result = null;
-        TTY.Filter filter = new TTY.Filter(C1XOptions.PrintFilter, method);
-        C1XCompilation compilation = new C1XCompilation(this, method, osrBCI, stats);
-        try {
-            result = compilation.compile();
-        } finally {
-            filter.remove();
-            compilation.close();
-            if (C1XOptions.PrintCompilation && !TTY.isSuppressed()) {
-                long time = (System.nanoTime() - startTime) / 100000;
-                TTY.println(String.format("%3d.%dms", time / 10, time % 10));
-            }
-        }
-
-        return result;
-    }
-
-    private void init() {
-        final List<XirTemplate> xirTemplateStubs = xir.buildTemplates(backend.newXirAssembler());
-        final GlobalStubEmitter emitter = backend.newGlobalStubEmitter();
-
-        if (xirTemplateStubs != null) {
-            for (XirTemplate template : xirTemplateStubs) {
-                TTY.Filter filter = new TTY.Filter(C1XOptions.PrintFilter, template.name);
-                try {
-                    stubs.put(template, emitter.emit(template, runtime));
-                } finally {
-                    filter.remove();
-                }
-            }
-        }
-
-        for (GlobalStub.Id id : GlobalStub.Id.values()) {
-            TTY.Filter suppressor = new TTY.Filter(C1XOptions.PrintFilter, id);
-            try {
-                stubs.put(id, emitter.emit(id, runtime));
-            } finally {
-                suppressor.remove();
-            }
-        }
-
-        if (C1XOptions.PrintCFGToFile) {
-            addCompilationObserver(new CFGPrinterObserver());
-        }
-        if (C1XOptions.PrintDOTGraphToFile) {
-            addCompilationObserver(new GraphvizPrinterObserver(false));
-        }
-        if (C1XOptions.PrintDOTGraphToPdf) {
-            addCompilationObserver(new GraphvizPrinterObserver(true));
-        }
-        if (C1XOptions.PrintIdealGraphLevel != 0) {
-            CompilationObserver observer;
-            if (C1XOptions.PrintIdealGraphFile) {
-                observer = new IdealGraphPrinterObserver();
-            } else {
-                observer = new IdealGraphPrinterObserver(C1XOptions.PrintIdealGraphAddress, C1XOptions.PrintIdealGraphPort);
-            }
-            addCompilationObserver(observer);
-        }
-    }
-
-    public GlobalStub lookupGlobalStub(GlobalStub.Id id) {
-        GlobalStub globalStub = stubs.get(id);
-        assert globalStub != null : "no stub for global stub id: " + id;
-        return globalStub;
-    }
-
-    public GlobalStub lookupGlobalStub(XirTemplate template) {
-        GlobalStub globalStub = stubs.get(template);
-        assert globalStub != null : "no stub for XirTemplate: " + template;
-        return globalStub;
-    }
-
-    public GlobalStub lookupGlobalStub(CiRuntimeCall runtimeCall) {
-        GlobalStub globalStub = stubs.get(runtimeCall);
-        if (globalStub == null) {
-            globalStub = backend.newGlobalStubEmitter().emit(runtimeCall, runtime);
-            stubs.put(runtimeCall, globalStub);
-        }
-
-        assert globalStub != null : "could not find global stub for runtime call: " + runtimeCall;
-        return globalStub;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/C1XMetrics.java	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.max.graal.compiler;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.oracle.max.graal.compiler.debug.*;
-
-
-/**
- * This class contains a number of fields that collect metrics about compilation, particularly
- * the number of times certain optimizations are performed.
- */
-public class C1XMetrics {
-    public static int CompiledMethods;
-    public static int TargetMethods;
-    public static int LocalValueNumberHits;
-    public static int ValueMapResizes;
-    public static int InlinedFinalizerChecks;
-    public static int InlineForcedMethods;
-    public static int InlineForbiddenMethods;
-    public static int InlinedJsrs;
-    public static int BlocksDeleted;
-    public static int BytecodesCompiled;
-    public static int CodeBytesEmitted;
-    public static int SafepointsEmitted;
-    public static int ExceptionHandlersEmitted;
-    public static int DataPatches;
-    public static int DirectCallSitesEmitted;
-    public static int IndirectCallSitesEmitted;
-    public static int HIRInstructions;
-    public static int LiveHIRInstructions;
-    public static int LIRInstructions;
-    public static int LIRVariables;
-    public static int LIRXIRInstructions;
-    public static int LIRMoveInstructions;
-    public static int LSRAIntervalsCreated;
-    public static int LSRASpills;
-    public static int LoadConstantIterations;
-    public static int CodeBufferCopies;
-    public static int UniqueValueIdsAssigned;
-    public static int FrameStatesCreated;
-    public static int FrameStateValuesCreated;
-    public static int NodesCanonicalized;
-
-    public static void print() {
-        printClassFields(C1XMetrics.class);
-
-    }
-
-    public static void printClassFields(Class<?> javaClass) {
-        final String className = javaClass.getSimpleName();
-        TTY.println(className + " {");
-        for (final Field field : javaClass.getFields()) {
-            printField(field, false);
-        }
-        TTY.println("}");
-    }
-
-    public static void printField(final Field field, boolean tabbed) {
-        final String fieldName = String.format("%35s", field.getName());
-        try {
-            String prefix = tabbed ? "" : "    " + fieldName + " = ";
-            String postfix = tabbed ? "\t" : "\n";
-            if (field.getType() == int.class) {
-                TTY.print(prefix + field.getInt(null) + postfix);
-            } else if (field.getType() == boolean.class) {
-                TTY.print(prefix + field.getBoolean(null) + postfix);
-            } else if (field.getType() == float.class) {
-                TTY.print(prefix + field.getFloat(null) + postfix);
-            } else if (field.getType() == String.class) {
-                TTY.print(prefix + field.get(null) + postfix);
-            } else if (field.getType() == Map.class) {
-                Map<?, ?> m = (Map<?, ?>) field.get(null);
-                TTY.print(prefix + printMap(m) + postfix);
-            } else {
-                TTY.print(prefix + field.get(null) + postfix);
-            }
-        } catch (IllegalAccessException e) {
-            // do nothing.
-        }
-    }
-
-    private static String printMap(Map<?, ?> m) {
-        StringBuilder sb = new StringBuilder();
-
-        List<String> keys = new ArrayList<String>();
-        for (Object key : m.keySet()) {
-            keys.add((String) key);
-        }
-        Collections.sort(keys);
-
-        for (String key : keys) {
-            sb.append(key);
-            sb.append("\t");
-            sb.append(m.get(key));
-            sb.append("\n");
-        }
-
-        return sb.toString();
-    }
-
-    private static void printField(String fieldName, long value) {
-        TTY.print("    " + fieldName + " = " + value + "\n");
-    }
-
-    private static void printField(String fieldName, double value) {
-        TTY.print("    " + fieldName + " = " + value + "\n");
-    }
-}
-
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/C1XOptions.java	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.max.graal.compiler;
-
-import com.oracle.max.graal.compiler.debug.TTY.*;
-
-/**
- * This class encapsulates options that control the behavior of the C1X compiler.
- * The help message for each option is specified by a {@linkplain #helpMap help map}.
- *
- * (tw) WARNING: Fields of this class are treated as final by Graal.
- *
- * @author Ben L. Titzer
- */
-public final class C1XOptions {
-
-    // Checkstyle: stop
-    private static final boolean ____ = false;
-    // Checkstyle: resume
-
-    // inlining settings
-    public static boolean Inline                             = ____;
-    public static int     MaximumInstructionCount            = 37000;
-    public static float   MaximumInlineRatio                 = 0.90f;
-    public static int     MaximumInlineSize                  = 35;
-    public static int     MaximumTrivialSize                 = 6;
-    public static int     MaximumInlineLevel                 = 9;
-    public static int     MaximumRecursiveInlineLevel        = 2;
-    public static int     MaximumDesiredSize                 = 8000;
-    public static int     MaximumShortLoopSize               = 5;
-
-    // debugging settings
-    public static boolean VerifyPointerMaps                  = ____;
-    public static int     MethodEndBreakpointGuards          = 0;
-    public static boolean ZapStackOnMethodEntry              = ____;
-    public static boolean StressLinearScan                   = ____;
-    public static boolean BailoutOnException                 = ____;
-
-    /**
-     * See {@link Filter#Filter(String, Object)}.
-     */
-    public static String  PrintFilter                        = null;
-
-    // printing settings
-    public static boolean PrintLIR                           = ____;
-    public static boolean PrintCFGToFile                     = ____;
-
-    // DOT output settings
-    public static boolean PrintDOTGraphToFile                = ____;
-    public static boolean PrintDOTGraphToPdf                 = ____;
-    public static boolean OmitDOTFrameStates                 = ____;
-
-    // Ideal graph visualizer output settings
-    public static int     PrintIdealGraphLevel               = 0;
-    public static boolean PrintIdealGraphFile                = ____;
-    public static String  PrintIdealGraphAddress             = "127.0.0.1";
-    public static int     PrintIdealGraphPort                = 4444;
-
-    // Other printing settings
-    public static boolean PrintMetrics                       = ____;
-    public static boolean PrintTimers                        = ____;
-    public static boolean PrintCompilation                   = ____;
-    public static boolean PrintXirTemplates                  = ____;
-    public static boolean PrintIRWithLIR                     = ____;
-    public static boolean PrintAssembly                      = ____;
-    public static boolean PrintCodeBytes                     = ____;
-    public static int     PrintAssemblyBytesPerLine          = 16;
-    public static int     TraceLinearScanLevel               = 0;
-    public static int     TraceLIRGeneratorLevel             = 0;
-    public static boolean TraceRelocation                    = ____;
-    public static boolean TraceLIRVisit                      = ____;
-    public static boolean TraceAssembler                     = ____;
-    public static boolean TraceInlining                      = ____;
-    public static boolean TraceDeadCodeElimination           = ____;
-    public static int     TraceBytecodeParserLevel           = 0;
-    public static boolean QuietBailout                       = ____;
-
-    // state merging settings
-    public static boolean AssumeVerifiedBytecode             = ____;
-
-    // Linear scan settings
-    public static boolean CopyPointerStackArguments          = true;
-
-    // Code generator settings
-    public static boolean GenLIR                             = true;
-    public static boolean GenCode                            = true;
-
-    public static boolean UseConstDirectCall                 = false;
-
-    public static boolean GenSpecialDivChecks                = ____;
-    public static boolean GenAssertionCode                   = ____;
-    public static boolean AlignCallsForPatching              = true;
-    public static boolean NullCheckUniquePc                  = ____;
-    public static boolean InvokeSnippetAfterArguments        = ____;
-    public static boolean ResolveClassBeforeStaticInvoke     = true;
-
-    // Translating tableswitch instructions
-    public static int     SequentialSwitchLimit              = 4;
-    public static int     RangeTestsSwitchDensity            = 5;
-
-    public static boolean DetailedAsserts                    = ____;
-
-    // Runtime settings
-    public static int     ReadPrefetchInstr                  = 0;
-    public static int     StackShadowPages                   = 2;
-
-    // Assembler settings
-    public static boolean CommentedAssembly                  = ____;
-    public static boolean PrintLIRWithAssembly               = ____;
-
-    public static boolean OptCanonicalizer                   = true;
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/C1XTimers.java	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2009, 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.max.graal.compiler;
-
-import com.oracle.max.graal.compiler.debug.*;
-
-/**
- * This class contains timers that record the amount of time spent in various
- * parts of the compiler.
- *
- * @author Christian Wimmer
- */
-public enum C1XTimers {
-    HIR_CREATE("Create HIR"),
-    HIR_OPTIMIZE("Optimize HIR"),
-    NCE("Nullcheck elimination"),
-    LIR_CREATE("Create LIR"),
-    LIFETIME_ANALYSIS("Lifetime Analysis"),
-    LINEAR_SCAN("Linear Scan"),
-    RESOLUTION("Resolution"),
-    DEBUG_INFO("Create Debug Info"),
-    CODE_CREATE("Create Code");
-
-    private final String name;
-    private long start;
-    private long total;
-
-    private C1XTimers(String name) {
-        this.name = name;
-    }
-
-    public void start() {
-        start = System.nanoTime();
-    }
-
-    public void stop() {
-        total += System.nanoTime() - start;
-    }
-
-    public static void reset() {
-        for (C1XTimers t : values()) {
-            t.total = 0;
-        }
-    }
-
-    public static void print() {
-        long total = 0;
-        for (C1XTimers timer : C1XTimers.values()) {
-            total += timer.total;
-        }
-        if (total == 0) {
-            return;
-        }
-
-        TTY.println();
-        for (C1XTimers timer : C1XTimers.values()) {
-            TTY.println("%-20s: %7.4f s (%5.2f%%)", timer.name, timer.total / 1000000000.0, timer.total * 100.0 / total);
-            timer.total = 0;
-        }
-        TTY.println();
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,310 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.max.graal.compiler;
+
+import java.util.*;
+
+import com.oracle.max.asm.*;
+import com.oracle.max.graal.compiler.alloc.*;
+import com.oracle.max.graal.compiler.asm.*;
+import com.oracle.max.graal.compiler.debug.*;
+import com.oracle.max.graal.compiler.gen.*;
+import com.oracle.max.graal.compiler.gen.LIRGenerator.*;
+import com.oracle.max.graal.compiler.graph.*;
+import com.oracle.max.graal.compiler.lir.*;
+import com.oracle.max.graal.compiler.observer.*;
+import com.oracle.max.graal.compiler.value.*;
+import com.sun.cri.ci.*;
+import com.sun.cri.ri.*;
+
+/**
+ * This class encapsulates global information about the compilation of a particular method,
+ * including a reference to the runtime, statistics about the compiled code, etc.
+ */
+public final class GraalCompilation {
+
+    private static ThreadLocal<GraalCompilation> currentCompilation = new ThreadLocal<GraalCompilation>();
+
+    public final GraalCompiler compiler;
+    public final CiTarget target;
+    public final RiRuntime runtime;
+    public final RiMethod method;
+    public final RiRegisterConfig registerConfig;
+    public final CiStatistics stats;
+    public final CiAssumptions assumptions = new CiAssumptions();
+    public final FrameState placeholderState;
+
+    public CompilerGraph graph = new CompilerGraph();
+
+    private boolean hasExceptionHandlers;
+    private final GraalCompilation parent;
+
+    /**
+     * @see #setNotTypesafe()
+     * @see #isTypesafe()
+     */
+    private boolean typesafe = true;
+
+    private int nextID = 1;
+
+    private FrameMap frameMap;
+    private TargetMethodAssembler assembler;
+
+    private IR hir;
+
+    private LIRGenerator lirGenerator;
+
+    /**
+     * Creates a new compilation for the specified method and runtime.
+     *
+     * @param compiler the compiler
+     * @param method the method to be compiled or {@code null} if generating code for a stub
+     * @param osrBCI the bytecode index for on-stack replacement, if requested
+     * @param stats externally supplied statistics object to be used if not {@code null}
+     */
+    public GraalCompilation(GraalCompiler compiler, RiMethod method, int osrBCI, CiStatistics stats) {
+        if (osrBCI != -1) {
+            throw new CiBailout("No OSR supported");
+        }
+        this.parent = currentCompilation.get();
+        currentCompilation.set(this);
+        this.compiler = compiler;
+        this.target = compiler.target;
+        this.runtime = compiler.runtime;
+        this.method = method;
+        this.stats = stats == null ? new CiStatistics() : stats;
+        this.registerConfig = method == null ? compiler.globalStubRegisterConfig : runtime.getRegisterConfig(method);
+        this.placeholderState = method != null && method.minimalDebugInfo() ? new FrameState(method, 0, 0, 0, 0, graph) : null;
+
+        if (compiler.isObserved()) {
+            compiler.fireCompilationStarted(new CompilationEvent(this));
+        }
+    }
+
+    public void close() {
+        currentCompilation.set(parent);
+    }
+
+    public IR hir() {
+        return hir;
+    }
+
+    /**
+     * Records that this compilation has exception handlers.
+     */
+    public void setHasExceptionHandlers() {
+        hasExceptionHandlers = true;
+    }
+
+    /**
+     * Translates a given kind to a canonical architecture kind.
+     * This is an identity function for all but {@link CiKind#Word}
+     * which is translated to {@link CiKind#Int} or {@link CiKind#Long}
+     * depending on whether or not this is a {@linkplain #is64Bit() 64-bit}
+     * compilation.
+     */
+    public CiKind archKind(CiKind kind) {
+        if (kind.isWord()) {
+            return target.arch.is64bit() ? CiKind.Long : CiKind.Int;
+        }
+        return kind;
+    }
+
+    /**
+     * Determines if two given kinds are equal at the {@linkplain #archKind(CiKind) architecture} level.
+     */
+    public boolean archKindsEqual(CiKind kind1, CiKind kind2) {
+        return archKind(kind1) == archKind(kind2);
+    }
+
+    /**
+     * Records an assumption that the specified type has no finalizable subclasses.
+     *
+     * @param receiverType the type that is assumed to have no finalizable subclasses
+     * @return {@code true} if the assumption was recorded and can be assumed; {@code false} otherwise
+     */
+    public boolean recordNoFinalizableSubclassAssumption(RiType receiverType) {
+        return false;
+    }
+
+    /**
+     * Converts this compilation to a string.
+     *
+     * @return a string representation of this compilation
+     */
+    @Override
+    public String toString() {
+        return "compile: " + method;
+    }
+
+    /**
+     * Builds the block map for the specified method.
+     *
+     * @param method the method for which to build the block map
+     * @param osrBCI the OSR bytecode index; {@code -1} if this is not an OSR
+     * @return the block map for the specified method
+     */
+    public BlockMap getBlockMap(RiMethod method) {
+        BlockMap map = new BlockMap(method);
+        map.build();
+        if (compiler.isObserved()) {
+            String label = CiUtil.format("BlockListBuilder %f %r %H.%n(%p)", method, true);
+            compiler.fireCompilationEvent(new CompilationEvent(this, label, map, method.code().length));
+        }
+        stats.bytecodeCount += method.code().length;
+        return map;
+    }
+
+    /**
+     * Returns the frame map of this compilation.
+     * @return the frame map
+     */
+    public FrameMap frameMap() {
+        return frameMap;
+    }
+
+    public TargetMethodAssembler assembler() {
+        if (assembler == null) {
+            AbstractAssembler asm = compiler.backend.newAssembler(registerConfig);
+            assembler = new TargetMethodAssembler(asm);
+            assembler.setFrameSize(frameMap.frameSize());
+            assembler.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea());
+        }
+        return assembler;
+    }
+
+    public boolean hasExceptionHandlers() {
+        return hasExceptionHandlers;
+    }
+
+    public CiResult compile() {
+        CiTargetMethod targetMethod;
+        try {
+            emitHIR();
+            emitLIR();
+            targetMethod = emitCode();
+
+            if (GraalOptions.PrintMetrics) {
+                GraalMetrics.BytecodesCompiled += method.code().length;
+            }
+        } catch (CiBailout b) {
+            return new CiResult(null, b, stats);
+        } catch (Throwable t) {
+            if (GraalOptions.BailoutOnException) {
+                return new CiResult(null, new CiBailout("Exception while compiling: " + method, t), stats);
+            } else {
+                throw new RuntimeException(t);
+            }
+        } finally {
+            if (compiler.isObserved()) {
+                compiler.fireCompilationFinished(new CompilationEvent(this));
+            }
+        }
+
+        return new CiResult(targetMethod, null, stats);
+    }
+
+    public IR emitHIR() {
+        hir = new IR(this);
+        hir.build();
+        return hir;
+    }
+
+    public void initFrameMap(int numberOfLocks) {
+        frameMap = this.compiler.backend.newFrameMap(method, numberOfLocks);
+    }
+
+    private void emitLIR() {
+        if (GraalOptions.GenLIR) {
+            if (GraalOptions.PrintTimers) {
+                GraalTimers.LIR_CREATE.start();
+            }
+
+            initFrameMap(hir.maxLocks());
+
+            lirGenerator = compiler.backend.newLIRGenerator(this);
+
+            for (LIRBlock begin : hir.linearScanOrder()) {
+                lirGenerator.doBlock(begin);
+            }
+
+            if (GraalOptions.PrintTimers) {
+                GraalTimers.LIR_CREATE.stop();
+            }
+
+            if (GraalOptions.PrintLIR && !TTY.isSuppressed()) {
+                LIRList.printLIR(hir.linearScanOrder());
+            }
+
+            new LinearScan(this, hir, lirGenerator, frameMap()).allocate();
+        }
+    }
+
+    private CiTargetMethod emitCode() {
+        if (GraalOptions.GenLIR && GraalOptions.GenCode) {
+            final LIRAssembler lirAssembler = compiler.backend.newLIRAssembler(this);
+            lirAssembler.emitCode(hir.linearScanOrder());
+
+            // generate code for slow cases
+            lirAssembler.emitLocalStubs();
+
+            // generate deoptimization stubs
+            ArrayList<DeoptimizationStub> deoptimizationStubs = lirGenerator.deoptimizationStubs();
+            if (deoptimizationStubs != null) {
+                for (DeoptimizationStub stub : deoptimizationStubs) {
+                    lirAssembler.emitDeoptizationStub(stub);
+                }
+            }
+
+            // generate traps at the end of the method
+            lirAssembler.emitTraps();
+
+            CiTargetMethod targetMethod = assembler().finishTargetMethod(method, runtime, lirAssembler.registerRestoreEpilogueOffset, false);
+            if (assumptions.count() > 0) {
+                targetMethod.setAssumptions(assumptions);
+            }
+
+            if (compiler.isObserved()) {
+                compiler.fireCompilationEvent(new CompilationEvent(this, "After code generation", graph, false, true, targetMethod));
+            }
+
+            if (GraalOptions.PrintTimers) {
+                GraalTimers.CODE_CREATE.stop();
+            }
+            return targetMethod;
+        }
+
+        return null;
+    }
+
+    public int nextID() {
+        return nextID++;
+    }
+
+    public static GraalCompilation compilation() {
+        GraalCompilation compilation = currentCompilation.get();
+        assert compilation != null;
+        return compilation;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.graal.compiler;
+
+import java.util.*;
+
+import com.oracle.max.graal.compiler.debug.*;
+import com.oracle.max.graal.compiler.globalstub.*;
+import com.oracle.max.graal.compiler.observer.*;
+import com.oracle.max.graal.compiler.target.*;
+import com.sun.cri.ci.*;
+import com.sun.cri.ri.*;
+import com.sun.cri.xir.*;
+
+public class GraalCompiler extends ObservableCompiler {
+
+    public final Map<Object, GlobalStub> stubs = new HashMap<Object, GlobalStub>();
+
+    /**
+     * The target that this compiler has been configured for.
+     */
+    public final CiTarget target;
+
+    /**
+     * The runtime that this compiler has been configured for.
+     */
+    public final RiRuntime runtime;
+
+    /**
+     * The XIR generator that lowers Java operations to machine operations.
+     */
+    public final RiXirGenerator xir;
+
+    /**
+     * The backend that this compiler has been configured for.
+     */
+    public final Backend backend;
+
+    public final RiRegisterConfig globalStubRegisterConfig;
+
+    public GraalCompiler(RiRuntime runtime, CiTarget target, RiXirGenerator xirGen, RiRegisterConfig globalStubRegisterConfig) {
+        this.runtime = runtime;
+        this.target = target;
+        this.xir = xirGen;
+        this.globalStubRegisterConfig = globalStubRegisterConfig;
+        this.backend = Backend.create(target.arch, this);
+        init();
+    }
+
+    public CiResult compileMethod(RiMethod method, int osrBCI, RiXirGenerator xirGenerator, CiStatistics stats) {
+        long startTime = 0;
+        int index = GraalMetrics.CompiledMethods++;
+        if (GraalOptions.PrintCompilation) {
+            TTY.print(String.format("Graal %4d %-70s %-45s | ", index, method.holder().name(), method.name()));
+            startTime = System.nanoTime();
+        }
+
+        CiResult result = null;
+        TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
+        GraalCompilation compilation = new GraalCompilation(this, method, osrBCI, stats);
+        try {
+            result = compilation.compile();
+        } finally {
+            filter.remove();
+            compilation.close();
+            if (GraalOptions.PrintCompilation && !TTY.isSuppressed()) {
+                long time = (System.nanoTime() - startTime) / 100000;
+                TTY.println(String.format("%3d.%dms", time / 10, time % 10));
+            }
+        }
+
+        return result;
+    }
+
+    private void init() {
+        final List<XirTemplate> xirTemplateStubs = xir.buildTemplates(backend.newXirAssembler());
+        final GlobalStubEmitter emitter = backend.newGlobalStubEmitter();
+
+        if (xirTemplateStubs != null) {
+            for (XirTemplate template : xirTemplateStubs) {
+                TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, template.name);
+                try {
+                    stubs.put(template, emitter.emit(template, runtime));
+                } finally {
+                    filter.remove();
+                }
+            }
+        }
+
+        for (GlobalStub.Id id : GlobalStub.Id.values()) {
+            TTY.Filter suppressor = new TTY.Filter(GraalOptions.PrintFilter, id);
+            try {
+                stubs.put(id, emitter.emit(id, runtime));
+            } finally {
+                suppressor.remove();
+            }
+        }
+
+        if (GraalOptions.PrintCFGToFile) {
+            addCompilationObserver(new CFGPrinterObserver());
+        }
+        if (GraalOptions.PrintDOTGraphToFile) {
+            addCompilationObserver(new GraphvizPrinterObserver(false));
+        }
+        if (GraalOptions.PrintDOTGraphToPdf) {
+            addCompilationObserver(new GraphvizPrinterObserver(true));
+        }
+        if (GraalOptions.PrintIdealGraphLevel != 0) {
+            CompilationObserver observer;
+            if (GraalOptions.PrintIdealGraphFile) {
+                observer = new IdealGraphPrinterObserver();
+            } else {
+                observer = new IdealGraphPrinterObserver(GraalOptions.PrintIdealGraphAddress, GraalOptions.PrintIdealGraphPort);
+            }
+            addCompilationObserver(observer);
+        }
+    }
+
+    public GlobalStub lookupGlobalStub(GlobalStub.Id id) {
+        GlobalStub globalStub = stubs.get(id);
+        assert globalStub != null : "no stub for global stub id: " + id;
+        return globalStub;
+    }
+
+    public GlobalStub lookupGlobalStub(XirTemplate template) {
+        GlobalStub globalStub = stubs.get(template);
+        assert globalStub != null : "no stub for XirTemplate: " + template;
+        return globalStub;
+    }
+
+    public GlobalStub lookupGlobalStub(CiRuntimeCall runtimeCall) {
+        GlobalStub globalStub = stubs.get(runtimeCall);
+        if (globalStub == null) {
+            globalStub = backend.newGlobalStubEmitter().emit(runtimeCall, runtime);
+            stubs.put(runtimeCall, globalStub);
+        }
+
+        assert globalStub != null : "could not find global stub for runtime call: " + runtimeCall;
+        return globalStub;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalMetrics.java	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.graal.compiler;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.max.graal.compiler.debug.*;
+
+
+/**
+ * This class contains a number of fields that collect metrics about compilation, particularly
+ * the number of times certain optimizations are performed.
+ */
+public class GraalMetrics {
+    public static int CompiledMethods;
+    public static int TargetMethods;
+    public static int LocalValueNumberHits;
+    public static int ValueMapResizes;
+    public static int InlinedFinalizerChecks;
+    public static int InlineForcedMethods;
+    public static int InlineForbiddenMethods;
+    public static int InlinedJsrs;
+    public static int BlocksDeleted;
+    public static int BytecodesCompiled;
+    public static int CodeBytesEmitted;
+    public static int SafepointsEmitted;
+    public static int ExceptionHandlersEmitted;
+    public static int DataPatches;
+    public static int DirectCallSitesEmitted;
+    public static int IndirectCallSitesEmitted;
+    public static int HIRInstructions;
+    public static int LiveHIRInstructions;
+    public static int LIRInstructions;
+    public static int LIRVariables;
+    public static int LIRXIRInstructions;
+    public static int LIRMoveInstructions;
+    public static int LSRAIntervalsCreated;
+    public static int LSRASpills;
+    public static int LoadConstantIterations;
+    public static int CodeBufferCopies;
+    public static int UniqueValueIdsAssigned;
+    public static int FrameStatesCreated;
+    public static int FrameStateValuesCreated;
+    public static int NodesCanonicalized;
+
+    public static void print() {
+        printClassFields(GraalMetrics.class);
+
+    }
+
+    public static void printClassFields(Class<?> javaClass) {
+        final String className = javaClass.getSimpleName();
+        TTY.println(className + " {");
+        for (final Field field : javaClass.getFields()) {
+            printField(field, false);
+        }
+        TTY.println("}");
+    }
+
+    public static void printField(final Field field, boolean tabbed) {
+        final String fieldName = String.format("%35s", field.getName());
+        try {
+            String prefix = tabbed ? "" : "    " + fieldName + " = ";
+            String postfix = tabbed ? "\t" : "\n";
+            if (field.getType() == int.class) {
+                TTY.print(prefix + field.getInt(null) + postfix);
+            } else if (field.getType() == boolean.class) {
+                TTY.print(prefix + field.getBoolean(null) + postfix);
+            } else if (field.getType() == float.class) {
+                TTY.print(prefix + field.getFloat(null) + postfix);
+            } else if (field.getType() == String.class) {
+                TTY.print(prefix + field.get(null) + postfix);
+            } else if (field.getType() == Map.class) {
+                Map<?, ?> m = (Map<?, ?>) field.get(null);
+                TTY.print(prefix + printMap(m) + postfix);
+            } else {
+                TTY.print(prefix + field.get(null) + postfix);
+            }
+        } catch (IllegalAccessException e) {
+            // do nothing.
+        }
+    }
+
+    private static String printMap(Map<?, ?> m) {
+        StringBuilder sb = new StringBuilder();
+
+        List<String> keys = new ArrayList<String>();
+        for (Object key : m.keySet()) {
+            keys.add((String) key);
+        }
+        Collections.sort(keys);
+
+        for (String key : keys) {
+            sb.append(key);
+            sb.append("\t");
+            sb.append(m.get(key));
+            sb.append("\n");
+        }
+
+        return sb.toString();
+    }
+
+    private static void printField(String fieldName, long value) {
+        TTY.print("    " + fieldName + " = " + value + "\n");
+    }
+
+    private static void printField(String fieldName, double value) {
+        TTY.print("    " + fieldName + " = " + value + "\n");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalOptions.java	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.graal.compiler;
+
+import com.oracle.max.graal.compiler.debug.TTY.*;
+
+/**
+ * This class encapsulates options that control the behavior of the Graal compiler.
+ * The help message for each option is specified by a {@linkplain #helpMap help map}.
+ *
+ * (tw) WARNING: Fields of this class are treated as final by Graal.
+ *
+ * @author Ben L. Titzer
+ */
+public final class GraalOptions {
+
+    // Checkstyle: stop
+    private static final boolean ____ = false;
+    // Checkstyle: resume
+
+    // inlining settings
+    public static boolean Inline                             = ____;
+    public static int     MaximumInstructionCount            = 37000;
+    public static float   MaximumInlineRatio                 = 0.90f;
+    public static int     MaximumInlineSize                  = 35;
+    public static int     MaximumTrivialSize                 = 6;
+    public static int     MaximumInlineLevel                 = 9;
+    public static int     MaximumRecursiveInlineLevel        = 2;
+    public static int     MaximumDesiredSize                 = 8000;
+    public static int     MaximumShortLoopSize               = 5;
+
+    // debugging settings
+    public static boolean VerifyPointerMaps                  = ____;
+    public static int     MethodEndBreakpointGuards          = 0;
+    public static boolean ZapStackOnMethodEntry              = ____;
+    public static boolean StressLinearScan                   = ____;
+    public static boolean BailoutOnException                 = ____;
+
+    /**
+     * See {@link Filter#Filter(String, Object)}.
+     */
+    public static String  PrintFilter                        = null;
+
+    // printing settings
+    public static boolean PrintLIR                           = ____;
+    public static boolean PrintCFGToFile                     = ____;
+
+    // DOT output settings
+    public static boolean PrintDOTGraphToFile                = ____;
+    public static boolean PrintDOTGraphToPdf                 = ____;
+    public static boolean OmitDOTFrameStates                 = ____;
+
+    // Ideal graph visualizer output settings
+    public static int     PrintIdealGraphLevel               = 0;
+    public static boolean PrintIdealGraphFile                = ____;
+    public static String  PrintIdealGraphAddress             = "127.0.0.1";
+    public static int     PrintIdealGraphPort                = 4444;
+
+    // Other printing settings
+    public static boolean PrintMetrics                       = ____;
+    public static boolean PrintTimers                        = ____;
+    public static boolean PrintCompilation                   = ____;
+    public static boolean PrintXirTemplates                  = ____;
+    public static boolean PrintIRWithLIR                     = ____;
+    public static boolean PrintAssembly                      = ____;
+    public static boolean PrintCodeBytes                     = ____;
+    public static int     PrintAssemblyBytesPerLine          = 16;
+    public static int     TraceLinearScanLevel               = 0;
+    public static int     TraceLIRGeneratorLevel             = 0;
+    public static boolean TraceRelocation                    = ____;
+    public static boolean TraceLIRVisit                      = ____;
+    public static boolean TraceAssembler                     = ____;
+    public static boolean TraceInlining                      = ____;
+    public static boolean TraceDeadCodeElimination           = ____;
+    public static int     TraceBytecodeParserLevel           = 0;
+    public static boolean QuietBailout                       = ____;
+
+    // state merging settings
+    public static boolean AssumeVerifiedBytecode             = ____;
+
+    // Linear scan settings
+    public static boolean CopyPointerStackArguments          = true;
+
+    // Code generator settings
+    public static boolean GenLIR                             = true;
+    public static boolean GenCode                            = true;
+
+    public static boolean UseConstDirectCall                 = false;
+
+    public static boolean GenSpecialDivChecks                = ____;
+    public static boolean GenAssertionCode                   = ____;
+    public static boolean AlignCallsForPatching              = true;
+    public static boolean NullCheckUniquePc                  = ____;
+    public static boolean InvokeSnippetAfterArguments        = ____;
+    public static boolean ResolveClassBeforeStaticInvoke     = true;
+
+    // Translating tableswitch instructions
+    public static int     SequentialSwitchLimit              = 4;
+    public static int     RangeTestsSwitchDensity            = 5;
+
+    public static boolean DetailedAsserts                    = ____;
+
+    // Runtime settings
+    public static int     ReadPrefetchInstr                  = 0;
+    public static int     StackShadowPages                   = 2;
+
+    // Assembler settings
+    public static boolean CommentedAssembly                  = ____;
+    public static boolean PrintLIRWithAssembly               = ____;
+
+    public static boolean OptCanonicalizer                   = true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalTimers.java	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2009, 2009, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.graal.compiler;
+
+import com.oracle.max.graal.compiler.debug.*;
+
+/**
+ * This class contains timers that record the amount of time spent in various
+ * parts of the compiler.
+ *
+ * @author Christian Wimmer
+ */
+public enum GraalTimers {
+    HIR_CREATE("Create HIR"),
+    HIR_OPTIMIZE("Optimize HIR"),
+    NCE("Nullcheck elimination"),
+    LIR_CREATE("Create LIR"),
+    LIFETIME_ANALYSIS("Lifetime Analysis"),
+    LINEAR_SCAN("Linear Scan"),
+    RESOLUTION("Resolution"),
+    DEBUG_INFO("Create Debug Info"),
+    CODE_CREATE("Create Code");
+
+    private final String name;
+    private long start;
+    private long total;
+
+    private GraalTimers(String name) {
+        this.name = name;
+    }
+
+    public void start() {
+        start = System.nanoTime();
+    }
+
+    public void stop() {
+        total += System.nanoTime() - start;
+    }
+
+    public static void reset() {
+        for (GraalTimers t : values()) {
+            t.total = 0;
+        }
+    }
+
+    public static void print() {
+        long total = 0;
+        for (GraalTimers timer : GraalTimers.values()) {
+            total += timer.total;
+        }
+        if (total == 0) {
+            return;
+        }
+
+        TTY.println();
+        for (GraalTimers timer : GraalTimers.values()) {
+            TTY.println("%-20s: %7.4f s (%5.2f%%)", timer.name, timer.total / 1000000000.0, timer.total * 100.0 / total);
+            timer.total = 0;
+        }
+        TTY.println();
+    }
+}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/ControlFlowOptimizer.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/ControlFlowOptimizer.java	Wed Jun 08 14:10:06 2011 +0200
@@ -57,7 +57,7 @@
 
     private void reorderShortLoop(List<LIRBlock> code, LIRBlock headerBlock, int headerIdx) {
         int i = headerIdx + 1;
-        int maxEnd = Math.min(headerIdx + C1XOptions.MaximumShortLoopSize, code.size());
+        int maxEnd = Math.min(headerIdx + GraalOptions.MaximumShortLoopSize, code.size());
         while (i < maxEnd && code.get(i).loopDepth() >= headerBlock.loopDepth()) {
             i++;
         }
@@ -136,7 +136,7 @@
 
                 // adjust successor and predecessor lists
                 block.replaceWith(newTarget);
-                C1XMetrics.BlocksDeleted++;
+                GraalMetrics.BlocksDeleted++;
             } else {
                 // adjust position of this block in the block list if blocks before
                 // have been deleted
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/EdgeMoveOptimizer.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/EdgeMoveOptimizer.java	Wed Jun 08 14:10:06 2011 +0200
@@ -211,7 +211,7 @@
         // the instructions are inserted at the end of the block before these two branches
         int insertIdx = instructions.size() - 2;
 
-        if (C1XOptions.DetailedAsserts) {
+        if (GraalOptions.DetailedAsserts) {
             for (int i = insertIdx - 1; i >= 0; i--) {
                 LIRInstruction op = instructions.get(i);
                 if ((op.code == LIROpcode.Branch || op.code == LIROpcode.CondFloatBranch) && ((LIRBranch) op).block() != null) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/Interval.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/Interval.java	Wed Jun 08 14:10:06 2011 +0200
@@ -661,7 +661,7 @@
     static final Interval EndMarker = new Interval(CiValue.IllegalValue, -1);
 
     Interval(CiValue operand, int operandNumber) {
-        C1XMetrics.LSRAIntervalsCreated++;
+        GraalMetrics.LSRAIntervalsCreated++;
         assert operand != null;
         this.operand = operand;
         this.operandNumber = operandNumber;
@@ -910,7 +910,7 @@
 
         // do not add use positions for precolored intervals because they are never used
         if (registerPriority != RegisterPriority.None && operand.isVariable()) {
-            if (C1XOptions.DetailedAsserts) {
+            if (GraalOptions.DetailedAsserts) {
                 for (int i = 0; i < usePosList.size(); i++) {
                     assert pos <= usePosList.usePos(i) : "already added a use-position with lower position";
                     if (i > 0) {
@@ -1014,7 +1014,7 @@
         // split list of use positions
         result.usePosList = usePosList.splitAt(splitPos);
 
-        if (C1XOptions.DetailedAsserts) {
+        if (GraalOptions.DetailedAsserts) {
             for (int i = 0; i < usePosList.size(); i++) {
                 assert usePosList.usePos(i) < splitPos;
             }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/IntervalWalker.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/IntervalWalker.java	Wed Jun 08 14:10:06 2011 +0200
@@ -32,7 +32,7 @@
  */
 public class IntervalWalker {
 
-    protected final C1XCompilation compilation;
+    protected final GraalCompilation compilation;
     protected final LinearScan allocator;
 
     /**
@@ -206,7 +206,7 @@
             boolean isActive = current.from() <= toOpId;
             int opId = isActive ? current.from() : toOpId;
 
-            if (C1XOptions.TraceLinearScanLevel >= 2 && !TTY.isSuppressed()) {
+            if (GraalOptions.TraceLinearScanLevel >= 2 && !TTY.isSuppressed()) {
                 if (currentPosition < opId) {
                     TTY.println();
                     TTY.println("walkTo(%d) *", opId);
@@ -237,7 +237,7 @@
     private void intervalMoved(Interval interval, RegisterBinding kind, State from, State to) {
         // intervalMoved() is called whenever an interval moves from one interval list to another.
         // In the implementation of this method it is prohibited to move the interval to any list.
-        if (C1XOptions.TraceLinearScanLevel >= 4 && !TTY.isSuppressed()) {
+        if (GraalOptions.TraceLinearScanLevel >= 4 && !TTY.isSuppressed()) {
             TTY.print(from.toString() + " to " + to.toString());
             TTY.fillTo(23);
             TTY.out().println(interval.logString(allocator));
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Wed Jun 08 14:10:06 2011 +0200
@@ -54,7 +54,7 @@
  */
 public final class LinearScan {
 
-    final C1XCompilation compilation;
+    final GraalCompilation compilation;
     final IR ir;
     final LIRGenerator gen;
     final FrameMap frameMap;
@@ -119,7 +119,7 @@
      */
     BitMap2D intervalInLoop;
 
-    public LinearScan(C1XCompilation compilation, IR ir, LIRGenerator gen, FrameMap frameMap) {
+    public LinearScan(GraalCompilation compilation, IR ir, LIRGenerator gen, FrameMap frameMap) {
         this.compilation = compilation;
         this.ir = ir;
         this.gen = gen;
@@ -437,7 +437,7 @@
 
     // called once before assignment of register numbers
     void eliminateSpillMoves() {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println(" Eliminating unnecessary spill moves");
         }
 
@@ -445,7 +445,7 @@
         // the list is sorted by Interval.spillDefinitionPos
         Interval interval;
         interval = createUnhandledLists(mustStoreAtDefinition, null).first;
-        if (C1XOptions.DetailedAsserts) {
+        if (GraalOptions.DetailedAsserts) {
             checkIntervals(interval);
         }
 
@@ -474,7 +474,7 @@
 
                     if (!curInterval.location().isRegister() && curInterval.alwaysInMemory()) {
                         // move target is a stack slot that is always correct, so eliminate instruction
-                        if (C1XOptions.TraceLinearScanLevel >= 4) {
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
                             TTY.println("eliminating move from interval %d to %d", operandNumber(op1.operand()), operandNumber(op1.result()));
                         }
                         instructions.set(j, null); // null-instructions are deleted by assignRegNum
@@ -500,7 +500,7 @@
 
                         insertionBuffer.move(j, fromLocation, toLocation, null);
 
-                        if (C1XOptions.TraceLinearScanLevel >= 4) {
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
                             CiStackSlot slot = interval.spillSlot();
                             TTY.println("inserting move after definition of interval %d to stack slot %d%s at opId %d",
                                             interval.operandNumber, slot.index(), slot.inCallerFrame() ? " in caller frame" : "", opId);
@@ -533,7 +533,7 @@
             assert temp.spillDefinitionPos() >= temp.from() : "invalid order";
             assert temp.spillDefinitionPos() <= temp.from() + 2 : "only intervals defined once at their start-pos can be optimized";
 
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("interval %d (from %d to %d) must be stored at %d", temp.operandNumber, temp.from(), temp.to(), temp.spillDefinitionPos());
             }
 
@@ -615,7 +615,7 @@
                         int operandNum = operandNumber(operand);
                         if (!liveKill.get(operandNum)) {
                             liveGen.set(operandNum);
-                            if (C1XOptions.TraceLinearScanLevel >= 4) {
+                            if (GraalOptions.TraceLinearScanLevel >= 4) {
                                 TTY.println("  Setting liveGen for operand %d at instruction %d", operandNum, op.id);
                             }
                         }
@@ -624,7 +624,7 @@
                         }
                     }
 
-                    if (C1XOptions.DetailedAsserts) {
+                    if (GraalOptions.DetailedAsserts) {
                         assert operand.isVariableOrRegister() : "visitor should only return register operands";
                         verifyInput(block, liveKill, operand);
                     }
@@ -640,7 +640,7 @@
                                 int operandNum = operandNumber(operand);
                                 if (!liveKill.get(operandNum)) {
                                     liveGen.set(operandNum);
-                                    if (C1XOptions.TraceLinearScanLevel >= 4) {
+                                    if (GraalOptions.TraceLinearScanLevel >= 4) {
                                         TTY.println("  Setting liveGen for value %s, LIR opId %d, operand %d because of state for " + op.toString(), Util.valueString(value), op.id, operandNum);
                                     }
                                 }
@@ -666,7 +666,7 @@
                         }
                     }
 
-                    if (C1XOptions.DetailedAsserts) {
+                    if (GraalOptions.DetailedAsserts) {
                         assert operand.isVariableOrRegister() : "visitor should only return register operands";
                         verifyTemp(liveKill, operand);
                     }
@@ -685,7 +685,7 @@
                         }
                     }
 
-                    if (C1XOptions.DetailedAsserts) {
+                    if (GraalOptions.DetailedAsserts) {
                         assert operand.isVariableOrRegister() : "visitor should only return register operands";
                         // fixed intervals are never live at block boundaries, so
                         // they need not be processed in live sets
@@ -700,7 +700,7 @@
             block.liveIn = new CiBitMap(liveSize);
             block.liveOut = new CiBitMap(liveSize);
 
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("liveGen  B%d %s", block.blockID(), block.liveGen);
                 TTY.println("liveKill B%d %s", block.blockID(), block.liveKill);
             }
@@ -788,7 +788,7 @@
                     liveIn.setUnion(block.liveGen);
                 }
 
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     traceLiveness(changeOccurredInBlock, iterationCount, block);
                 }
             }
@@ -799,7 +799,7 @@
             }
         } while (changeOccurred);
 
-        if (C1XOptions.DetailedAsserts) {
+        if (GraalOptions.DetailedAsserts) {
             verifyLiveness(numBlocks);
         }
 
@@ -807,7 +807,7 @@
         LIRBlock startBlock = ir.startBlock;
         CiBitMap liveInArgs = new CiBitMap(startBlock.liveIn.size());
         if (!startBlock.liveIn.isSame(liveInArgs)) {
-            if (C1XOptions.DetailedAsserts) {
+            if (GraalOptions.DetailedAsserts) {
                 reportFailure(numBlocks);
             }
 
@@ -887,7 +887,7 @@
         if (!isProcessed(operand)) {
             return null;
         }
-        if (C1XOptions.TraceLinearScanLevel >= 2 && kind == null) {
+        if (GraalOptions.TraceLinearScanLevel >= 2 && kind == null) {
             TTY.println(" use %s from %d to %d (%s)", operand, from, to, registerPriority.name());
         }
 
@@ -938,7 +938,7 @@
         if (!isProcessed(operand)) {
             return;
         }
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println(" def %s defPos %d (%s)", operand, defPos, registerPriority.name());
         }
         Interval interval = intervalFor(operand);
@@ -960,7 +960,7 @@
                 // also add register priority for dead intervals
                 interval.addRange(defPos, defPos + 1);
                 interval.addUsePos(defPos, registerPriority);
-                if (C1XOptions.TraceLinearScanLevel >= 2) {
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
                     TTY.println("Warning: def of operand %s at %d occurs without use", operand, defPos);
                 }
             }
@@ -975,7 +975,7 @@
 
             interval.addRange(defPos, defPos + 1);
             interval.addUsePos(defPos, registerPriority);
-            if (C1XOptions.TraceLinearScanLevel >= 2) {
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
                 TTY.println("Warning: dead value %s at %d in live intervals", operand, defPos);
             }
         }
@@ -1099,21 +1099,21 @@
 
             if (move.operand().isStackSlot()) {
                 CiStackSlot slot = (CiStackSlot) move.operand();
-                if (C1XOptions.DetailedAsserts) {
+                if (GraalOptions.DetailedAsserts) {
                     int argSlots = compilation.method.signature().argumentSlots(!isStatic(compilation.method.accessFlags()));
                     assert slot.index() >= 0 && slot.index() < argSlots;
                     assert move.id > 0 : "invalid id";
                     assert blockForId(move.id).numberOfPreds() == 0 : "move from stack must be in first block";
                     assert move.result().isVariable() : "result of move must be a variable";
 
-                    if (C1XOptions.TraceLinearScanLevel >= 4) {
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
                         TTY.println("found move from stack slot %s to %s", slot, move.result());
                     }
                 }
 
                 Interval interval = intervalFor(move.result());
                 CiStackSlot copySlot = slot;
-                if (C1XOptions.CopyPointerStackArguments && slot.kind == CiKind.Object) {
+                if (GraalOptions.CopyPointerStackArguments && slot.kind == CiKind.Object) {
                     copySlot = allocateSpillSlot(slot.kind);
                 }
                 interval.setSpillSlot(copySlot);
@@ -1136,7 +1136,7 @@
                     Interval to = intervalFor(moveTo);
                     if (from != null && to != null) {
                         to.setLocationHint(from);
-                        if (C1XOptions.TraceLinearScanLevel >= 4) {
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
                             TTY.println("operation at opId %d: added hint from interval %d to %d", move.id, from.operandNumber, to.operandNumber);
                         }
                     }
@@ -1154,7 +1154,7 @@
                     Interval to = intervalFor(moveTo);
                     if (from != null && to != null) {
                         to.setLocationHint(from);
-                        if (C1XOptions.TraceLinearScanLevel >= 4) {
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
                             TTY.println("operation at opId %d: added hint from interval %d to %d", cmove.id, from.operandNumber, to.operandNumber);
                         }
                     }
@@ -1187,7 +1187,7 @@
             for (int operandNum = live.nextSetBit(0); operandNum >= 0; operandNum = live.nextSetBit(operandNum + 1)) {
                 assert live.get(operandNum) : "should not stop here otherwise";
                 CiValue operand = operands.operandFor(operandNum);
-                if (C1XOptions.TraceLinearScanLevel >= 2) {
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
                     TTY.println("live in %s to %d", operand, blockTo + 2);
                 }
 
@@ -1217,7 +1217,7 @@
                             addTemp(r.asValue(), opId, RegisterPriority.None, CiKind.Illegal);
                         }
                     }
-                    if (C1XOptions.TraceLinearScanLevel >= 4) {
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
                         TTY.println("operation destroys all caller-save registers");
                     }
                 }
@@ -1239,7 +1239,7 @@
                 for (k = 0; k < n; k++) {
                     CiValue operand = op.operandAt(LIRInstruction.OperandMode.Temp, k);
                     assert operand.isVariableOrRegister();
-                    if (C1XOptions.TraceLinearScanLevel >= 2) {
+                    if (GraalOptions.TraceLinearScanLevel >= 2) {
                         TTY.println(" temp %s tempPos %d (%s)", operand, opId, RegisterPriority.MustHaveRegister.name());
                     }
                     addTemp(operand, opId, RegisterPriority.MustHaveRegister, operand.kind.stackKind());
@@ -1312,7 +1312,7 @@
                 // could also consider not killing all xmm registers if we
                 // assume that slow paths are uncommon but it's not clear that
                 // would be a good idea.
-                if (C1XOptions.TraceLinearScanLevel >= 2) {
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
                     TTY.println("killing XMMs for trig");
                 }
                 int opId = op.id;
@@ -1500,7 +1500,7 @@
         Interval result = interval.getSplitChildAtOpId(opId, mode, this);
 
         if (result != null) {
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("Split child at pos " + opId + " of interval " + interval.toString() + " is " + result.toString());
             }
             return result;
@@ -1554,7 +1554,7 @@
 
     void resolveFindInsertPos(LIRBlock fromBlock, LIRBlock toBlock, MoveResolver moveResolver) {
         if (fromBlock.numberOfSux() <= 1) {
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("inserting moves at end of fromBlock B%d", fromBlock.blockID());
             }
 
@@ -1570,11 +1570,11 @@
             }
 
         } else {
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("inserting moves at beginning of toBlock B%d", toBlock.blockID());
             }
 
-            if (C1XOptions.DetailedAsserts) {
+            if (GraalOptions.DetailedAsserts) {
                 assert fromBlock.lir().instructionsList().get(0) instanceof LIRLabel : "block does not start with a label";
 
                 // because the number of predecessor edges matches the number of
@@ -1618,7 +1618,7 @@
 
                     // prevent optimization of two consecutive blocks
                     if (!blockCompleted.get(pred.linearScanNumber()) && !blockCompleted.get(sux.linearScanNumber())) {
-                        if (C1XOptions.TraceLinearScanLevel >= 3) {
+                        if (GraalOptions.TraceLinearScanLevel >= 3) {
                             TTY.println(" optimizing empty block B%d (pred: B%d, sux: B%d)", block.blockID(), pred.blockID(), sux.blockID());
                         }
                         blockCompleted.set(block.linearScanNumber());
@@ -1645,7 +1645,7 @@
 
                     // check for duplicate edges between the same blocks (can happen with switch blocks)
                     if (!alreadyResolved.get(toBlock.linearScanNumber())) {
-                        if (C1XOptions.TraceLinearScanLevel >= 3) {
+                        if (GraalOptions.TraceLinearScanLevel >= 3) {
                             TTY.println(" processing edge between B%d and B%d", fromBlock.blockID(), toBlock.blockID());
                         }
                         alreadyResolved.set(toBlock.linearScanNumber());
@@ -1727,7 +1727,7 @@
         assert interval != null : "interval must exist";
 
         if (opId != -1) {
-            if (C1XOptions.DetailedAsserts) {
+            if (GraalOptions.DetailedAsserts) {
                 LIRBlock block = blockForId(opId);
                 if (block.numberOfSux() <= 1 && opId == block.lastLirInstructionId()) {
                     // check if spill moves could have been appended at the end of this block, but
@@ -1769,7 +1769,7 @@
     }
 
     void computeOopMap(IntervalWalker iw, LIRInstruction op, LIRDebugInfo info, boolean isCallSite, CiBitMap frameRefMap, CiBitMap regRefMap) {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("creating oop map at opId %d", op.id);
         }
 
@@ -1940,14 +1940,14 @@
                 CiFrame frame = compilation.placeholderState != null ? null : computeFrame(info.state, op.id, frameRefMap);
                 computeOopMap(iw, op, info, frameRefMap, regRefMap);
                 info.debugInfo = new CiDebugInfo(frame, regRefMap, frameRefMap);
-            } else if (C1XOptions.DetailedAsserts) {
+            } else if (GraalOptions.DetailedAsserts) {
                 assert info.debugInfo.frame().equals(computeFrame(info.state, op.id, new CiBitMap(info.debugInfo.frameRefMap.size())));
             }
         }
     }
 
     CiFrame computeFrame(FrameState state, int opId, CiBitMap frameRefMap) {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("creating debug information at opId %d", opId);
         }
         return computeFrameForState(state, opId, frameRefMap);
@@ -2019,8 +2019,8 @@
     }
 
     public void allocate() {
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.LIFETIME_ANALYSIS.start();
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.LIFETIME_ANALYSIS.start();
         }
 
         numberInstructions();
@@ -2033,28 +2033,28 @@
         buildIntervals();
         sortIntervalsBeforeAllocation();
 
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.LIFETIME_ANALYSIS.stop();
-            C1XTimers.LINEAR_SCAN.start();
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.LIFETIME_ANALYSIS.stop();
+            GraalTimers.LINEAR_SCAN.start();
         }
 
         printIntervals("Before register allocation");
 
         allocateRegisters();
 
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.LINEAR_SCAN.stop();
-            C1XTimers.RESOLUTION.start();
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.LINEAR_SCAN.stop();
+            GraalTimers.RESOLUTION.start();
         }
 
         resolveDataFlow();
 
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.RESOLUTION.stop();
-            C1XTimers.DEBUG_INFO.start();
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.RESOLUTION.stop();
+            GraalTimers.DEBUG_INFO.start();
         }
 
-        C1XMetrics.LSRASpills += (maxSpills - frameMap.initialSpillSlot());
+        GraalMetrics.LSRASpills += (maxSpills - frameMap.initialSpillSlot());
 
         // fill in number of spill slots into frameMap
         frameMap.finalizeFrame(maxSpills);
@@ -2064,20 +2064,20 @@
 
         sortIntervalsAfterAllocation();
 
-        if (C1XOptions.DetailedAsserts) {
+        if (GraalOptions.DetailedAsserts) {
             verify();
         }
 
         eliminateSpillMoves();
         assignLocations();
 
-        if (C1XOptions.DetailedAsserts) {
+        if (GraalOptions.DetailedAsserts) {
             verifyIntervals();
         }
 
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.DEBUG_INFO.stop();
-            C1XTimers.CODE_CREATE.start();
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.DEBUG_INFO.stop();
+            GraalTimers.CODE_CREATE.start();
         }
 
         printLir("After register number assignment", true);
@@ -2087,7 +2087,7 @@
     }
 
     void printIntervals(String label) {
-        if (C1XOptions.TraceLinearScanLevel >= 1) {
+        if (GraalOptions.TraceLinearScanLevel >= 1) {
             int i;
             TTY.println();
             TTY.println(label);
@@ -2114,7 +2114,7 @@
     }
 
     void printLir(String label, boolean hirValid) {
-        if (C1XOptions.TraceLinearScanLevel >= 1 && !TTY.isSuppressed()) {
+        if (GraalOptions.TraceLinearScanLevel >= 1 && !TTY.isSuppressed()) {
             TTY.println();
             TTY.println(label);
             LIRList.printLIR(ir.linearScanOrder());
@@ -2128,27 +2128,27 @@
 
     boolean verify() {
         // (check that all intervals have a correct register and that no registers are overwritten)
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println(" verifying intervals *");
         }
         verifyIntervals();
 
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println(" verifying that no oops are in fixed intervals *");
         }
         //verifyNoOopsInFixedIntervals();
 
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println(" verifying that unpinned constants are not alive across block boundaries");
         }
         verifyConstants();
 
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println(" verifying register allocation *");
         }
         verifyRegisters();
 
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println(" no errors found *");
         }
 
@@ -2226,7 +2226,7 @@
                 CiValue l1 = i1.location();
                 CiValue l2 = i2.location();
                 if (i1.intersects(i2) && (l1.equals(l2))) {
-                    if (C1XOptions.DetailedAsserts) {
+                    if (GraalOptions.DetailedAsserts) {
                         TTY.println("Intervals %d and %d overlap and have the same register assigned", i1.operandNumber, i2.operandNumber);
                         TTY.println(i1.logString(this));
                         TTY.println(i2.logString(this));
@@ -2298,7 +2298,7 @@
 
             // visit all operands where the liveAtEdge bit is set
             for (int operandNum = liveAtEdge.nextSetBit(0); operandNum >= 0; operandNum = liveAtEdge.nextSetBit(operandNum + 1)) {
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("checking interval %d of block B%d", operandNum, block.blockID());
                 }
                 CiValue operand = operands.operandFor(operandNum);
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScanWalker.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScanWalker.java	Wed Jun 08 14:10:06 2011 +0200
@@ -282,7 +282,7 @@
         int optimalSplitPos = -1;
         if (minSplitPos == maxSplitPos) {
             // trivial case, no optimization of split position possible
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("      min-pos and max-pos are equal, no optimization possible");
             }
             optimalSplitPos = minSplitPos;
@@ -305,7 +305,7 @@
             assert minBlock.linearScanNumber() <= maxBlock.linearScanNumber() : "invalid order";
             if (minBlock == maxBlock) {
                 // split position cannot be moved to block boundary : so split as late as possible
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("      cannot move split pos to block boundary because minPos and maxPos are in same block");
                 }
                 optimalSplitPos = maxSplitPos;
@@ -316,14 +316,14 @@
                     // Intervals resulting from Phi-Functions have more than one definition (marked
                     // as mustHaveRegister) with a hole before each definition. When the register is needed
                     // for the second definition : an earlier reloading is unnecessary.
-                    if (C1XOptions.TraceLinearScanLevel >= 4) {
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
                         TTY.println("      interval has hole just before maxSplitPos, so splitting at maxSplitPos");
                     }
                     optimalSplitPos = maxSplitPos;
 
                 } else {
                     // seach optimal block boundary between minSplitPos and maxSplitPos
-                    if (C1XOptions.TraceLinearScanLevel >= 4) {
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
                         TTY.println("      moving split pos to optimal block boundary between block B%d and B%d", minBlock.blockID(), maxBlock.blockID());
                     }
 
@@ -331,7 +331,7 @@
                         // Loop optimization: if a loop-end marker is found between min- and max-position :
                         // then split before this loop
                         int loopEndPos = interval.nextUsageExact(RegisterPriority.LiveAtLoopEnd, minBlock.lastLirInstructionId() + 2);
-                        if (C1XOptions.TraceLinearScanLevel >= 4) {
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
                             TTY.println("      loop optimization: loop end found at pos %d", loopEndPos);
                         }
 
@@ -344,7 +344,7 @@
                             // of the interval (normally, only mustHaveRegister causes a reloading)
                             LIRBlock loopBlock = allocator.blockForId(loopEndPos);
 
-                            if (C1XOptions.TraceLinearScanLevel >= 4) {
+                            if (GraalOptions.TraceLinearScanLevel >= 4) {
                                 TTY.println("      interval is used in loop that ends in block B%d, so trying to move maxBlock back from B%d to B%d", loopBlock.blockID(), maxBlock.blockID(), loopBlock.blockID());
                             }
                             assert loopBlock != minBlock : "loopBlock and minBlock must be different because block boundary is needed between";
@@ -352,11 +352,11 @@
                             optimalSplitPos = findOptimalSplitPos(minBlock, loopBlock, loopBlock.lastLirInstructionId() + 2);
                             if (optimalSplitPos == loopBlock.lastLirInstructionId() + 2) {
                                 optimalSplitPos = -1;
-                                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                                if (GraalOptions.TraceLinearScanLevel >= 4) {
                                     TTY.println("      loop optimization not necessary");
                                 }
                             } else {
-                                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                                if (GraalOptions.TraceLinearScanLevel >= 4) {
                                     TTY.println("      loop optimization successful");
                                 }
                             }
@@ -370,7 +370,7 @@
                 }
             }
         }
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("      optimal split position: %d", optimalSplitPos);
         }
 
@@ -382,13 +382,13 @@
     // 1) the left part has already a location assigned
     // 2) the right part is sorted into to the unhandled-list
     void splitBeforeUsage(Interval interval, int minSplitPos, int maxSplitPos) {
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("----- splitting interval: ");
         }
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println(interval.logString(allocator));
         }
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("      between %d and %d", minSplitPos, maxSplitPos);
         }
 
@@ -406,7 +406,7 @@
         if (optimalSplitPos == interval.to() && interval.nextUsage(RegisterPriority.MustHaveRegister, minSplitPos) == Integer.MAX_VALUE) {
             // the split position would be just before the end of the interval
             // . no split at all necessary
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("      no split necessary because optimal split position is at end of interval");
             }
             return;
@@ -420,7 +420,7 @@
             optimalSplitPos = (optimalSplitPos - 1) | 1;
         }
 
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("      splitting at position %d", optimalSplitPos);
         }
         assert allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 1) : "split pos must be odd when not on block boundary";
@@ -434,10 +434,10 @@
         assert splitPart.from() >= current.currentFrom() : "cannot append new interval before current walk position";
         unhandledLists.addToListSortedByStartAndUsePositions(RegisterBinding.Any, splitPart);
 
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("      split interval in two parts (insertMoveWhenActivated: %b)", moveNecessary);
         }
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.print("      ");
             TTY.println(interval.logString(allocator));
             TTY.print("      ");
@@ -455,7 +455,7 @@
         int maxSplitPos = currentPosition;
         int minSplitPos = Math.max(interval.previousUsage(RegisterPriority.ShouldHaveRegister, maxSplitPos) + 1, interval.from());
 
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.print("----- splitting and spilling interval: ");
             TTY.println(interval.logString(allocator));
             TTY.println("      between %d and %d", minSplitPos, maxSplitPos);
@@ -469,7 +469,7 @@
 
         if (minSplitPos == interval.from()) {
             // the whole interval is never used, so spill it entirely to memory
-            if (C1XOptions.TraceLinearScanLevel >= 2) {
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
                 TTY.println("      spilling entire interval because split pos is at beginning of interval");
                 TTY.println("      use positions: " + interval.usePosList().size());
             }
@@ -488,7 +488,7 @@
                 if (parent.location().isRegister()) {
                     if (parent.firstUsage(RegisterPriority.ShouldHaveRegister) == Integer.MAX_VALUE) {
                         // parent is never used, so kick it out of its assigned register
-                        if (C1XOptions.TraceLinearScanLevel >= 4) {
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
                             TTY.println("      kicking out interval %d out of its register because it is never used", parent.operandNumber);
                         }
                         allocator.assignSpillSlot(parent);
@@ -512,7 +512,7 @@
                 optimalSplitPos = (optimalSplitPos - 1) | 1;
             }
 
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("      splitting at position %d", optimalSplitPos);
             }
             assert allocator.isBlockBegin(optimalSplitPos) || (optimalSplitPos % 2 == 1) : "split pos must be odd when not on block boundary";
@@ -523,7 +523,7 @@
             allocator.changeSpillState(spilledPart, optimalSplitPos);
 
             if (!allocator.isBlockBegin(optimalSplitPos)) {
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("      inserting move from interval %d to %d", interval.operandNumber, spilledPart.operandNumber);
                 }
                 insertMove(optimalSplitPos, interval, spilledPart);
@@ -533,7 +533,7 @@
             assert spilledPart.currentSplitChild() == interval : "overwriting wrong currentSplitChild";
             spilledPart.makeCurrentSplitChild();
 
-            if (C1XOptions.TraceLinearScanLevel >= 2) {
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
                 TTY.println("      split interval in two parts");
                 TTY.print("      ");
                 TTY.println(interval.logString(allocator));
@@ -582,7 +582,7 @@
     }
 
     boolean allocFreeRegister(Interval interval) {
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("trying to find free register for " + interval.logString(allocator));
         }
 
@@ -597,7 +597,7 @@
         // usePos contains the start of the next interval that has this register assigned
         // (either as a fixed register or a normal allocated register in the past)
         // only intervals overlapping with cur are processed, non-overlapping invervals can be ignored safely
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("      state of registers:");
             for (CiRegister register : availableRegs) {
                 int i = register.number;
@@ -609,7 +609,7 @@
         Interval locationHint = interval.locationHint(true, allocator);
         if (locationHint != null && locationHint.location() != null && locationHint.location().isRegister()) {
             hint = locationHint.location().asRegister();
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("      hint register %d from interval %s", hint.number, locationHint.logString(allocator));
             }
         }
@@ -653,7 +653,7 @@
 
         splitPos = usePos[reg.number];
         interval.assignLocation(reg.asValue(interval.kind()));
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("selected register %d", reg.number);
         }
 
@@ -705,7 +705,7 @@
 
     // Split an Interval and spill it to memory so that cur can be placed in a register
     void allocLockedRegister(Interval interval) {
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("need to split and spill to get register for " + interval.logString(allocator));
         }
 
@@ -718,7 +718,7 @@
         spillCollectActiveAny();
         spillCollectInactiveAny(interval);
 
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("      state of registers:");
             for (CiRegister reg : availableRegs) {
                 int i = reg.number;
@@ -751,7 +751,7 @@
 
         if (reg == null || usePos[reg.number] <= firstUsage) {
             // the first use of cur is later than the spilling position -> spill cur
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("able to spill current interval. firstUsage(register): %d, usePos: %d", firstUsage, reg == null ? 0 : usePos[reg.number]);
             }
 
@@ -770,7 +770,7 @@
 
         int splitPos = blockPos[reg.number];
 
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("decided to use register %d", reg.number);
         }
         assert splitPos > 0 : "invalid splitPos";
@@ -799,7 +799,7 @@
             if (isOdd(pos)) {
                 // the current instruction is a call that blocks all registers
                 if (pos < allocator.maxOpId() && allocator.hasCall(pos + 1) && interval.to() > pos + 1) {
-                    if (C1XOptions.TraceLinearScanLevel >= 4) {
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
                         TTY.println("      free register cannot be available because all registers blocked by following call");
                     }
 
@@ -900,11 +900,11 @@
         Interval interval = current;
         boolean result = true;
 
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("+++++ activating interval " + interval.logString(allocator));
         }
 
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("      splitParent: %s, insertMoveWhenActivated: %b", interval.splitParent().operandNumber, interval.insertMoveWhenActivated());
         }
 
@@ -912,7 +912,7 @@
         if (interval.location() != null && interval.location().isStackSlot()) {
             // activating an interval that has a stack slot assigned . split it at first use position
             // used for method parameters
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("      interval has spill slot assigned (method parameter) . split it before first use");
             }
             splitStackInterval(interval);
@@ -926,7 +926,7 @@
                 if (!allocator.operands.mustStayInMemory((CiVariable) operand)) {
                     // activating an interval that must start in a stack slot but may get a register later
                     // used for lirRoundfp: rounding is done by store to stack and reload later
-                    if (C1XOptions.TraceLinearScanLevel >= 4) {
+                    if (GraalOptions.TraceLinearScanLevel >= 4) {
                         TTY.println("      interval must start in stack slot . split it before first use");
                     }
                     splitStackInterval(interval);
@@ -936,7 +936,7 @@
             } else if (interval.location() == null) {
                 // interval has not assigned register . normal allocation
                 // (this is the normal case for most intervals)
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("      normal allocation of register");
                 }
 
@@ -962,7 +962,7 @@
             assert interval.isSplitChild();
             assert interval.currentSplitChild() != null;
             assert interval.currentSplitChild().operand != operand : "cannot insert move between same interval";
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("Inserting move from interval %d to %d because insertMoveWhenActivated is set", interval.currentSplitChild().operandNumber, interval.operandNumber);
             }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java	Wed Jun 08 14:10:06 2011 +0200
@@ -204,7 +204,7 @@
 
         insertionBuffer.move(insertIdx, fromOpr, toOpr, null);
 
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("MoveResolver: inserted move from %d (%s) to %d (%s)", fromInterval.operandNumber, fromInterval.location(), toInterval.operandNumber, toInterval.location());
         }
     }
@@ -217,13 +217,12 @@
         CiValue toOpr = toInterval.operand;
         insertionBuffer.move(insertIdx, fromOpr, toOpr, null);
 
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.print("MoveResolver: inserted move from constant %s to %d (%s)", fromOpr, toInterval.operandNumber, toInterval.location());
         }
     }
 
     private void resolveMappings() {
-        //if (C1XOptions.TraceLinearScanLevel >= 4) TTY.println("MoveResolver: resolving mappings for Block B%d, index %d", insertList.block() != null ? insertList.block().blockID : -1, insertIdx);
         assert verifyBeforeResolve();
 
         // Block all registers that are used as input operands of a move.
@@ -289,7 +288,7 @@
                 }
                 spillInterval.assignLocation(spillSlot);
 
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("created new Interval %s for spilling", spillInterval.operand);
                 }
 
@@ -308,7 +307,6 @@
     }
 
     void setInsertPosition(LIRList insertList, int insertIdx) {
-        //if (C1XOptions.TraceLinearScanLevel >= 4) TTY.println("MoveResolver: setting insert position to Block B%d, index %d", insertList.block() != null ? insertList.block().blockID : -1, insertIdx);
         assert this.insertList == null && this.insertIdx == -1 : "use moveInsertPosition instead of setInsertPosition when data already set";
 
         createInsertionBuffer(insertList);
@@ -317,8 +315,6 @@
     }
 
     void moveInsertPosition(LIRList insertList, int insertIdx) {
-        //if (C1XOptions.TraceLinearScanLevel >= 4) TTY.println("MoveResolver: moving insert position to Block B%d, index %d", (insertList != null && insertList.block() != null) ? insertList.block().blockID : -1, insertIdx);
-
         if (this.insertList != null && (this.insertList != insertList || this.insertIdx != insertIdx)) {
             // insert position changed . resolve current mappings
             resolveMappings();
@@ -336,7 +332,7 @@
     }
 
     void addMapping(Interval fromInterval, Interval toInterval) {
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("MoveResolver: adding mapping from interval %d (%s) to interval %d (%s)", fromInterval.operandNumber, fromInterval.location(), toInterval.operandNumber, toInterval.location());
         }
 
@@ -348,7 +344,7 @@
     }
 
     void addMapping(CiValue fromOpr, Interval toInterval) {
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("MoveResolver: adding mapping from %s to %d (%s)", fromOpr, toInterval.operandNumber, toInterval.location());
         }
         assert fromOpr.isConstant() : "only for constants";
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/OperandPool.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/OperandPool.java	Wed Jun 08 14:10:06 2011 +0200
@@ -59,7 +59,7 @@
 
     /**
      * Map from a {@linkplain CiVariable#index variable index} to the instruction whose result is stored in the denoted variable.
-     * This map is only populated and used if {@link C1XOptions#DetailedAsserts} is {@code true}.
+     * This map is only populated and used if {@link GraalOptions#DetailedAsserts} is {@code true}.
      */
     private final ArrayList<Value> variableDefs;
 
@@ -137,7 +137,7 @@
         this.firstVariableNumber = registers.length;
         this.registers = registers;
         variables = new ArrayList<CiVariable>(INITIAL_VARIABLE_CAPACITY);
-        variableDefs = C1XOptions.DetailedAsserts ? new ArrayList<Value>(INITIAL_VARIABLE_CAPACITY) : null;
+        variableDefs = GraalOptions.DetailedAsserts ? new ArrayList<Value>(INITIAL_VARIABLE_CAPACITY) : null;
     }
 
     /**
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Wed Jun 08 14:10:06 2011 +0200
@@ -41,7 +41,7 @@
     ArrayMap<Interval[]> savedStates; // saved information of previous check
 
     // simplified access to methods of LinearScan
-    C1XCompilation compilation() {
+    GraalCompilation compilation() {
         return allocator.compilation;
     }
 
@@ -102,7 +102,7 @@
     }
 
     private void processBlock(LIRBlock block) {
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println();
             TTY.println("processBlock B%d", block.blockID());
         }
@@ -110,7 +110,7 @@
         // must copy state because it is modified
         Interval[] inputState = copy(stateForBlock(block));
 
-        if (C1XOptions.TraceLinearScanLevel >= 4) {
+        if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("Input-State of intervals:");
             TTY.print("    ");
             for (int i = 0; i < stateSize(); i++) {
@@ -152,7 +152,7 @@
                         savedStateCorrect = false;
                         savedState[i] = null;
 
-                        if (C1XOptions.TraceLinearScanLevel >= 4) {
+                        if (GraalOptions.TraceLinearScanLevel >= 4) {
                             TTY.println("processSuccessor B%d: invalidating slot %d", block.blockID(), i);
                         }
                     }
@@ -161,12 +161,12 @@
 
             if (savedStateCorrect) {
                 // already processed block with correct inputState
-                if (C1XOptions.TraceLinearScanLevel >= 2) {
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
                     TTY.println("processSuccessor B%d: previous visit already correct", block.blockID());
                 }
             } else {
                 // must re-visit this block
-                if (C1XOptions.TraceLinearScanLevel >= 2) {
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
                     TTY.println("processSuccessor B%d: must re-visit because input state changed", block.blockID());
                 }
                 addToWorkList(block);
@@ -174,7 +174,7 @@
 
         } else {
             // block was not processed before, so set initial inputState
-            if (C1XOptions.TraceLinearScanLevel >= 2) {
+            if (GraalOptions.TraceLinearScanLevel >= 2) {
                 TTY.println("processSuccessor B%d: initial visit", block.blockID());
             }
 
@@ -192,11 +192,11 @@
             CiRegister reg = location.asRegister();
             int regNum = reg.number;
             if (interval != null) {
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("        %s = %s", reg, interval.operand);
                 }
             } else if (inputState[regNum] != null) {
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("        %s = null", reg);
                 }
             }
@@ -219,7 +219,7 @@
         for (int i = 0; i < ops.length(); i++) {
             LIRInstruction op = ops.at(i);
 
-            if (C1XOptions.TraceLinearScanLevel >= 4) {
+            if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println(op.toStringWithIdPrefix());
             }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java	Wed Jun 08 14:10:06 2011 +0200
@@ -68,26 +68,26 @@
             }
         }
 
-        if (C1XOptions.PrintMetrics) {
-            C1XMetrics.TargetMethods++;
-            C1XMetrics.CodeBytesEmitted += targetMethod.targetCodeSize();
-            C1XMetrics.SafepointsEmitted += targetMethod.safepoints.size();
-            C1XMetrics.DirectCallSitesEmitted += targetMethod.directCalls.size();
-            C1XMetrics.IndirectCallSitesEmitted += targetMethod.indirectCalls.size();
-            C1XMetrics.DataPatches += targetMethod.dataReferences.size();
-            C1XMetrics.ExceptionHandlersEmitted += targetMethod.exceptionHandlers.size();
+        if (GraalOptions.PrintMetrics) {
+            GraalMetrics.TargetMethods++;
+            GraalMetrics.CodeBytesEmitted += targetMethod.targetCodeSize();
+            GraalMetrics.SafepointsEmitted += targetMethod.safepoints.size();
+            GraalMetrics.DirectCallSitesEmitted += targetMethod.directCalls.size();
+            GraalMetrics.IndirectCallSitesEmitted += targetMethod.indirectCalls.size();
+            GraalMetrics.DataPatches += targetMethod.dataReferences.size();
+            GraalMetrics.ExceptionHandlersEmitted += targetMethod.exceptionHandlers.size();
         }
 
-        if (C1XOptions.PrintAssembly && !TTY.isSuppressed() && !isStub) {
+        if (GraalOptions.PrintAssembly && !TTY.isSuppressed() && !isStub) {
             Util.printSection("Target Method", Util.SECTION_CHARACTER);
             TTY.println("Name: " + name);
             TTY.println("Frame size: " + targetMethod.frameSize());
             TTY.println("Register size: " + asm.target.arch.registerReferenceMapBitCount);
 
-            if (C1XOptions.PrintCodeBytes) {
+            if (GraalOptions.PrintCodeBytes) {
                 Util.printSection("Code", Util.SUB_SECTION_CHARACTER);
                 TTY.println("Code: %d bytes", targetMethod.targetCodeSize());
-                Util.printBytes(0L, targetMethod.targetCode(), 0, targetMethod.targetCodeSize(), C1XOptions.PrintAssemblyBytesPerLine);
+                Util.printBytes(0L, targetMethod.targetCode(), 0, targetMethod.targetCodeSize(), GraalOptions.PrintAssemblyBytesPerLine);
             }
 
             Util.printSection("Disassembly", Util.SUB_SECTION_CHARACTER);
@@ -186,7 +186,7 @@
 
         int pos = asm.codeBuffer.position();
 
-        if (C1XOptions.TraceRelocation) {
+        if (GraalOptions.TraceRelocation) {
             TTY.print("Data reference in code: pos = %d, data = %s", pos, data.toString());
         }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java	Wed Jun 08 14:10:06 2011 +0200
@@ -41,7 +41,7 @@
 import com.sun.cri.ri.*;
 
 /**
- * Utility for printing the control flow graph of a method being compiled by C1X at various compilation phases.
+ * Utility for printing the control flow graph of a method being compiled by Graal at various compilation phases.
  * The output format matches that produced by HotSpot so that it can then be fed to the
  * <a href="https://c1visualizer.dev.java.net/">C1 Visualizer</a>.
  */
@@ -183,7 +183,7 @@
         if (stackSize > 0) {
             begin("stack");
             out.print("size ").println(stackSize);
-            out.print("method \"").print(CiUtil.toLocation(C1XCompilation.compilation().method, state.bci)).println('"');
+            out.print("method \"").print(CiUtil.toLocation(GraalCompilation.compilation().method, state.bci)).println('"');
 
             int i = 0;
             while (i < stackSize) {
@@ -205,7 +205,7 @@
         if (state.locksSize() > 0) {
             begin("locks");
             out.print("size ").println(state.locksSize());
-            out.print("method \"").print(CiUtil.toLocation(C1XCompilation.compilation().method, state.bci)).println('"');
+            out.print("method \"").print(CiUtil.toLocation(GraalCompilation.compilation().method, state.bci)).println('"');
 
             for (int i = 0; i < state.locksSize(); ++i) {
                 Value value = state.lockAt(i);
@@ -220,7 +220,7 @@
 
         begin("locals");
         out.print("size ").println(state.localsSize());
-        out.print("method \"").print(CiUtil.toLocation(C1XCompilation.compilation().method, state.bci)).println('"');
+        out.print("method \"").print(CiUtil.toLocation(GraalCompilation.compilation().method, state.bci)).println('"');
         int i = 0;
         while (i < state.localsSize()) {
             Value value = state.localAt(i);
@@ -249,7 +249,7 @@
         }
 
         StringBuilder buf = new StringBuilder();
-        buf.append(CiUtil.toLocation(C1XCompilation.compilation().method, state.bci));
+        buf.append(CiUtil.toLocation(GraalCompilation.compilation().method, state.bci));
         buf.append('\n');
         if (state.stackSize() > 0) {
             int i = 0;
@@ -320,7 +320,7 @@
 
         if (info.hasRegisterRefMap()) {
             sb.append("reg-ref-map:");
-            C1XCompilation compilation = C1XCompilation.compilation();
+            GraalCompilation compilation = GraalCompilation.compilation();
             CiArchitecture arch = compilation == null ? null : compilation.target.arch;
             for (int reg = info.registerRefMap.nextSetBit(0); reg >= 0; reg = info.registerRefMap.nextSetBit(reg + 1)) {
                 sb.append(' ').append(arch == null ? "reg" + reg : arch.registers[reg]);
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinterObserver.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinterObserver.java	Wed Jun 08 14:10:06 2011 +0200
@@ -36,7 +36,7 @@
  */
 public class CFGPrinterObserver implements CompilationObserver {
 
-    private C1XCompilation currentCompilation;
+    private GraalCompilation currentCompilation;
     private CFGPrinter cfgPrinter;
     private ByteArrayOutputStream buffer = null;
     private final OutputStream stream;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/GraphvizPrinterObserver.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/GraphvizPrinterObserver.java	Wed Jun 08 14:10:06 2011 +0200
@@ -95,7 +95,7 @@
 
     private static void printGraph(Graph graph, String name, OutputStream buffer) {
         GraphvizPrinter printer = new GraphvizPrinter(buffer);
-        if (C1XOptions.OmitDOTFrameStates) {
+        if (GraalOptions.OmitDOTFrameStates) {
             printer.addOmittedClass(FrameState.class);
         }
         printer.addClassColor(StartNode.class, "snow3");
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinterObserver.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinterObserver.java	Wed Jun 08 14:10:06 2011 +0200
@@ -87,7 +87,7 @@
         try {
             stream = new FileOutputStream(filename);
             printer = new IdealGraphPrinter(stream);
-            if (C1XOptions.OmitDOTFrameStates) {
+            if (GraalOptions.OmitDOTFrameStates) {
                 printer.addOmittedClass(FrameState.class);
             }
             printer.begin();
@@ -110,7 +110,7 @@
             }
 
             printer = new IdealGraphPrinter(stream);
-            if (C1XOptions.OmitDOTFrameStates) {
+            if (GraalOptions.OmitDOTFrameStates) {
                 printer.addOmittedClass(FrameState.class);
             }
             printer.begin();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/TTY.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/TTY.java	Wed Jun 08 14:10:06 2011 +0200
@@ -84,12 +84,12 @@
         }
     }
 
-    public static final String C1X_TTY_LOG_FILE_PROPERTY = "c1x.tty.file";
+    public static final String GRAAL_TTY_LOG_FILE_PROPERTY = "graal.tty.file";
 
     private static final LogStream log;
     static {
         PrintStream out = System.out;
-        String value = System.getProperty(C1X_TTY_LOG_FILE_PROPERTY);
+        String value = System.getProperty(GRAAL_TTY_LOG_FILE_PROPERTY);
         if (value != null) {
             try {
                 out = new PrintStream(new FileOutputStream(value));
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/package-info.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/package-info.java	Wed Jun 08 14:10:06 2011 +0200
@@ -21,6 +21,6 @@
  * questions.
  */
 /**
- * A collection of debugging aids for C1X development.
+ * A collection of debugging aids for Graal development.
  */
 package com.oracle.max.graal.compiler.debug;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Wed Jun 08 14:10:06 2011 +0200
@@ -159,7 +159,7 @@
         }
     }
 
-    protected final C1XCompilation compilation;
+    protected final GraalCompilation compilation;
     protected final IR ir;
     protected final XirSupport xirSupport;
     protected final RiXirGenerator xir;
@@ -179,7 +179,7 @@
     private ArrayList<DeoptimizationStub> deoptimizationStubs;
     private FrameState lastState;
 
-    public LIRGenerator(C1XCompilation compilation) {
+    public LIRGenerator(GraalCompilation compilation) {
         this.compilation = compilation;
         this.ir = compilation.hir();
         this.xir = compilation.compiler.xir;
@@ -217,7 +217,7 @@
         blockDoProlog(block);
         this.currentBlock = block;
 
-        if (C1XOptions.TraceLIRGeneratorLevel >= 1) {
+        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
             TTY.println("BEGIN Generating LIR for block B" + block.blockID());
         }
 
@@ -236,9 +236,9 @@
             }
             if (stateBefore != null) {
                 lastState = stateBefore;
-                if (C1XOptions.TraceLIRGeneratorLevel >= 2) {
+                if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
                     TTY.println("STATE CHANGE (stateBefore)");
-                    if (C1XOptions.TraceLIRGeneratorLevel >= 3) {
+                    if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
                         TTY.println(stateBefore.toString());
                     }
                 }
@@ -249,9 +249,9 @@
             }
             if (stateAfter != null) {
                 lastState = stateAfter;
-                if (C1XOptions.TraceLIRGeneratorLevel >= 2) {
+                if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
                     TTY.println("STATE CHANGE");
-                    if (C1XOptions.TraceLIRGeneratorLevel >= 3) {
+                    if (GraalOptions.TraceLIRGeneratorLevel >= 3) {
                         TTY.println(stateAfter.toString());
                     }
                 }
@@ -262,7 +262,7 @@
             block.lir().jump(block.blockSuccessors().get(0));
         }
 
-        if (C1XOptions.TraceLIRGeneratorLevel >= 1) {
+        if (GraalOptions.TraceLIRGeneratorLevel >= 1) {
             TTY.println("END Generating LIR for block B" + block.blockID());
         }
 
@@ -499,7 +499,7 @@
         CiValue destinationAddress = null;
         // emitting the template earlier can ease pressure on register allocation, but the argument loading can destroy an
         // implicit calling convention between the XirSnippet and the call.
-        if (!C1XOptions.InvokeSnippetAfterArguments) {
+        if (!GraalOptions.InvokeSnippetAfterArguments) {
             destinationAddress = emitXir(snippet, x, info.copy(), x.target(), false);
         }
 
@@ -508,7 +508,7 @@
         List<CiValue> pointerSlots = new ArrayList<CiValue>(2);
         List<CiValue> argList = visitInvokeArguments(cc, x, pointerSlots);
 
-        if (C1XOptions.InvokeSnippetAfterArguments) {
+        if (GraalOptions.InvokeSnippetAfterArguments) {
             destinationAddress = emitXir(snippet, x, info.copy(), null, x.target(), false, pointerSlots);
         }
 
@@ -590,7 +590,7 @@
         CiValue tag = load(x.value());
         setNoResult(x);
 
-        if (x.numberOfCases() == 0 || x.numberOfCases() < C1XOptions.SequentialSwitchLimit) {
+        if (x.numberOfCases() == 0 || x.numberOfCases() < GraalOptions.SequentialSwitchLimit) {
             int len = x.numberOfCases();
             for (int i = 0; i < len; i++) {
                 lir.cmp(Condition.EQ, tag, x.keyAt(i));
@@ -702,7 +702,7 @@
     }
 
     protected CiValue emitXir(XirSnippet snippet, Value instruction, LIRDebugInfo info, LIRDebugInfo infoAfter, RiMethod method, boolean setInstructionResult, List<CiValue> pointerSlots) {
-        if (C1XOptions.PrintXirTemplates) {
+        if (GraalOptions.PrintXirTemplates) {
             TTY.println("Emit XIR template " + snippet.template.name);
         }
 
@@ -725,7 +725,7 @@
                 assert operands[resultOperand.index] == null;
             }
             operands[resultOperand.index] = outputOperand;
-            if (C1XOptions.PrintXirTemplates) {
+            if (GraalOptions.PrintXirTemplates) {
                 TTY.println("Output operand: " + outputOperand);
             }
         }
@@ -761,7 +761,7 @@
             operands[x.index] = op;
             operandArray[i] = op;
             operandIndicesArray[i] = x.index;
-            if (C1XOptions.PrintXirTemplates) {
+            if (GraalOptions.PrintXirTemplates) {
                 TTY.println("Input operand: " + x);
             }
         }
@@ -774,7 +774,7 @@
             operands[x.index] = newOp;
             operandArray[i + inputOperands.length] = newOp;
             operandIndicesArray[i + inputOperands.length] = x.index;
-            if (C1XOptions.PrintXirTemplates) {
+            if (GraalOptions.PrintXirTemplates) {
                 TTY.println("InputTemp operand: " + x);
             }
         }
@@ -785,7 +785,7 @@
             operands[x.index] = op;
             operandArray[i + inputOperands.length + inputTempOperands.length] = op;
             operandIndicesArray[i + inputOperands.length + inputTempOperands.length] = x.index;
-            if (C1XOptions.PrintXirTemplates) {
+            if (GraalOptions.PrintXirTemplates) {
                 TTY.println("Temp operand: " + x);
             }
         }
@@ -851,7 +851,7 @@
         setNoResult(x);
 
         // TODO: tune the defaults for the controls used to determine what kind of translation to use
-        if (x.numberOfCases() == 0 || x.numberOfCases() <= C1XOptions.SequentialSwitchLimit) {
+        if (x.numberOfCases() == 0 || x.numberOfCases() <= GraalOptions.SequentialSwitchLimit) {
             int loKey = x.lowKey();
             int len = x.numberOfCases();
             for (int i = 0; i < len; i++) {
@@ -862,7 +862,7 @@
         } else {
             SwitchRange[] switchRanges = createLookupRanges(x);
             int rangeDensity = x.numberOfCases() / switchRanges.length;
-            if (rangeDensity >= C1XOptions.RangeTestsSwitchDensity) {
+            if (rangeDensity >= GraalOptions.RangeTestsSwitchDensity) {
                 visitSwitchRanges(switchRanges, tag, getLIRBlock(x.defaultSuccessor()));
             } else {
                 List<Instruction> nonDefaultSuccessors = x.blockSuccessors().subList(0, x.numberOfCases());
@@ -883,7 +883,7 @@
     }
 
     private void blockDoEpilog() {
-        if (C1XOptions.PrintIRWithLIR) {
+        if (GraalOptions.PrintIRWithLIR) {
             TTY.println();
         }
 
@@ -893,7 +893,7 @@
     }
 
     private void blockDoProlog(LIRBlock block) {
-        if (C1XOptions.PrintIRWithLIR) {
+        if (GraalOptions.PrintIRWithLIR) {
             TTY.print(block.toString());
         }
         // set up the list of LIR instructions
@@ -950,10 +950,10 @@
         // XXX: linear search might be kind of slow for big basic blocks
         int index = constants.indexOf(c);
         if (index != -1) {
-            C1XMetrics.LoadConstantIterations += index;
+            GraalMetrics.LoadConstantIterations += index;
             return variablesForConstants.get(index);
         }
-        C1XMetrics.LoadConstantIterations += constants.size();
+        GraalMetrics.LoadConstantIterations += constants.size();
 
         CiVariable result = newVariable(kind);
         lir.move(c, result);
@@ -1214,16 +1214,16 @@
     }
 
     void doRoot(Value instr) {
-        if (C1XOptions.TraceLIRGeneratorLevel >= 2) {
+        if (GraalOptions.TraceLIRGeneratorLevel >= 2) {
             TTY.println("Emitting LIR for instruction " + instr);
         }
         currentInstruction = instr;
 
-        if (C1XOptions.TraceLIRVisit) {
+        if (GraalOptions.TraceLIRVisit) {
             TTY.println("Visiting    " + instr);
         }
         instr.accept(this);
-        if (C1XOptions.TraceLIRVisit) {
+        if (GraalOptions.TraceLIRVisit) {
             TTY.println("Operand for " + instr + " = " + instr.operand());
         }
     }
@@ -1396,7 +1396,7 @@
 
     protected CiValue setResult(Value x, CiVariable operand) {
         x.setOperand(operand);
-        if (C1XOptions.DetailedAsserts) {
+        if (GraalOptions.DetailedAsserts) {
             operands.recordResult(operand, x);
         }
         return operand;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/PhiResolver.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/PhiResolver.java	Wed Jun 08 14:10:06 2011 +0200
@@ -46,17 +46,13 @@
  *  r2 := r3  becomes  r1 := r2
  *  r1 := r2           r2 := r3
  * </pre>
- *
- * @author Marcelo Cintra
- * @author Thomas Wuerthinger
- * @author Doug Simon
  */
 public class PhiResolver {
 
     /**
      * Tracks a data flow dependency between a source operand and any number of the destination operands.
      */
-    static class Node {
+    static class PhiResolverNode {
 
         /**
          * A source operand whose value flows into the {@linkplain #destinations destination} operands.
@@ -66,7 +62,7 @@
         /**
          * The operands whose values are defined by the {@linkplain #operand source} operand.
          */
-        final ArrayList<Node> destinations;
+        final ArrayList<PhiResolverNode> destinations;
 
         /**
          * Denotes if a move instruction has already been emitted to initialize the value of {@link #operand}.
@@ -83,9 +79,9 @@
          */
         boolean startNode;
 
-        Node(CiValue operand) {
+        PhiResolverNode(CiValue operand) {
             this.operand = operand;
-            destinations = new ArrayList<Node>(4);
+            destinations = new ArrayList<PhiResolverNode>(4);
         }
 
         @Override
@@ -93,7 +89,7 @@
             StringBuilder buf = new StringBuilder(operand.toString());
             if (!destinations.isEmpty()) {
                 buf.append(" ->");
-                for (Node node : destinations) {
+                for (PhiResolverNode node : destinations) {
                     buf.append(' ').append(node.operand);
                 }
             }
@@ -106,17 +102,17 @@
     /**
      * The operand loop header phi for the operand currently being process in {@link #dispose()}.
      */
-    private Node loop;
+    private PhiResolverNode loop;
 
     private CiValue temp;
 
-    private final ArrayList<Node> variableOperands = new ArrayList<Node>(3);
-    private final ArrayList<Node> otherOperands = new ArrayList<Node>(3);
+    private final ArrayList<PhiResolverNode> variableOperands = new ArrayList<PhiResolverNode>(3);
+    private final ArrayList<PhiResolverNode> otherOperands = new ArrayList<PhiResolverNode>(3);
 
     /**
      * Maps operands to nodes.
      */
-    private final HashMap<CiValue, Node> operandToNodeMap = new HashMap<CiValue, Node>();
+    private final HashMap<CiValue, PhiResolverNode> operandToNodeMap = new HashMap<CiValue, PhiResolverNode>();
 
     public PhiResolver(LIRGenerator gen) {
         this.gen = gen;
@@ -126,7 +122,7 @@
     public void dispose() {
         // resolve any cycles in moves from and to variables
         for (int i = variableOperands.size() - 1; i >= 0; i--) {
-            Node node = variableOperands.get(i);
+            PhiResolverNode node = variableOperands.get(i);
             if (!node.visited) {
                 loop = null;
                 move(null, node);
@@ -137,7 +133,7 @@
 
         // generate move for move from non variable to arbitrary destination
         for (int i = otherOperands.size() - 1; i >= 0; i--) {
-            Node node = otherOperands.get(i);
+            PhiResolverNode node = otherOperands.get(i);
             for (int j = node.destinations.size() - 1; j >= 0; j--) {
                 emitMove(node.operand, node.destinations.get(j).operand);
             }
@@ -149,18 +145,18 @@
         // tty.print("move "); src.print(); tty.print(" to "); dest.print(); tty.cr();
         assert src.isLegal() : "source for phi move is illegal";
         assert dest.isLegal() : "destination for phi move is illegal";
-        Node srcNode = sourceNode(src);
-        Node destNode = destinationNode(dest);
+        PhiResolverNode srcNode = sourceNode(src);
+        PhiResolverNode destNode = destinationNode(dest);
         srcNode.destinations.add(destNode);
       }
 
-    private Node createNode(CiValue operand, boolean source) {
-        Node node;
+    private PhiResolverNode createNode(CiValue operand, boolean source) {
+        PhiResolverNode node;
         if (operand.isVariable()) {
             node = operandToNodeMap.get(operand);
             assert node == null || node.operand.equals(operand);
             if (node == null) {
-                node = new Node(operand);
+                node = new PhiResolverNode(operand);
                 operandToNodeMap.put(operand, node);
             }
             // Make sure that all variables show up in the list when
@@ -172,13 +168,13 @@
             }
         } else {
             assert source;
-            node = new Node(operand);
+            node = new PhiResolverNode(operand);
             otherOperands.add(node);
         }
         return node;
     }
 
-    private Node destinationNode(CiValue opr) {
+    private PhiResolverNode destinationNode(CiValue opr) {
         return createNode(opr, false);
     }
 
@@ -195,7 +191,7 @@
     // ie. cycle a := b, b := a start with node a
     // Call graph: move(NULL, a) -> move(a, b) -> move(b, a)
     // Generates moves in this order: move b to temp, move a to b, move temp to a
-    private void move(Node src, Node dest) {
+    private void move(PhiResolverNode src, PhiResolverNode dest) {
         if (!dest.visited) {
             dest.visited = true;
             for (int i = dest.destinations.size() - 1; i >= 0; i--) {
@@ -232,7 +228,7 @@
         emitMove(src, temp);
     }
 
-    private Node sourceNode(CiValue opr) {
+    private PhiResolverNode sourceNode(CiValue opr) {
         return createNode(opr, true);
     }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java	Wed Jun 08 14:10:06 2011 +0200
@@ -25,7 +25,6 @@
 import java.util.*;
 
 import com.oracle.max.graal.compiler.*;
-import com.oracle.max.graal.compiler.debug.*;
 import com.oracle.max.graal.compiler.ir.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.observer.*;
@@ -43,7 +42,7 @@
     /**
      * The compilation associated with this IR.
      */
-    public final C1XCompilation compilation;
+    public final GraalCompilation compilation;
 
     /**
      * The start block of this IR.
@@ -59,7 +58,7 @@
      * Creates a new IR instance for the specified compilation.
      * @param compilation the compilation
      */
-    public IR(C1XCompilation compilation) {
+    public IR(GraalCompilation compilation) {
         this.compilation = compilation;
     }
 
@@ -69,20 +68,26 @@
      * Builds the graph, optimizes it, and computes the linear scan block order.
      */
     public void build() {
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.HIR_CREATE.start();
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.HIR_CREATE.start();
         }
 
-        buildGraph();
+        new GraphBuilderPhase(compilation, compilation.method, false).apply(compilation.graph);
+        new DuplicationPhase().apply(compilation.graph);
+        new DeadCodeEliminationPhase().apply(compilation.graph);
 
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.HIR_CREATE.stop();
-            C1XTimers.HIR_OPTIMIZE.start();
+        if (GraalOptions.Inline) {
+            new InliningPhase(compilation, this).apply(compilation.graph);
+        }
+
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.HIR_CREATE.stop();
+            GraalTimers.HIR_OPTIMIZE.start();
         }
 
         Graph graph = compilation.graph;
 
-        if (C1XOptions.OptCanonicalizer) {
+        if (GraalOptions.OptCanonicalizer) {
             new CanonicalizerPhase().apply(graph);
         }
 
@@ -135,35 +140,8 @@
 
         verifyAndPrint("After linear scan order");
 
-        if (C1XOptions.PrintTimers) {
-            C1XTimers.HIR_OPTIMIZE.stop();
-        }
-    }
-
-    private void buildGraph() {
-        // Graph builder must set the startBlock and the osrEntryBlock
-        new GraphBuilderPhase(compilation, compilation.method, false).apply(compilation.graph);
-
-//        CompilerGraph duplicate = new CompilerGraph();
-//        Map<Node, Node> replacements = new HashMap<Node, Node>();
-//        replacements.put(compilation.graph.start(), duplicate.start());
-//        duplicate.addDuplicate(compilation.graph.getNodes(), replacements);
-//        compilation.graph = duplicate;
-
-        new DuplicationPhase().apply(compilation.graph);
-
-        DeadCodeEliminationPhase dce = new DeadCodeEliminationPhase();
-        dce.apply(compilation.graph);
-        if (dce.deletedNodeCount > 0) {
-            verifyAndPrint("After dead code elimination");
-        }
-
-        if (C1XOptions.Inline) {
-            new InliningPhase(compilation, this).apply(compilation.graph);
-        }
-
-        if (C1XOptions.PrintCompilation) {
-            TTY.print(String.format("%3d blocks | ", compilation.stats.blockCount));
+        if (GraalOptions.PrintTimers) {
+            GraalTimers.HIR_OPTIMIZE.stop();
         }
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/MemoryMap.java	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.max.graal.compiler.graph;
-
-import static java.lang.reflect.Modifier.*;
-
-import java.util.*;
-
-import com.oracle.max.graal.compiler.ir.*;
-import com.sun.cri.ri.*;
-
-/**
- * The {@code MemoryMap} class is an approximation of memory that is used redundant load and
- * store elimination. In C1, tracking of fields of new objects' fields was precise,
- * while tracking of other fields is managed at the offset granularity (i.e. a write of a field with offset
- * {@code off} will "overwrite" all fields with the offset {@code off}. However, C1X distinguishes all
- * loaded fields as separate locations. Static fields have just one location, while instance fields are
- * tracked for at most one instance object. Loads or stores of unloaded fields kill all memory locations.
- * An object is no longer "new" if it is stored into a field or array.
- *
- * @author Ben L. Titzer
- */
-public class MemoryMap {
-
-    private final HashMap<RiField, Value> objectMap = new HashMap<RiField, Value>();
-    private final HashMap<RiField, Value> valueMap = new HashMap<RiField, Value>();
-    private final IdentityHashMap<Value, Value> newObjects = new IdentityHashMap<Value, Value>();
-
-    /**
-     * Kills all memory locations.
-     */
-    public void kill() {
-        objectMap.clear();
-        valueMap.clear();
-        newObjects.clear();
-    }
-
-    /**
-     * The specified instruction has just escaped, it can no longer be considered a "new object".
-     * @param x the instruction that just escaped
-     */
-    public void storeValue(Value x) {
-        newObjects.remove(x);
-    }
-
-    /**
-     * Record a newly allocated object.
-     * @param n the instruction generating the new object
-     */
-    public void newInstance(NewInstance n) {
-        newObjects.put(n, n);
-    }
-
-    /**
-     * Look up a load for load elimination, and put this load into the load elimination map.
-     * @param load the instruction representing the load
-     * @return a reference to the previous instruction that already loaded the value, if it is available; the
-     * {@code load} parameter otherwise
-     */
-    public Value load(LoadField load) {
-        if (!load.isLoaded()) {
-            // the field is not loaded, kill everything, because it will need to be resolved
-            kill();
-            return load;
-        }
-        RiField field = load.field();
-        if (load.isStatic()) {
-            // the field is static, look in the static map
-            Value r = valueMap.get(field);
-            if (r != null) {
-                return r;
-            }
-            valueMap.put(field, load);
-        } else {
-            // see if the value for this object for this field is in the map
-            if (objectMap.get(field) == load.object()) {
-                return valueMap.get(field);
-            }
-            objectMap.put(field, load.object());
-            valueMap.put(field, load);
-        }
-
-        return load; // load cannot be eliminated
-    }
-
-    /**
-     * Insert a new result for a load into the memory map.
-     * @param load the load instruction
-     * @param result the result that the load instruction should produce
-     */
-    public void setResult(LoadField load, Value result) {
-        if (load.isLoaded()) {
-            RiField field = load.field();
-            if (load.isStatic()) {
-                // the field is static, put it in the static map
-                valueMap.put(field, result);
-            } else {
-                // put the result for the loaded object into the map
-                objectMap.put(field, load.object());
-                valueMap.put(field, result);
-            }
-        }
-    }
-
-    /**
-     * Look up a store for store elimination, and put this store into the load elimination map.
-     * @param store the store instruction to put into the map
-     * @return {@code null} if the store operation is redundant; the {@code store} parameter
-     * otherwise
-     */
-    public StoreField store(StoreField store) {
-        if (!store.isLoaded()) {
-            // the field is not loaded, kill everything, because it will need to be resolved
-            kill();
-            return store;
-        }
-        RiField field = store.field();
-        Value value = store.value();
-        if (store.isStatic()) {
-            // the field is static, overwrite it into the static map
-            valueMap.put(field, value);
-        } else {
-            if (newObjects.containsKey(store.object())) {
-                // this is a store to a new object's field
-                if (fieldHasNoStores(field) && value.isConstant() && value.asConstant().isDefaultValue()) {
-                    // this is a redundant initialization of a new object's field that has not been assigned to
-                    return null;
-                }
-            }
-            Value obj = objectMap.get(field);
-            if (obj == store.object()) {
-                // is this a redundant store?
-                if (value == valueMap.get(field) && !isVolatile(field.accessFlags())) {
-                    return null;
-                }
-            }
-            objectMap.put(field, store.object());
-            valueMap.put(field, value);
-        }
-        storeValue(value); // the value stored just escaped
-        return store; // the store cannot be eliminated
-    }
-
-    private boolean fieldHasNoStores(RiField field) {
-        return objectMap.get(field) == null;
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/package-info.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/package-info.java	Wed Jun 08 14:10:06 2011 +0200
@@ -35,7 +35,7 @@
  *
  * {@code IR.buildGraph} creates an {@link com.oracle.max.graal.compiler.ir.IRScope topScope} object,
  * that represents a context for inlining, and then invokes the constructor for the
- * {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase} class, passing the {@link com.oracle.max.graal.compiler.C1XCompilation}, and {@code IR}
+ * {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase} class, passing the {@link com.oracle.max.graal.compiler.GraalCompilation}, and {@code IR}
  * instances, which are cached. The following support objects are created in the constructor:
  *
  * <ul>
@@ -51,11 +51,11 @@
  * <ol>
  * <li>The {@link com.oracle.max.graal.compiler.graph.IR#startBlock} field of the cached {@link com.oracle.max.graal.compiler.graph.IR} instance is set to a newly created
  * {@link com.oracle.max.graal.compiler.ir.BlockBegin} node, with bytecode index 0 and then the {@link com.oracle.max.graal.compiler.graph.BlockMap} is
- * constructed by calling {@link com.oracle.max.graal.compiler.C1XCompilation#getBlockMap}. This behaves slightly differently depending on
+ * constructed by calling {@link com.oracle.max.graal.compiler.GraalCompilation#getBlockMap}. This behaves slightly differently depending on
  * whether this is an OSR compilation. If so, a new {@link com.oracle.max.graal.compiler.ir.BlockBegin} node is added to the map at the OSR bytecode
  * index. The map is then built by the{@link com.oracle.max.graal.compiler.graph.BlockMap#build}, which takes a boolean argument that
  * controls whether a second pass is made over the bytecodes to compute stores in loops. This always false for an OSR
- * compilation (why?). Otherwise, it is only true if enabled by the {@link com.oracle.max.graal.compiler.C1XOptions#PhiLoopStores}
+ * compilation (why?). Otherwise, it is only true if enabled by the {@link com.oracle.max.graal.compiler.GraalOptions#PhiLoopStores}
  * compilation option. FInally some unneeded state from the map is removed by the {@link com.oracle.max.graal.compiler.graph.BlockMap#cleanup} method, and
  * the statistics are updated.
  * </li>
@@ -68,7 +68,7 @@
  * {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase#pushRootScope} initializes the {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase#scopeData} field with a
  * {@link com.oracle.max.graal.compiler.graph.ScopeData} instance, with null parent. The
  * {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase#compilation} instance is called to get an {@link com.sun.cri.ri.RiConstantPool}
- * , which is C1X's interface to constant pool information. The {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase#curBlock} field is
+ * , which is Graal's interface to constant pool information. The {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase#curBlock} field is
  * set to the {@code startBlock}.
  * <p>
  *
@@ -99,8 +99,8 @@
  * Then the {@link com.oracle.max.graal.compiler.ir.IRScope#lockStackSize} is computed. (TBD)
  * </li>
  * <li>
- * Then the method is checked for being intrinsic, i.e., one that has a hard-wired implementation known to C1X. If so,
- * and {@link com.oracle.max.graal.compiler.C1XOptions#OptIntrinsify} is set, an attempt is made to inline it (TBD). Otherwise, or if the
+ * Then the method is checked for being intrinsic, i.e., one that has a hard-wired implementation known to Graal. If so,
+ * and {@link com.oracle.max.graal.compiler.GraalOptions#OptIntrinsify} is set, an attempt is made to inline it (TBD). Otherwise, or if the
  * intrinsification fails, normal processing continues by adding the entry block to the
  * {@link com.oracle.max.graal.compiler.graph.ScopeData} work list (kept topologically sorted) and calling
  * {@link com.oracle.max.graal.compiler.phases.GraphBuilderPhase#iterateAllBlocks}.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ComputeLinearScanOrder.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ComputeLinearScanOrder.java	Wed Jun 08 14:10:06 2011 +0200
@@ -147,12 +147,12 @@
      * 4. Create a list with all loop end blocks.
      */
     void countEdges(LIRBlock cur, LIRBlock parent) {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("Counting edges for block B%d%s", cur.blockID(), parent == null ? "" : " coming from B" + parent.blockID());
         }
 
         if (isActive(cur)) {
-            if (C1XOptions.TraceLinearScanLevel >= 3) {
+            if (GraalOptions.TraceLinearScanLevel >= 3) {
                 TTY.println("backward branch");
             }
             assert isVisited(cur) : "block must be visited when block is active";
@@ -169,7 +169,7 @@
         incForwardBranches(cur);
 
         if (isVisited(cur)) {
-            if (C1XOptions.TraceLinearScanLevel >= 3) {
+            if (GraalOptions.TraceLinearScanLevel >= 3) {
                 TTY.println("block already visited");
             }
             return;
@@ -194,7 +194,7 @@
         // have returned.
         if (cur.isLinearScanLoopHeader()) {
             assert cur.loopIndex() == -1 : "cannot set loop-index twice";
-            if (C1XOptions.TraceLinearScanLevel >= 3) {
+            if (GraalOptions.TraceLinearScanLevel >= 3) {
                 TTY.println("Block B%d is loop header of loop %d", cur.blockID(), numLoops);
             }
 
@@ -202,13 +202,13 @@
             numLoops++;
         }
 
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("Finished counting edges for block B%d", cur.blockID());
         }
     }
 
     void markLoops() {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("----- marking loops");
         }
 
@@ -219,7 +219,7 @@
             LIRBlock loopStart = loopEnd.suxAt(0);
             int loopIdx = loopStart.loopIndex();
 
-            if (C1XOptions.TraceLinearScanLevel >= 3) {
+            if (GraalOptions.TraceLinearScanLevel >= 3) {
                 TTY.println("Processing loop from B%d to B%d (loop %d):", loopStart.blockID(), loopEnd.blockID(), loopIdx);
             }
             assert loopEnd.isLinearScanLoopEnd() : "loop end flag must be set";
@@ -234,7 +234,7 @@
             do {
                 LIRBlock cur = workList.remove(workList.size() - 1);
 
-                if (C1XOptions.TraceLinearScanLevel >= 3) {
+                if (GraalOptions.TraceLinearScanLevel >= 3) {
                     TTY.println("    processing B%d", cur.blockID());
                 }
                 assert isBlockInLoop(loopIdx, cur) : "bit in loop map must be set when block is in work list";
@@ -246,7 +246,7 @@
 
                         if (!isBlockInLoop(loopIdx, pred)) {
                             // this predecessor has not been processed yet, so add it to work list
-                            if (C1XOptions.TraceLinearScanLevel >= 3) {
+                            if (GraalOptions.TraceLinearScanLevel >= 3) {
                                 TTY.println("    pushing B%d", pred.blockID());
                             }
                             workList.add(pred);
@@ -266,7 +266,7 @@
             if (isBlockInLoop(i, startBlock)) {
                 // loop i contains the entry block of the method.
                 // this is not a natural loop, so ignore it
-                if (C1XOptions.TraceLinearScanLevel >= 2) {
+                if (GraalOptions.TraceLinearScanLevel >= 2) {
                     TTY.println("Loop %d is non-natural, so it is ignored", i);
                 }
 
@@ -279,7 +279,7 @@
     }
 
     void assignLoopDepth(LIRBlock startBlock) {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("----- computing loop-depth and weight");
         }
         initVisited();
@@ -292,7 +292,7 @@
 
             if (!isVisited(cur)) {
                 setVisited(cur);
-                if (C1XOptions.TraceLinearScanLevel >= 4) {
+                if (GraalOptions.TraceLinearScanLevel >= 4) {
                     TTY.println("Computing loop depth for block B%d", cur.blockID());
                 }
 
@@ -319,10 +319,6 @@
     }
 
     int computeWeight(LIRBlock cur) {
-        LIRBlock singleSux = null;
-        if (cur.numberOfSux() == 1) {
-            singleSux = cur.suxAt(0);
-        }
 
         // limit loop-depth to 15 bit (only for security reason, it will never be so big)
         int weight = (cur.loopDepth() & 0x7FFF) << 16;
@@ -397,7 +393,7 @@
         // the linearScanNumber is used to cache the weight of a block
         cur.setLinearScanNumber(curWeight);
 
-        if (C1XOptions.StressLinearScan) {
+        if (GraalOptions.StressLinearScan) {
             workList.add(0, cur);
             return;
         }
@@ -411,7 +407,7 @@
         }
         workList.set(insertIdx, cur);
 
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("Sorted B%d into worklist. new worklist:", cur.blockID());
             for (int i = 0; i < workList.size(); i++) {
                 TTY.println(String.format("%8d B%02d  weight:%6x", i, workList.get(i).blockID(), workList.get(i).linearScanNumber()));
@@ -425,7 +421,7 @@
     }
 
     void appendBlock(LIRBlock cur) {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("appending block B%d (weight 0x%06x) to linear-scan order", cur.blockID(), cur.linearScanNumber());
         }
         assert !linearScanOrder.contains(cur) : "cannot add the same block twice";
@@ -438,7 +434,7 @@
     }
 
     void computeOrder(LIRBlock startBlock) {
-        if (C1XOptions.TraceLinearScanLevel >= 3) {
+        if (GraalOptions.TraceLinearScanLevel >= 3) {
             TTY.println("----- computing final block order");
         }
 
@@ -475,7 +471,7 @@
     }
 
     public void printBlocks() {
-        if (C1XOptions.TraceLinearScanLevel >= 2) {
+        if (GraalOptions.TraceLinearScanLevel >= 2) {
             TTY.println("----- loop information:");
             for (LIRBlock cur : linearScanOrder) {
                 TTY.print(String.format("%4d: B%02d: ", cur.linearScanNumber(), cur.blockID()));
@@ -486,7 +482,7 @@
             }
         }
 
-        if (C1XOptions.TraceLinearScanLevel >= 1) {
+        if (GraalOptions.TraceLinearScanLevel >= 1) {
             TTY.println("----- linear-scan block order:");
             for (LIRBlock cur : linearScanOrder) {
                 TTY.print(String.format("%4d: B%02d    loop: %2d  depth: %2d", cur.linearScanNumber(), cur.blockID(), cur.loopIndex(), cur.loopDepth()));
@@ -519,7 +515,7 @@
     boolean verify() {
        /* assert linearScanOrder.size() == numBlocks : "wrong number of blocks in list";
 
-        if (C1XOptions.StressLinearScan) {
+        if (GraalOptions.StressLinearScan) {
             // blocks are scrambled when StressLinearScan is used
             return true;
         }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Constant.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Constant.java	Wed Jun 08 14:10:06 2011 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.compiler.ir;
 
-import static com.oracle.max.graal.compiler.C1XCompilation.*;
+import static com.oracle.max.graal.compiler.GraalCompilation.*;
 
 import com.oracle.max.graal.compiler.debug.*;
 import com.oracle.max.graal.graph.*;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Instruction.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Instruction.java	Wed Jun 08 14:10:06 2011 +0200
@@ -85,7 +85,7 @@
      */
     public Instruction(CiKind kind, int inputCount, int successorCount, Graph graph) {
         super(kind, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph);
-        C1XMetrics.HIRInstructions++;
+        GraalMetrics.HIRInstructions++;
     }
 
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/FrameMap.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/FrameMap.java	Wed Jun 08 14:10:06 2011 +0200
@@ -81,7 +81,7 @@
  */
 public final class FrameMap {
 
-    private final C1XCompilation compilation;
+    private final GraalCompilation compilation;
     private final CiCallingConvention incomingArguments;
 
     /**
@@ -123,7 +123,7 @@
      * @param method the outermost method being compiled
      * @param monitors the number of monitors allocated on the stack for this method
      */
-    public FrameMap(C1XCompilation compilation, RiMethod method, int monitors) {
+    public FrameMap(GraalCompilation compilation, RiMethod method, int monitors) {
         this.compilation = compilation;
         this.frameSize = -1;
         this.spillSlotCount = -2;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRAssembler.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRAssembler.java	Wed Jun 08 14:10:06 2011 +0200
@@ -42,7 +42,7 @@
  */
 public abstract class LIRAssembler {
 
-    public final C1XCompilation compilation;
+    public final GraalCompilation compilation;
     public final TargetMethodAssembler tasm;
     public final AbstractAssembler asm;
     public final FrameMap frameMap;
@@ -65,7 +65,7 @@
         }
     }
 
-    public LIRAssembler(C1XCompilation compilation) {
+    public LIRAssembler(GraalCompilation compilation) {
         this.compilation = compilation;
         this.tasm = compilation.assembler();
         this.asm = tasm.asm;
@@ -97,7 +97,7 @@
     public abstract void emitTraps();
 
     public void emitCode(List<LIRBlock> hir) {
-        if (C1XOptions.PrintLIR && !TTY.isSuppressed()) {
+        if (GraalOptions.PrintLIR && !TTY.isSuppressed()) {
             LIRList.printLIR(hir);
         }
 
@@ -112,12 +112,12 @@
 
         block.setBlockEntryPco(codePos());
 
-        if (C1XOptions.PrintLIRWithAssembly) {
+        if (GraalOptions.PrintLIRWithAssembly) {
             block.printWithoutPhis(TTY.out());
         }
 
         assert block.lir() != null : "must have LIR";
-        if (C1XOptions.CommentedAssembly) {
+        if (GraalOptions.CommentedAssembly) {
             String st = String.format(" block B%d", block.blockID());
             tasm.blockComment(st);
         }
@@ -129,13 +129,13 @@
         doPeephole(list);
 
         for (LIRInstruction op : list.instructionsList()) {
-            if (C1XOptions.CommentedAssembly) {
+            if (GraalOptions.CommentedAssembly) {
                 // Only print out branches
                 if (op.code == LIROpcode.Branch) {
                     tasm.blockComment(op.toStringWithIdPrefix());
                 }
             }
-            if (C1XOptions.PrintLIRWithAssembly && !TTY.isSuppressed()) {
+            if (GraalOptions.PrintLIRWithAssembly && !TTY.isSuppressed()) {
                 // print out the LIR operation followed by the resulting assembly
                 TTY.println(op.toStringWithIdPrefix());
                 TTY.println();
@@ -143,7 +143,7 @@
 
             op.emitCode(this);
 
-            if (C1XOptions.PrintLIRWithAssembly) {
+            if (GraalOptions.PrintLIRWithAssembly) {
                 printAssembly(asm);
             }
         }
@@ -157,7 +157,7 @@
                 TTY.println(disasm);
             } else {
                 TTY.println("Code [+%d]: %d bytes", lastDecodeStart, currentBytes.length);
-                Util.printBytes(lastDecodeStart, currentBytes, C1XOptions.PrintAssemblyBytesPerLine);
+                Util.printBytes(lastDecodeStart, currentBytes, GraalOptions.PrintAssemblyBytesPerLine);
             }
         }
         lastDecodeStart = asm.codeBuffer.position();
@@ -369,7 +369,7 @@
     }
 
     public void verifyOopMap(LIRDebugInfo info) {
-        if (C1XOptions.VerifyPointerMaps) {
+        if (GraalOptions.VerifyPointerMaps) {
             // TODO: verify oops
             Util.shouldNotReachHere();
         }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRDebugInfo.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRDebugInfo.java	Wed Jun 08 14:10:06 2011 +0200
@@ -62,7 +62,7 @@
         return new LIRDebugInfo(this);
     }
 
-    public void setOop(CiValue location, C1XCompilation compilation, CiBitMap frameRefMap, CiBitMap regRefMap) {
+    public void setOop(CiValue location, GraalCompilation compilation, CiBitMap frameRefMap, CiBitMap regRefMap) {
         CiTarget target = compilation.target;
         if (location.isAddress()) {
             CiAddress stackLocation = (CiAddress) location;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRInstruction.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRInstruction.java	Wed Jun 08 14:10:06 2011 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.compiler.lir;
 
-import static com.oracle.max.graal.compiler.C1XCompilation.*;
+import static com.oracle.max.graal.compiler.GraalCompilation.*;
 
 import java.util.*;
 
@@ -185,10 +185,10 @@
         allocatorOperands = new ArrayList<CiValue>(operands.length + 3);
         this.result = initOutput(result);
 
-        C1XMetrics.LIRInstructions++;
+        GraalMetrics.LIRInstructions++;
 
         if (opcode == LIROpcode.Move) {
-            C1XMetrics.LIRMoveInstructions++;
+            GraalMetrics.LIRMoveInstructions++;
         }
         id = -1;
         this.operands = new LIROperand[operands.length];
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRList.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRList.java	Wed Jun 08 14:10:06 2011 +0200
@@ -49,17 +49,17 @@
     private final LIROpcode runtimeCallOp;
 
     private LIROpcode directCallOp(RiMethod method) {
-        return C1XOptions.UseConstDirectCall && method.hasCompiledCode() ? LIROpcode.ConstDirectCall : LIROpcode.DirectCall;
+        return GraalOptions.UseConstDirectCall && method.hasCompiledCode() ? LIROpcode.ConstDirectCall : LIROpcode.DirectCall;
     }
 
     public LIRList(LIRGenerator generator) {
         this.generator = generator;
         this.operations = new ArrayList<LIRInstruction>(8);
-        runtimeCallOp = C1XOptions.UseConstDirectCall ? LIROpcode.ConstDirectCall : LIROpcode.DirectCall;
+        runtimeCallOp = GraalOptions.UseConstDirectCall ? LIROpcode.ConstDirectCall : LIROpcode.DirectCall;
     }
 
     private void append(LIRInstruction op) {
-        if (C1XOptions.PrintIRWithLIR && !TTY.isSuppressed()) {
+        if (GraalOptions.PrintIRWithLIR && !TTY.isSuppressed()) {
             generator.maybePrintCurrentInstruction();
             TTY.println(op.toStringWithIdPrefix());
             TTY.println();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRXirInstruction.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRXirInstruction.java	Wed Jun 08 14:10:06 2011 +0200
@@ -68,7 +68,7 @@
         this.tempCount = tempCount;
         this.inputCount = operands.length - inputTempCount - tempCount;
 
-        C1XMetrics.LIRXIRInstructions++;
+        GraalMetrics.LIRXIRInstructions++;
     }
 
     public CiValue[] getOperands() {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationEvent.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationEvent.java	Wed Jun 08 14:10:06 2011 +0200
@@ -41,7 +41,7 @@
  */
 public class CompilationEvent {
 
-    private final C1XCompilation compilation;
+    private final GraalCompilation compilation;
     private final String label;
     private Graph graph;
 
@@ -57,42 +57,42 @@
     private int intervalsSize;
     private Interval[] intervalsCopy = null;
 
-    public CompilationEvent(C1XCompilation compilation) {
+    public CompilationEvent(GraalCompilation compilation) {
         this(compilation, null);
     }
 
-    private CompilationEvent(C1XCompilation compilation, String label) {
+    private CompilationEvent(GraalCompilation compilation, String label) {
         assert compilation != null;
         this.label = label;
         this.compilation = compilation;
     }
 
-    public CompilationEvent(C1XCompilation compilation, String label, Graph graph, boolean hirValid, boolean lirValid) {
+    public CompilationEvent(GraalCompilation compilation, String label, Graph graph, boolean hirValid, boolean lirValid) {
         this(compilation, label);
         this.graph = graph;
         this.hirValid = hirValid;
         this.lirValid = lirValid;
     }
 
-    public CompilationEvent(C1XCompilation compilation, String label, Graph graph, boolean hirValid, boolean lirValid, CiTargetMethod targetMethod) {
+    public CompilationEvent(GraalCompilation compilation, String label, Graph graph, boolean hirValid, boolean lirValid, CiTargetMethod targetMethod) {
         this(compilation, label, graph, hirValid, lirValid);
         this.targetMethod = targetMethod;
     }
 
-    public CompilationEvent(C1XCompilation compilation, String label, BlockMap blockMap, int codeSize) {
+    public CompilationEvent(GraalCompilation compilation, String label, BlockMap blockMap, int codeSize) {
         this(compilation, label);
         this.blockMap = blockMap;
         this.codeSize = codeSize;
     }
 
-    public CompilationEvent(C1XCompilation compilation, String label, LinearScan allocator, Interval[] intervals, int intervalsSize) {
+    public CompilationEvent(GraalCompilation compilation, String label, LinearScan allocator, Interval[] intervals, int intervalsSize) {
         this(compilation, label);
         this.allocator = allocator;
         this.intervals = intervals;
         this.intervalsSize = intervalsSize;
     }
 
-    public C1XCompilation getCompilation() {
+    public GraalCompilation getCompilation() {
         return compilation;
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationObserver.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationObserver.java	Wed Jun 08 14:10:06 2011 +0200
@@ -33,7 +33,7 @@
 
     /**
      * Called when compilation of a method has started. This is always the first event raised for a particular
-     * {@link C1XCompilation}.
+     * {@link GraalCompilation}.
      *
      * @param event Information associated with the event and current state of the compilation.
      */
@@ -48,7 +48,7 @@
 
     /**
      * Called when compilation of a method has completed (successfully or not). This is always the last event raised for
-     * a particular {@link C1XCompilation}.
+     * a particular {@link GraalCompilation}.
      *
      * @param event Information associated with the event and current state of the compilation.
      */
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java	Wed Jun 08 14:10:06 2011 +0200
@@ -22,37 +22,37 @@
  */
 
 /**
- * The top-level package in C1X containing options, metrics, timers and the main compiler class
- * {@link com.oracle.max.graal.compiler.C1XCompiler}.
+ * The top-level package in Graal containing options, metrics, timers and the main compiler class
+ * {@link com.oracle.max.graal.compiler.GraalCompiler}.
  *
- * <H2>{@code C1XCompiler} Overview</H2>
+ * <H2>{@code GraalCompiler} Overview</H2>
  *
- * C1X is intended to be used with multiple JVM's so makes no use of or reference to classes for a specific JVM, for
+ * Graal is intended to be used with multiple JVM's so makes no use of or reference to classes for a specific JVM, for
  * example Maxine.
  *
- * The compiler is represented by the class {@code C1XCompiler}. {@code C1XCompiler} binds a specific target
+ * The compiler is represented by the class {@code GraalCompiler}. {@code GraalCompiler} binds a specific target
  * architecture and JVM interface to produce a usable compiler object. There are
  * two variants of {@code compileMethod}, one of which is used when doing <i>on stack replacement</i> (OSR), discussed
  * later. The main variant takes {@link com.sun.cri.ri.RiMethod} and {@link com.sun.cri.xir.RiXirGenerator} arguments.
- * {@code RiMethod} is C1X's representation of a Java method and {@code RiXirGenerator} represents the interface through
+ * {@code RiMethod} is Graal's representation of a Java method and {@code RiXirGenerator} represents the interface through
  * which the compiler requests the XIR for a given bytecode from the runtime system.
  *
- * <H3>The C1X Compilation Process</H3>
+ * <H3>The Graal Compilation Process</H3>
  *
- * {@link com.oracle.max.graal.compiler.C1XCompiler#compileMethod} creates a {@link C1XCompilation} instance and then returns the result of calling its
- * {@link com.oracle.max.graal.compiler.C1XCompilation#compile} method. The {@code C1XCompilation} instance records whether {@code compileMethod} was invoked with
+ * {@link com.oracle.max.graal.compiler.GraalCompiler#compileMethod} creates a {@link GraalCompilation} instance and then returns the result of calling its
+ * {@link com.oracle.max.graal.compiler.GraalCompilation#compile} method. The {@code GraalCompilation} instance records whether {@code compileMethod} was invoked with
  * the OSR variant, which is used later in the IR generation.
  * <p>
- * While there is only one {@code C1XCompiler} instance, there may be several compilations proceeding concurrently, each of
- * which is represented by a unique {@code C1XCompilation} instance. The static method {@link com.oracle.max.graal.compiler.C1XCompilation#current}} returns the
- * {@code C1XCompilation} instance associated with the current thread, and is managed using a {@link java.lang.ThreadLocal} variable. It
- * is used when assigning the unique id that is used for tracing  output to an HIR node. Each {@code C1XCompilation} instance
+ * While there is only one {@code GraalCompiler} instance, there may be several compilations proceeding concurrently, each of
+ * which is represented by a unique {@code GraalCompilation} instance. The static method {@link com.oracle.max.graal.compiler.GraalCompilation#current}} returns the
+ * {@code GraalCompilation} instance associated with the current thread, and is managed using a {@link java.lang.ThreadLocal} variable. It
+ * is used when assigning the unique id that is used for tracing  output to an HIR node. Each {@code GraalCompilation} instance
  * has an associated {@link com.sun.cri.ci.CiStatistics} object that accumulates information about the compilation process, but is also
  * used as a generator of, for example, basic block identifiers.
  * <p>
- * The compilation begins by calling {@link com.oracle.max.graal.compiler.C1XCompilation#emitHIR}, which creates the high-level intermediate representation (HIR) from the
+ * The compilation begins by calling {@link com.oracle.max.graal.compiler.GraalCompilation#emitHIR}, which creates the high-level intermediate representation (HIR) from the
  * bytecodes of the method. The HIR is managed by the {@link com.oracle.max.graal.compiler.graph.IR} class, an instance of which is created by
- * {@code emitHR}, which then calls the {{@link com.oracle.max.graal.compiler.graph.IR#build}} method and returns the result. The {@code C1XCompilation} and {@code IR}
+ * {@code emitHR}, which then calls the {{@link com.oracle.max.graal.compiler.graph.IR#build}} method and returns the result. The {@code GraalCompilation} and {@code IR}
  * instances are are bi-directionally linked.
  *
  * <H3>Supported backends</H3>
@@ -61,7 +61,7 @@
  * <li>AMD64/x64 with SSE2</li>
  * </ul>
  *
- * <H2>Notes and Todos</H2> This is a collection of notes about the C1X compiler, including future directions,
+ * <H2>Notes and Todos</H2> This is a collection of notes about the Graal compiler, including future directions,
  * refactorings, missing features, broken features, etc.
  *
  *
@@ -94,7 +94,7 @@
  *
  * <h3>Missing or incomplete features</h3>
  *
- * There are some features of C1 that were not ported forward or finished given the time constraints for the C1X port. A
+ * There are some features of C1 that were not ported forward or finished given the time constraints for the Graal port. A
  * list appears below.
  *
  * <ul>
@@ -126,7 +126,7 @@
  * backend ({@link com.oracle.max.graal.compiler.target.amd64.AMD64Backend}, {@link com.oracle.max.graal.compiler.target.amd64.AMD64LIRGenerator}, {@link com.oracle.max.graal.compiler.target.amd64.AMD64LIRAssembler}, etc).</li>
  *
  * <li>
- * XIR for safepoints. The C1X backend should use XIR to get the code for safepoints, but currently it still uses the
+ * XIR for safepoints. The Graal backend should use XIR to get the code for safepoints, but currently it still uses the
  * handwritten logic (currently only compatible with Maxine).</li>
  *
  * </ul>
@@ -136,28 +136,28 @@
  * <ul>
  *
  * <li>
- * Reference map for outgoing overflow arguments. If a C1X method calls another method that has overflow arguments, it
+ * Reference map for outgoing overflow arguments. If a Graal method calls another method that has overflow arguments, it
  * is not clear if the outgoing overflow argument area, which may contain references, has the appropriate bits set in
- * the reference map for the C1X method's frame. Such arguments may be live in the called method.</li>
+ * the reference map for the Graal method's frame. Such arguments may be live in the called method.</li>
  *
  * <li>
  * Although it should work, inlining synchronized methods or methods with exception handlers hasn't been tested.</li>
  * <li>
- * On-stack replacement. C1X retains all of the special logic for performing an OSR compilation. This is basically a
+ * On-stack replacement. Graal retains all of the special logic for performing an OSR compilation. This is basically a
  * compilation with a second entrypoint for entry from the interpreter. However, the generation of a runtime-specific
  * entry sequence was never tested.</li>
  *
  * <li>
- * {@link com.oracle.max.graal.compiler.C1XIntrinsic Intrinsification} is the mechanism by which the compiler recognizes calls to special JDK or
- * runtime methods and replaces them with custom code. It is enabled by the {@link com.oracle.max.graal.compiler.C1XOptions#OptIntrinsify} compiler
- * option. The C1X backend has never been tested with intrinsified arithmetic or floating point operations. For best
+ * {@link com.oracle.max.graal.compiler.GraalIntrinsic Intrinsification} is the mechanism by which the compiler recognizes calls to special JDK or
+ * runtime methods and replaces them with custom code. It is enabled by the {@link com.oracle.max.graal.compiler.GraalOptions#OptIntrinsify} compiler
+ * option. The Graal backend has never been tested with intrinsified arithmetic or floating point operations. For best
  * performance, it should generate specialized machine code for arithmetic and floating point, perhaps using global
  * stubs for complex floating point operations. <br>
  * <i>Note</i>: Folding of special intrinsified methods is supported, tested, and working. The runtime system may
  * register methods to be folded by using the
- * {@link com.oracle.max.graal.compiler.C1XIntrinsic#registerFoldableMethod(RiMethod, java.lang.reflect.Method)} call. When the compiler encounters a
+ * {@link com.oracle.max.graal.compiler.GraalIntrinsic#registerFoldableMethod(RiMethod, java.lang.reflect.Method)} call. When the compiler encounters a
  * call to such a registered method where the parameters are all constants, it invokes the supplied method with
- * reflection. If the reflective call produces a value and does not throw an exception, C1X replaces the call to the
+ * reflection. If the reflective call produces a value and does not throw an exception, Graal replaces the call to the
  * method with the result.</li>
  * </ul>
  *
@@ -166,7 +166,7 @@
  * <ul>
  * <li>
  * {@link com.oracle.max.graal.compiler.opt.LoopPeeler Loop peeling} was written by Marcelo Cintra near the end of his internship. It was never completed
- * and should be considered broken. It only remains as a sketch of how loop peeling would be implemented in C1X, or in
+ * and should be considered broken. It only remains as a sketch of how loop peeling would be implemented in Graal, or in
  * case he would finish the implementation and test it.</li>
  *
  * <li>
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/CanonicalizerPhase.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/CanonicalizerPhase.java	Wed Jun 08 14:10:06 2011 +0200
@@ -60,7 +60,7 @@
             Node canonical = op.canonical(n);
             if (canonical != n) {
                 n.replace(canonical);
-                C1XMetrics.NodesCanonicalized++;
+                GraalMetrics.NodesCanonicalized++;
             }
         }
     }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java	Wed Jun 08 14:10:06 2011 +0200
@@ -34,8 +34,6 @@
     private NodeWorklist worklist;
     private Graph graph;
 
-    public int deletedNodeCount;
-
     @Override
     protected void run(Graph graph) {
         this.graph = graph;
@@ -55,8 +53,8 @@
 
         new PhiSimplifier(graph);
 
-        if (C1XOptions.TraceDeadCodeElimination) {
-            System.out.printf("dead code elimination: deleted %d nodes\n", deletedNodeCount);
+        if (GraalOptions.TraceDeadCodeElimination) {
+            System.out.printf("dead code elimination finished\n");
         }
     }
 
@@ -94,7 +92,6 @@
         for (Node node : graph.getNodes()) {
             if (node != Node.Null && !worklist.isMarked(node) && isCFG(node)) {
                 node.delete();
-                deletedNodeCount++;
             }
         }
     }
@@ -126,7 +123,6 @@
         for (Node node : graph.getNodes()) {
             if (node != Node.Null && !worklist.isMarked(node) && !isCFG(node)) {
                 node.delete();
-                deletedNodeCount++;
             }
         }
     }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java	Wed Jun 08 14:10:06 2011 +0200
@@ -51,18 +51,18 @@
 public final class GraphBuilderPhase extends Phase {
 
     /**
-     * The minimum value to which {@link C1XOptions#TraceBytecodeParserLevel} must be set to trace
+     * The minimum value to which {@link GraalOptions#TraceBytecodeParserLevel} must be set to trace
      * the bytecode instructions as they are parsed.
      */
     public static final int TRACELEVEL_INSTRUCTIONS = 1;
 
     /**
-     * The minimum value to which {@link C1XOptions#TraceBytecodeParserLevel} must be set to trace
+     * The minimum value to which {@link GraalOptions#TraceBytecodeParserLevel} must be set to trace
      * the frame state before each bytecode instruction as it is parsed.
      */
     public static final int TRACELEVEL_STATE = 2;
 
-    private final C1XCompilation compilation;
+    private final GraalCompilation compilation;
     private CompilerGraph graph;
 
     private final CiStatistics stats;
@@ -108,13 +108,13 @@
      * @param ir the IR to build the graph into
      * @param graph
      */
-    public GraphBuilderPhase(C1XCompilation compilation, RiMethod method, boolean createUnwind) {
+    public GraphBuilderPhase(GraalCompilation compilation, RiMethod method, boolean createUnwind) {
         this.compilation = compilation;
 
         this.runtime = compilation.runtime;
         this.method = method;
         this.stats = compilation.stats;
-        this.log = C1XOptions.TraceBytecodeParserLevel > 0 ? new LogStream(TTY.out()) : null;
+        this.log = GraalOptions.TraceBytecodeParserLevel > 0 ? new LogStream(TTY.out()) : null;
         this.stream = new BytecodeStream(method.code());
 
         this.constantPool = runtime.getConstantPool(method);
@@ -292,7 +292,7 @@
                 ((StateSplit) first).setStateBefore(duplicate);
             }
         } else {
-            if (!C1XOptions.AssumeVerifiedBytecode && !existingState.isCompatibleWith(newState)) {
+            if (!GraalOptions.AssumeVerifiedBytecode && !existingState.isCompatibleWith(newState)) {
                 // stacks or locks do not match--bytecodes would not verify
                 TTY.println(existingState.toString());
                 TTY.println(newState.duplicate(0).toString());
@@ -847,7 +847,7 @@
     private void genInvokeStatic(RiMethod target, int cpi, RiConstantPool constantPool) {
         RiType holder = target.holder();
         boolean isInitialized = target.isResolved() && holder.isInitialized();
-        if (!isInitialized && C1XOptions.ResolveClassBeforeStaticInvoke) {
+        if (!isInitialized && GraalOptions.ResolveClassBeforeStaticInvoke) {
             // Re-use the same resolution code as for accessing a static field. Even though
             // the result of resolution is not used by the invocation (only the side effect
             // of initialization is required), it can be commoned with static field accesses.
@@ -967,7 +967,7 @@
         if (needsCheck) {
             // append a call to the finalizer registration
             append(new RegisterFinalizer(frameState.loadLocal(0), frameState.create(bci()), graph));
-            C1XMetrics.InlinedFinalizerChecks++;
+            GraalMetrics.InlinedFinalizerChecks++;
         }
     }
 
@@ -1082,7 +1082,7 @@
         lastInstr.setNext(x);
 
         lastInstr = x;
-        if (++stats.nodeCount >= C1XOptions.MaximumInstructionCount) {
+        if (++stats.nodeCount >= GraalOptions.MaximumInstructionCount) {
             // bailout if we've exceeded the maximum inlining size
             throw new CiBailout("Method and/or inlining is too large");
         }
@@ -1273,7 +1273,7 @@
     }
 
     private void traceState() {
-        if (C1XOptions.TraceBytecodeParserLevel >= TRACELEVEL_STATE && !TTY.isSuppressed()) {
+        if (GraalOptions.TraceBytecodeParserLevel >= TRACELEVEL_STATE && !TTY.isSuppressed()) {
             log.println(String.format("|   state [nr locals = %d, stack depth = %d, method = %s]", frameState.localsSize(), frameState.stackSize(), method));
             for (int i = 0; i < frameState.localsSize(); ++i) {
                 Value value = frameState.localAt(i);
@@ -1504,7 +1504,7 @@
     }
 
     private void traceInstruction(int bci, int opcode, boolean blockStart) {
-        if (C1XOptions.TraceBytecodeParserLevel >= TRACELEVEL_INSTRUCTIONS && !TTY.isSuppressed()) {
+        if (GraalOptions.TraceBytecodeParserLevel >= TRACELEVEL_INSTRUCTIONS && !TTY.isSuppressed()) {
             StringBuilder sb = new StringBuilder(40);
             sb.append(blockStart ? '+' : '|');
             if (bci < 10) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Wed Jun 08 14:10:06 2011 +0200
@@ -36,14 +36,14 @@
 
 public class InliningPhase extends Phase {
 
-    private final C1XCompilation compilation;
+    private final GraalCompilation compilation;
     private final IR ir;
 
     private final Queue<Invoke> invokes = new ArrayDeque<Invoke>();
     private final Queue<RiMethod> methods = new ArrayDeque<RiMethod>();
     private int inliningSize;
 
-    public InliningPhase(C1XCompilation compilation, IR ir) {
+    public InliningPhase(GraalCompilation compilation, IR ir) {
         this.compilation = compilation;
         this.ir = ir;
     }
@@ -57,7 +57,7 @@
     @Override
     protected void run(Graph graph) {
         inliningSize = compilation.method.code().length;
-        int iterations = C1XOptions.MaximumRecursiveInlineLevel;
+        int iterations = GraalOptions.MaximumRecursiveInlineLevel;
         do {
             for (Node node : graph.getNodes()) {
                 if (node instanceof Invoke) {
@@ -74,7 +74,7 @@
                         RiMethod concrete = invoke.target.holder().uniqueConcreteMethod(invoke.target);
                         if (concrete != null && concrete.isResolved() && !Modifier.isNative(concrete.accessFlags())) {
                             if (checkInliningConditions(concrete)) {
-                                if (C1XOptions.TraceInlining) {
+                                if (GraalOptions.TraceInlining) {
                                     System.out.println("registering concrete method assumption...");
                                 }
                                 compilation.assumptions.recordConcreteMethod(invoke.target, concrete);
@@ -82,7 +82,7 @@
                             }
                         }
                     }
-                    if (inliningSize > C1XOptions.MaximumInstructionCount) {
+                    if (inliningSize > GraalOptions.MaximumInstructionCount) {
                         break;
                     }
                 }
@@ -100,13 +100,10 @@
             }
             DeadCodeEliminationPhase dce = new DeadCodeEliminationPhase();
             dce.apply(graph);
-            if (dce.deletedNodeCount > 0) {
-                ir.verifyAndPrint("After dead code elimination");
-            }
             ir.verifyAndPrint("After inlining iteration");
 
-            if (inliningSize > C1XOptions.MaximumInstructionCount) {
-                if (C1XOptions.TraceInlining) {
+            if (inliningSize > GraalOptions.MaximumInstructionCount) {
+                if (GraalOptions.TraceInlining) {
                     System.out.println("inlining stopped: MaximumInstructionCount reached");
                 }
                 break;
@@ -117,7 +114,7 @@
     private boolean checkInliningConditions(Invoke invoke) {
         String name = invoke.id() + ": " + CiUtil.format("%H.%n(%p):%r", invoke.target, false);
         if (invoke.predecessors().size() == 0) {
-            if (C1XOptions.TraceInlining) {
+            if (GraalOptions.TraceInlining) {
                 System.out.println("not inlining " + name + " because the invoke is dead code");
             }
             return false;
@@ -127,17 +124,17 @@
 
     private boolean checkInliningConditions(RiMethod method) {
         String name = null;
-        if (C1XOptions.TraceInlining) {
+        if (GraalOptions.TraceInlining) {
             name = CiUtil.format("%H.%n(%p):%r", method, false) + " (" + method.code().length + " bytes)";
         }
-        if (method.code().length > C1XOptions.MaximumInlineSize) {
-            if (C1XOptions.TraceInlining) {
+        if (method.code().length > GraalOptions.MaximumInlineSize) {
+            if (GraalOptions.TraceInlining) {
                 System.out.println("not inlining " + name + " because of code size");
             }
             return false;
         }
         if (!method.holder().isInitialized()) {
-            if (C1XOptions.TraceInlining) {
+            if (GraalOptions.TraceInlining) {
                 System.out.println("not inlining " + name + " because of non-initialized class");
             }
             return false;
@@ -150,7 +147,7 @@
         FrameState stateAfter = invoke.stateAfter();
         Instruction exceptionEdge = invoke.exceptionEdge();
 
-        if (C1XOptions.TraceInlining) {
+        if (GraalOptions.TraceInlining) {
             System.out.printf("Building graph for %s, locals: %d, stack: %d\n", name, method.maxLocals(), method.maxStackSize());
         }
 
@@ -196,7 +193,7 @@
             }
         }
 
-        if (C1XOptions.TraceInlining) {
+        if (GraalOptions.TraceInlining) {
             ir.printGraph("Subgraph " + CiUtil.format("%H.%n(%p):%r", method, false), graph);
             System.out.println("inlining " + name + ": " + frameStates.size() + " frame states, " + nodes.size() + " nodes");
         }
@@ -278,7 +275,7 @@
             }
         }
 
-        if (C1XOptions.TraceInlining) {
+        if (GraalOptions.TraceInlining) {
             ir.verifyAndPrint("After inlining " + CiUtil.format("%H.%n(%p):%r", method, false));
         }
     }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/Schedule.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/Schedule.java	Wed Jun 08 14:10:06 2011 +0200
@@ -127,7 +127,7 @@
                 } else {
                     // We have a single predecessor => check its successor count.
                     if (isBlockEnd(singlePred)) {
-                        Block b = assignBlock(n);
+                        assignBlock(n);
                         blockBeginNodes.add(n);
                     } else {
                         assignBlock(n, nodeToBlock.get(singlePred));
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/Backend.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/Backend.java	Wed Jun 08 14:10:06 2011 +0200
@@ -34,22 +34,22 @@
 import com.sun.cri.xir.*;
 
 /**
- * The {@code Backend} class represents a compiler backend for C1X.
+ * The {@code Backend} class represents a compiler backend for Graal.
  *
  * @author Ben L. Titzer
  */
 public abstract class Backend {
-    public final C1XCompiler compiler;
+    public final GraalCompiler compiler;
 
-    protected Backend(C1XCompiler compiler) {
+    protected Backend(GraalCompiler compiler) {
         this.compiler = compiler;
     }
 
-    public static Backend create(CiArchitecture arch, C1XCompiler compiler) {
+    public static Backend create(CiArchitecture arch, GraalCompiler compiler) {
         String className = arch.getClass().getName().replace("com.oracle.max.asm", "com.oracle.max.graal.compiler") + "Backend";
         try {
             Class<?> c = Class.forName(className);
-            Constructor<?> cons = c.getDeclaredConstructor(C1XCompiler.class);
+            Constructor<?> cons = c.getDeclaredConstructor(GraalCompiler.class);
             return (Backend) cons.newInstance(compiler);
         } catch (Exception e) {
             throw new Error("Could not instantiate " + className, e);
@@ -57,8 +57,8 @@
     }
 
     public abstract FrameMap newFrameMap(RiMethod method, int numberOfLocks);
-    public abstract LIRGenerator newLIRGenerator(C1XCompilation compilation);
-    public abstract LIRAssembler newLIRAssembler(C1XCompilation compilation);
+    public abstract LIRGenerator newLIRGenerator(GraalCompilation compilation);
+    public abstract LIRAssembler newLIRAssembler(GraalCompilation compilation);
     public abstract AbstractAssembler newAssembler(RiRegisterConfig registerConfig);
     public abstract GlobalStubEmitter newGlobalStubEmitter();
     public abstract CiXirAssembler newXirAssembler();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java	Wed Jun 08 14:10:06 2011 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.oracle.max.graal.compiler.C1XCompilation.*;
+import static com.oracle.max.graal.compiler.GraalCompilation.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
@@ -41,7 +41,7 @@
  */
 public class AMD64Backend extends Backend {
 
-    public AMD64Backend(C1XCompiler compiler) {
+    public AMD64Backend(GraalCompiler compiler) {
         super(compiler);
     }
     /**
@@ -50,7 +50,7 @@
      * @return an appropriate LIR generator instance
      */
     @Override
-    public LIRGenerator newLIRGenerator(C1XCompilation compilation) {
+    public LIRGenerator newLIRGenerator(GraalCompilation compilation) {
         return new AMD64LIRGenerator(compilation);
     }
 
@@ -60,7 +60,7 @@
      * @return an appropriate LIR assembler instance
      */
     @Override
-    public LIRAssembler newLIRAssembler(C1XCompilation compilation) {
+    public LIRAssembler newLIRAssembler(GraalCompilation compilation) {
         return new AMD64LIRAssembler(compilation);
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64GlobalStubEmitter.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64GlobalStubEmitter.java	Wed Jun 08 14:10:06 2011 +0200
@@ -59,12 +59,12 @@
     private int registerRestoreEpilogueOffset;
 
     private RiRuntime runtime;
-    private C1XCompiler compiler;
+    private GraalCompiler compiler;
     private CiRegister[] registersSaved;
 
     private boolean savedAllRegisters;
 
-    public AMD64GlobalStubEmitter(C1XCompiler compiler) {
+    public AMD64GlobalStubEmitter(GraalCompiler compiler) {
         this.compiler = compiler;
         this.target = compiler.target;
         this.runtime = compiler.runtime;
@@ -156,7 +156,7 @@
     }
 
     public GlobalStub emit(XirTemplate template, RiRuntime runtime) {
-        C1XCompilation compilation = new C1XCompilation(compiler, null, -1, null);
+        GraalCompilation compilation = new GraalCompilation(compiler, null, -1, null);
         try {
             return emit(template, compilation);
         } finally {
@@ -164,7 +164,7 @@
         }
     }
 
-    public GlobalStub emit(XirTemplate template, C1XCompilation compilation) {
+    public GlobalStub emit(XirTemplate template, GraalCompilation compilation) {
         reset(template.resultOperand.kind, getArgumentKinds(template));
         compilation.initFrameMap(0);
         compilation.frameMap().setFrameSize(frameSize());
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRAssembler.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRAssembler.java	Wed Jun 08 14:10:06 2011 +0200
@@ -64,7 +64,7 @@
     final int wordSize;
     final CiRegister rscratch1;
 
-    public AMD64LIRAssembler(C1XCompilation compilation) {
+    public AMD64LIRAssembler(GraalCompilation compilation) {
         super(compilation);
         masm = (AMD64MacroAssembler) asm;
         target = compilation.target;
@@ -148,7 +148,7 @@
 
     @Override
     public void emitTraps() {
-        for (int i = 0; i < C1XOptions.MethodEndBreakpointGuards; ++i) {
+        for (int i = 0; i < GraalOptions.MethodEndBreakpointGuards; ++i) {
             masm.int3();
         }
     }
@@ -411,7 +411,7 @@
     protected void emitReadPrefetch(CiValue src) {
         CiAddress addr = (CiAddress) src;
         // Checkstyle: off
-        switch (C1XOptions.ReadPrefetchInstr) {
+        switch (GraalOptions.ReadPrefetchInstr) {
             case 0  : masm.prefetchnta(addr); break;
             case 1  : masm.prefetcht0(addr); break;
             case 2  : masm.prefetcht2(addr); break;
@@ -1092,7 +1092,7 @@
 
             Label continuation = new Label();
 
-            if (C1XOptions.GenSpecialDivChecks) {
+            if (GraalOptions.GenSpecialDivChecks) {
                 // check for special case of Integer.MIN_VALUE / -1
                 Label normalCase = new Label();
                 masm.cmpl(AMD64.rax, Integer.MIN_VALUE);
@@ -1140,7 +1140,7 @@
 
         Label continuation = new Label();
 
-        if (C1XOptions.GenSpecialDivChecks) {
+        if (GraalOptions.GenSpecialDivChecks) {
             // check for special case of Long.MIN_VALUE / -1
             Label normalCase = new Label();
             masm.movq(AMD64.rdx, java.lang.Long.MIN_VALUE);
@@ -1344,7 +1344,7 @@
 
     @Override
     protected void emitCallAlignment(LIROpcode code) {
-        if (C1XOptions.AlignCallsForPatching) {
+        if (GraalOptions.AlignCallsForPatching) {
             // make sure that the displacement word of the call ends up word aligned
             int offset = masm.codeBuffer.position();
             offset += compilation.target.arch.machineCodeCallDisplacementOffset;
@@ -1541,7 +1541,7 @@
     @Override
     protected void emitNullCheck(CiValue src, LIRDebugInfo info) {
         assert src.isRegister();
-        if (C1XOptions.NullCheckUniquePc) {
+        if (GraalOptions.NullCheckUniquePc) {
             masm.nop();
         }
         tasm.recordImplicitException(codePos(), info);
@@ -1610,13 +1610,13 @@
     @Override
     protected void emitSlowPath(SlowPath sp) {
         int start = -1;
-        if (C1XOptions.TraceAssembler) {
+        if (GraalOptions.TraceAssembler) {
             TTY.println("Emitting slow path for XIR instruction " + sp.instruction.snippet.template.name);
             start = masm.codeBuffer.position();
         }
         emitXirInstructions(sp.instruction, sp.instruction.snippet.template.slowPath, sp.labels, sp.instruction.getOperands(), sp.marks);
         masm.nop();
-        if (C1XOptions.TraceAssembler) {
+        if (GraalOptions.TraceAssembler) {
             TTY.println("From " + start + " to " + masm.codeBuffer.position());
         }
     }
@@ -1950,7 +1950,7 @@
                     int lastFramePage = frameSize / target.pageSize;
                     // emit multiple stack bangs for methods with frames larger than a page
                     for (int i = 0; i <= lastFramePage; i++) {
-                        int offset = (i + C1XOptions.StackShadowPages) * target.pageSize;
+                        int offset = (i + GraalOptions.StackShadowPages) * target.pageSize;
                         // Deduct 'frameSize' to handle frames larger than the shadow
                         bangStackWithOffset(offset - frameSize);
                     }
@@ -1959,7 +1959,7 @@
                 case PushFrame: {
                     int frameSize = initialFrameSizeInBytes();
                     masm.decrementq(AMD64.rsp, frameSize); // does not emit code for frameSize == 0
-                    if (C1XOptions.ZapStackOnMethodEntry) {
+                    if (GraalOptions.ZapStackOnMethodEntry) {
                         final int intSize = 4;
                         for (int i = 0; i < frameSize / intSize; ++i) {
                             masm.movl(new CiAddress(CiKind.Int, AMD64.rsp.asValue(), i * intSize), 0xC1C1C1C1);
@@ -2100,7 +2100,7 @@
         }
 
         // Clear out parameters
-        if (C1XOptions.GenAssertionCode) {
+        if (GraalOptions.GenAssertionCode) {
             for (int i = 0; i < args.length; i++) {
                 masm.movptr(new CiAddress(CiKind.Word, AMD64.RSP, stub.argOffsets[i]), 0);
             }
@@ -2184,7 +2184,7 @@
     }
 
     protected void stop(String msg) {
-        if (C1XOptions.GenAssertionCode) {
+        if (GraalOptions.GenAssertionCode) {
             // TODO: pass a pointer to the message
             directCall(CiRuntimeCall.Debug, null);
             masm.hlt();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Wed Jun 08 14:10:06 2011 +0200
@@ -60,7 +60,7 @@
 
     protected static final CiValue ILLEGAL = CiValue.IllegalValue;
 
-    public AMD64LIRGenerator(C1XCompilation compilation) {
+    public AMD64LIRGenerator(GraalCompilation compilation) {
         super(compilation);
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java	Wed Jun 08 14:10:06 2011 +0200
@@ -367,7 +367,7 @@
 
     /**
      * Determines if the kinds of two given IR nodes are equal at the {@linkplain #archKind(CiKind) architecture}
-     * level in the context of the {@linkplain C1XCompilation#compilation()} compilation.
+     * level in the context of the {@linkplain GraalCompilation#compilation()} compilation.
      */
     public static boolean archKindsEqual(Value i, Value other) {
         return archKindsEqual(i.kind, other.kind);
@@ -375,20 +375,20 @@
 
     /**
      * Determines if two given kinds are equal at the {@linkplain #archKind(CiKind) architecture} level
-     * in the context of the {@linkplain C1XCompilation#compilation()} compilation.
+     * in the context of the {@linkplain GraalCompilation#compilation()} compilation.
      */
     public static boolean archKindsEqual(CiKind k1, CiKind k2) {
-        C1XCompilation compilation = C1XCompilation.compilation();
+        GraalCompilation compilation = GraalCompilation.compilation();
         assert compilation != null : "missing compilation context";
         return compilation.archKindsEqual(k1, k2);
     }
 
     /**
-     * Translates a given kind to a {@linkplain C1XCompilation#archKind(CiKind) canonical architecture}
-     * kind in the context of the {@linkplain C1XCompilation#compilation() current} compilation.
+     * Translates a given kind to a {@linkplain GraalCompilation#archKind(CiKind) canonical architecture}
+     * kind in the context of the {@linkplain GraalCompilation#compilation() current} compilation.
      */
     public static CiKind archKind(CiKind kind) {
-        C1XCompilation compilation = C1XCompilation.compilation();
+        GraalCompilation compilation = GraalCompilation.compilation();
         assert compilation != null : "missing compilation context";
         return compilation.archKind(kind);
     }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/value/FrameState.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/value/FrameState.java	Wed Jun 08 14:10:06 2011 +0200
@@ -97,8 +97,8 @@
         this.localsSize = localsSize;
         this.stackSize = stackSize;
         this.locksSize = locksSize;
-        C1XMetrics.FrameStatesCreated++;
-        C1XMetrics.FrameStateValuesCreated += localsSize + stackSize + locksSize;
+        GraalMetrics.FrameStatesCreated++;
+        GraalMetrics.FrameStateValuesCreated += localsSize + stackSize + locksSize;
     }
 
     FrameState(RiMethod method, int bci, Value[] locals, Value[] stack, int stackSize, ArrayList<Value> locks, Graph graph) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.doc.initial/.project	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>com.oracle.max.graal.doc.initial</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>net.sourceforge.texlipse.builder.TexlipseBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>net.sourceforge.texlipse.builder.TexlipseNature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>fleqn.clo</name>
+			<type>1</type>
+			<location>C:/Program Files (x86)/MiKTeX 2.8/tex/latex/base/fleqn.clo</location>
+		</link>
+	</linkedResources>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.doc.initial/.texlipse	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,13 @@
+#TeXlipse project settings
+#Fri Apr 29 14:13:11 CEST 2011
+builderNum=2
+outputDir=
+makeIndSty=
+bibrefDir=
+outputFormat=pdf
+tempDir=tmp
+mainTexFile=graal_compiler.tex
+outputFile=graal_compiler.pdf
+langSpell=en
+markDer=true
+srcDir=
Binary file graal/com.oracle.max.graal.doc.initial/graal_compiler.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.doc.initial/graal_compiler.tex	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,846 @@
+\documentclass[twocolumn]{svjour3}
+\usepackage{listings}
+\usepackage[pdftex]{graphicx}
+\usepackage{environ}
+\usepackage{amsmath}
+\usepackage{amsfonts}
+\usepackage[english]{babel}
+\usepackage[utf8]{inputenc} 
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage{color}
+
+\input{graphdrawing}
+
+\renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bf #1}
+
+\newcommand{\Sa}{{\Large$^*$}}
+\newcommand{\Sb}{{\Large$^\dag$}}
+\newcommand{\Sc}{{\Large$^\S$}}
+
+
+\newcommand{\mynote}[2]{
+\textcolor{red}{\fbox{\bfseries\sffamily\scriptsize#1}
+  {\small\textsf{\emph{#2}}}
+\fbox{\bfseries\sffamily\scriptsize }}}
+
+\newcommand\TODO[1]{\mynote{TODO}{#1}}
+\newcommand\cw[1]{\mynote{CW}{#1}}
+\newcommand\ls[1]{\mynote{LS}{#1}}
+\newcommand\nodename[1]{\texttt{#1}}
+
+
+
+\smartqed  % flush right qed marks, e.g. at end of proof
+
+\journalname{Graal Compiler Design}
+\def\makeheadbox{{%
+\hbox to0pt{\vbox{\baselineskip=10dd\hrule\hbox
+to\hsize{\vrule\kern3pt\vbox{\kern3pt
+\hbox{\bfseries The Graal Compiler - Design and Strategy}
+\kern3pt}\hfil\kern3pt\vrule}\hrule}%
+\hss}}}
+
+\begin{document}
+
+\author{Thomas W\"{u}rthinger \Sa, Lukas Stadler \Sc, Gilles Duboscq \Sa}
+\institute{\Sa Oracle, \Sc Johannes Kepler University, Linz}
+
+\date{Created: \today}
+
+\title{The Graal Compiler}
+\subtitle{Design and Strategy \\ \textcolor{red}{work in progress (Oracle internal)}}
+
+\maketitle
+
+\abstract{
+The Graal compiler (simply referred to as \emph{the compiler} in the rest of this document) aims at improving upon C1X, the Java port of the HotSpot client compiler, both in terms of modularity and peak performance.
+The compiler should work with the Maxine VM and the HotSpot VM.
+This document contains information about the proposed design and strategy for developing the compiler.}
+
+\section{Context}
+
+In 2009, the Maxine team started with creating C1X, a Java port of the HotSpot client compiler, and integrated it into the Maxine VM.
+Part of this effort was the development of a clear and clean compiler-runtime interface that allows the separation of the compiler and the VM.
+This compiler-runtime interface enables the use of one compiler for multiple VMs.
+In June 2010, we started integrating C1X into the HotSpot VM and we called the resulting system Graal~VM.
+Currently, the Graal~VM is fully functional and runs benchmarks (SciMark, DaCapo) at a similar speed as the HotSpot client compiler.
+
+\section{Goals}
+The compiler effort aims at rewriting the high-level intermediate representation of C1X with two main goals:
+\begin{description}
+\item[Modularity:] A modular design of the compiler should simplify the implementation of new languages, new back-ends, and new optimizations.
+\item[Peak Performance:] A more powerful intermediate representation should enable the implementation of aggressive optimizations that impact the peak performance of the resulting machine code.
+\end{description}
+
+\section{Design}
+For the implementation of the compiler, we rely on the following design decisions:
+\begin{description}
+\item[Graph Representation:]
+The compiler's intermediate representation is modeled as a graph with nodes that are connected with directed edges.
+There is only a single node base class and every node has an associated graph object that does not change during the node's lifetime.
+Every node is serializable and has an id that is unique within its graph.
+Every edge is classified as either a control flow edge (anti-dependency) or a data flow edge (dependency) and represented as a simple pointer from the source node to the target node.
+It is possible to replace a node with another node without traversing the full graph.
+The graph does not allow data flow edge cycles or control flow edge cycles.
+We achieve this by explicitly modeling loops (see Section~\ref{sec:loops}). 
+\item[Extensibility:]
+The compiler is extensible by allowing developers to add new compiler phases and new node subclasses without modifying the compiler's sources.
+A node has an abstract way of expressing its semantics and new compiler phases can ask compiler nodes for their properties and capabilities.
+We use the ``everything is an extension'' concept.
+Even standard compiler optimizations are internally modeled as extensions, to show that the extension mechanism exposes all necessary functionality.
+\item[Detailing:]
+The compilation starts with a graph that contains nodes that represent the operations of the source language (e.g., one node for an array store to an object array).
+During the compilation, the nodes are replaced with more detailed nodes (e.g., the array store node is split into a null check, a bounds check, a store check, and a memory access).
+Compiler phases can choose whether they want to work on the earlier versions of the graph (e.g., escape analysis) or on later versions (e.g., null check elimination).
+\item[Generality:]
+The compiler does not require Java as its input.
+This is achieved by having a graph as the starting point of the compilation and not a Java bytecode array.
+Building the graph from the Java bytecodes must happen before giving a method to the compiler.
+This enables front-ends for different languages (e.g., Ruby or JavaScript) to provide their own graph.
+Also, there is no dependency on a specific back-end, but the output of the compiler is a graph that can then be converted to a different representation in a final compiler phase.
+\end{description}
+
+\section{Milestones}
+\label{sec:mile}
+The compiler is being developed starting from the current C1X source code base.
+This helps us test the compiler at every intermediate development step on a variety of Java benchmarks.
+We define the following development milestones (see Section~\ref{sec:conclusions} for planned dates):
+\begin{description}
+\item[M1:] We have a fully working Graal~VM version with a stripped down C1X compiler that does not perform any optimization.
+\item[M2:] We modified the high-level intermediate representation to be based on the compiler graph data structure.
+\item[M3:] We have reimplemented and reenabled compiler optimizations in the compiler that previously existed in C1X.
+\item[M4:] We have reintegrated the new compiler into the Maxine VM and can use it as a Maxine VM bootstrapping compiler.
+\end{description}
+
+After those four milestones, we see three different possible further development directions that can be followed in parallel:
+\begin{itemize}
+  \item Removal of the XIR template mechanism and replacement with a snippet mechanism that works with the compiler graph.
+  \item Improvements for peak performance (loop optimizations, escape analysis, bounds check elimination, processing additional interpreter runtime feedback).
+  \item Implementation of a prototype front-end for a different language, e.g., JavaScript.
+\end{itemize}
+
+\section{Project Source Structure}
+In order to support the goal of a modular compiler, the code will be divided into the following source code projects (as subprojects of \textbf{com.oracle.max.graal}).
+
+\begin{description}
+    \item[graph] contains the abstract node implementation, the graph implementation and all the associated tools and auxiliary classes.
+    \item[nodes] contains the implementation of known basic nodes (e.g., phi nodes, control flow nodes, \ldots).
+ 				 Additional node classes should go into separate projects and be specializations of the known basic nodes.
+    \item[java] contains code for building graphs from Java bytecodes and Java-specific nodes.
+    \item[opt] contains optimizations such as global value numbering or conditional constant propagation.
+    \item[compiler] contains the compiler, including:
+        \begin{itemize}
+            \item Scheduling of the compilation phases.
+            \item Implementation of the \emph{compiler interface} (CI).
+            \item Implementation of the final compilation phase that produces the low-level representation.
+            \item Machine code creation, including debug info.
+        \end{itemize}
+\end{description}
+
+
+\section{Graph}
+
+The \emph{intermediate representation}~(IR) of the compiler is designed as a directed graph.
+The graph allocates unique ids for new nodes and can be queried for the node corresponding to a given id as well as for an unordered list of nodes of the graph.
+Graphs can manage side data structures (e.g. dominator trees and temporary schedules), which will be automatically invalidated and lazily recomputed whenever the graph changes. These side data structures will usually be understood by more than one optimization.
+
+The nodes of the graph have the following properties:
+\begin{itemize}
+    \item Each node is always associated with a single graph and this association is immutable.
+    \item Each node has an immutable id that is unique within its associated graph.
+    \item Nodes can have a data dependency, which means that one node requires the result of another node as its input. The fact that the result of the first node needs to be computed before the second node can be executed introduces a partial order to the set of nodes.
+    \item Nodes can have a control flow dependency, which means that the execution of one node will be followed by the execution of another node. This includes conditional execution, memory access serialization and other reasons, and again introduces a partial order to the set of nodes.
+    \item Nodes can only have data and control dependencies to nodes which belong to the same graph.
+    \item Control dependencies and data dependencies each represent a \emph{directed acyclic graph} (DAG) on the same set of nodes. This means that data dependencies always point upwards, and control dependencies always point downwards in a drawing of the graph. Situations that normally incur cycles (like loops) are represented by special nodes (see Section~\ref{sec:loops}).
+	\item Ordering between nodes is specified only to the extent which is required to correctly express the semantics of a given program. This gives the compiler flexibility for the possible scheduling of a node and therefore wiggle room for optimizations. For algorithms that require a fixed ordering of nodes, a temporary schedule can always be generated.
+    \item Both data and control dependencies can be traversed in both directions, so that each node can be traversed in four directions (see Figure~\ref{fig:directions}):
+    \begin{itemize}
+        \item \emph{inputs} are all nodes that this node has data dependencies on.
+        \item \emph{usages} are all nodes whose inputs contain this node.
+        \item \emph{successors} are all nodes that have to be after this node in control flow.
+        \item \emph{predecessors} are all nodes whose successors contain this node.
+    \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 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]
+  \centering
+\begin{digraphenv}{scale=0.5}{graphdirections}
+\node{node1}{Node}
+\textnode{inputs}{inputs}
+\textnode{usages}{usages}
+\textnode{successors}{successors}
+\textnode{predecessors}{predecessors}
+\data{node1}{inputs}
+\control{node1}{successors}
+\data{usages}{node1}
+\control{predecessors}{node1}
+\node{node2}{Node}
+\textnode{before}{happens-before}
+\textnode{after}{happens-after}
+\data{node2}{before}
+\control{node2}{after}
+\data{after}{node2}
+\control{before}{node2}
+\end{digraphenv}
+  \caption{A node and its edges.}
+  \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.
+We reserve the term \textit{instruction} for nodes that are embedded in the control flow.
+This is opposite to the approach taken in the server compiler, where control flow and data flow edges point in the same direction.
+The advantage that we see in our approach is that there is no need for projection nodes in case of control flow splits.
+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.
+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]
+if (condition) { return 0; }
+else { return 1; }
+\end{lstlisting}
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{cfg2}
+\textnode{entry}{Entry}
+\textnode{condition}{condition}
+\textnode{const0}{0}
+\textnode{const1}{1}
+\nodesplit{if}{If}
+\control{entry}{if}
+\controllabel{if:succ1}{merge}
+\controllabel{if:succ2}{merge}
+\data{if}{condition}
+\node{merge}{Merge}
+\node{return}{Return}
+\nodetri{phi}{Phi}
+\datalabel{phi:in1}{merge}
+\datalabel{phi:in2}{const0}
+\datalabel{phi:in3}{const1}
+\data{return}{phi}
+\control{merge}{return}
+\end{digraphenv}
+  \caption{A simple loop with two exits.}
+  \label{fig:exc1}
+\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.
+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.
+
+There are only two kinds of instruction that need explicit exception edges, because they are the only instructions that can throw exceptions in compiled code: \texttt{Throw} instructions and \texttt{Invoke} instructions.
+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.
+
+\begin{lstlisting}[label=lst:exc1, caption=Exception dispatch in the compiler graph., captionpos=b]
+try { m1();
+  try { m2();
+  } catch(ExtendedException e) { ... }
+  m3();
+  throw exception;
+} catch(Exception e) { ... }
+\end{lstlisting}
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{exc1}
+\textnode{entry}{Entry}
+\textnode{catch1}{catch1}
+\textnode{catch2}{catch2}
+\nodesplit{m1}{Invoke m1}
+\nodesplit{m2}{Invoke m2}
+\nodesplit{m3}{Invoke m3}
+\nodesplit{dispatch1}{ExceptionDispatch}
+\nodesplit{dispatch2}{ExceptionDispatch}
+\node{throw}{Throw}
+\node{unwind}{Unwind}
+\control{entry}{m1}
+\controllabel{m1:succ1}{m2}
+\controllabel{m1:succ2}{dispatch2}
+\controllabel{m2:succ1}{m3}
+\controllabel{m2:succ2}{dispatch1}
+\controllabel{m3:succ1}{throw}
+\controllabel{m3:succ2}{dispatch2}
+\control{throw}{dispatch2}
+\controllabel{dispatch1:succ2}{catch1}
+\controllabel{dispatch1:succ1}{dispatch2}
+\controllabel{dispatch2:succ2}{catch2}
+\controllabel{dispatch2:succ1}{unwind}
+\end{digraphenv}
+  \caption{A simple loop with two exits.}
+  \label{fig:exc1}
+\end{figure}
+
+\section{Loops}
+\label{sec:loops}
+Loops form a first-class construct in the IR that is expressed by specialized IR nodes during all optimization phases.
+We only compile methods with a control flow where every loop has a single entry point.
+This entry point is a \nodename{LoopBegin} instruction.
+This instruction is connected to a \nodename{LoopEnd} instruction that merges all control flow paths that do not exit the loop.
+The edge between the \nodename{LoopBegin} and the \nodename{LoopEnd} is the backedge of the loop.
+It goes from the beginning to the end in order to make the graph acyclic.
+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]
+  \centering
+\begin{digraphenv}{scale=0.5}{layout1}
+\textnode{BeforeLoop}{Loop entry}
+\textnode{Exit1}{First loop exit}
+\textnode{Exit2}{Second loop exit}
+\nodesplit{LoopBegin}{LoopBegin}
+\node{LoopEnd}{LoopEnd}
+\nodesplit{If1}{If}
+\nodesplit{If2}{If}
+\controllabel{LoopBegin:succ1}{LoopEnd}
+\controllabel{LoopBegin:succ2}{If1}
+\controllabel{If1:succ1}{If2}
+\controllabel{If2:succ1}{LoopEnd}
+\controllabel{BeforeLoop}{LoopBegin}
+\controllabel{If1:succ2}{Exit1}
+\controllabel{If2:succ2}{Exit2}
+\end{digraphenv}
+  \caption{A simple loop with two exits.}
+  \label{fig:loop1}
+\end{figure}
+
+\subsection{Loop Phis}
+Data flow in loops is modeled 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.
+
+\begin{lstlisting}[label=lst:loop, caption=Loop example that counts from 0 to n-1., captionpos=b]
+for(int i=0; i<n; ++i) { }
+\end{lstlisting}
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{layout2}
+\textnode{BeforeLoop}{Loop entry}
+\textnode{Exit}{Loop exit}
+\textnode{n}{n}
+\textnode{Constant0}{0}
+\textnode{Constant1}{1}
+\nodesplit{LoopBegin}{LoopBegin}
+\node{LoopEnd}{LoopEnd}
+\nodesplit{If1}{If}
+\controllabel{LoopBegin:succ1}{LoopEnd}
+\controllabel{LoopBegin:succ2}{If1}
+\nodebi{Compare}{&lt;}
+\nodebi{LoopBeginPhi}{LoopBeginPhi}
+\nodebi{Add}{+}
+\datalabel{Add:in1}{LoopBeginPhi}
+\datalabel{Add:in2}{Constant1}
+\nodebi{LoopEndPhi}{LoopEndPhi}
+\control{LoopBeginPhi}{LoopEndPhi}
+\data{LoopEndPhi:in1}{LoopEnd}
+\data{LoopEndPhi:in2}{Add}
+\datalabel{LoopBeginPhi:in1}{LoopBegin}
+\datalabel{LoopBeginPhi:in2}{Constant0}
+\datalabel{Compare:in1}{LoopBeginPhi}
+\datalabel{Compare:in2}{n}
+\data{If1}{Compare}
+\controllabel{If1:succ1}{LoopEnd}
+\controllabel{BeforeLoop}{LoopBegin}
+\controllabel{If1:succ2}{Exit}
+\end{digraphenv}
+  \caption{Graph for a loop counting from 0 to n-1.}
+  \label{fig:loop2}
+\end{figure}
+
+\subsection{Loop Counters}
+The compiler is capable of recognizing variables that are only increased within a loop.
+A potential overflow of such a variable is prohibited with a guard before the loop (this is not necessary in this example, because the loop variable cannot overflow).
+Figure \ref{fig:loop3} shows the compiler graph of the example loop after the loop counter transformation.
+
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{layout3}
+\textnode{BeforeLoop}{Loop entry}
+\textnode{Exit}{Loop exit}
+\textnode{n}{n}
+\textnode{Constant0}{0}
+\textnode{Constant1}{1}
+\nodesplit{LoopBegin}{LoopBegin}
+\node{LoopEnd}{LoopEnd}
+\nodesplit{If1}{If}
+\controllabel{LoopBegin:succ1}{LoopEnd}
+\controllabel{LoopBegin:succ2}{If1}
+\nodebi{Compare}{&lt;}
+\nodetri{LoopCounter}{LoopCounter}
+\datalabel{LoopCounter:in1}{LoopBegin}
+\datalabeltext{LoopCounter:in2}{Constant0}{init}
+\datalabeltext{LoopCounter:in3}{Constant1}{stride}
+\datalabel{Compare:in1}{LoopCounter}
+\datalabel{Compare:in2}{n}
+\data{If1}{Compare}
+\controllabel{If1:succ1}{LoopEnd}
+\controllabel{BeforeLoop}{LoopBegin}
+\controllabel{If1:succ2}{Exit}
+\end{digraphenv}
+  \caption{Graph after loop counter transformation.}
+  \label{fig:loop3}
+\end{figure}
+
+\subsection{Bounded Loops}
+
+If the total maximum number of iterations of a loop is fixed, then the loop is converted into a bounded loop.
+The total number of iterations always denotes the number of full iterations of the loop with the control flowing from the loop begin to the loop end.
+If the total number of iterations is reached, the loop is exited directly from the loop header.
+In the example, we can infer from the loop exit with the comparison on the loop counter that the total number of iterations of the loop is limited to n.
+Figure \ref{fig:loop4} shows the compiler graph of the example loop after the bounded loop transformation.
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{layout4}
+\textnode{BeforeLoop}{Loop entry}
+\textnode{Exit}{Loop exit}
+\textnode{n}{n}
+\textnode{Constant0}{0}
+\textnode{Constant1}{1}
+\nodesplittri{LoopBegin}{BoundedLoopBegin}
+\node{LoopEnd}{LoopEnd}
+\controllabel{LoopBegin:succ1}{LoopEnd}
+\controllabel{LoopBegin:succ2}{LoopEnd}
+\controllabel{LoopBegin:succ3}{Exit}
+\nodetri{LoopCounter}{LoopCounter}
+\datalabel{LoopCounter:in1}{LoopBegin}
+\datalabeltext{LoopCounter:in2}{Constant0}{init}
+\datalabeltext{LoopCounter:in3}{Constant1}{stride}
+\data{LoopBegin}{n}
+\controllabel{BeforeLoop}{LoopBegin}
+\end{digraphenv}
+  \caption{Graph after bounded loop transformation.}
+  \label{fig:loop4}
+\end{figure}
+
+\subsection{Vectorization}
+
+If we have now a bounded loop with no additional loop exit and no associated phi nodes (only associated loop counters), we can vectorize the loop.
+We replace the loop header with a normal instruction that produces a vector of values from 0 to the number of loop iterations minus 1.
+The loop counters are replaced with \texttt{VectorAdd} and \texttt{VectorMul} nodes.
+The vectorization is only possible if every node of the loop can be replaced with a corresponding vector node.
+Figure \ref{fig:loop5} shows the compiler graph of the example loop after vectorization.
+The vector nodes all work on an ordered list of integer values and are subject to canonicalization and global value numbering like any other node.
+
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{layout5}
+\textnode{Entry}{Entry}
+\textnode{Exit}{Exit}
+\textnode{n}{n}
+\textnode{Constant0}{0}
+\textnode{Constant1}{1}
+\node{Vector}{Vector}
+\nodebi{VectorAdd}{VectorAdd}
+\nodebi{VectorMul}{VectorMul}
+\control{Entry}{Vector}
+\control{Vector}{Exit}
+\datalabel{VectorAdd:in1}{Vector}
+\datalabel{VectorAdd:in2}{Constant0}
+\datalabel{VectorMul:in1}{VectorAdd}
+\datalabel{VectorMul:in2}{Constant1}
+\data{Vector}{n}
+\end{digraphenv}
+  \caption{Graph after vectorization.}
+  \label{fig:loop5}
+\end{figure}
+
+
+\section{Frame States}
+A frame state captures the state of the program like it is seen in by an interpreter of the program.
+The frame state contains the information that is local to the current activation and will therefore disappear during SSA-form constructions or other compiler optimizations.
+For Java, the frame state is defined in terms of the Java bytecode specification (i.e., the values of the local variables, the operand stack, and the locked monitors).
+However, a frame state is not a concept specific to Java (e.g., the Crankshaft JavaScript engine uses frame states in their optimizing compiler to model the values of the AST interpreter).
+
+Frame states are necessary to support the deoptimization of the program, which is the precondition for performing aggressive optimizations that use optimistic assumptions.
+Therefore every point in the optimizing compiler that may revert execution back to the interpreter needs a valid frame state.
+However, the point where the interpreter continues execution need not correspond exactly to the execution position of the compiled code, because many Java bytecode instructions can be safely reexecuted.
+Thus, frame states need only be generated for the states after instructions that cannot be reexecuted, because they modify the state of the program.
+Examples for such instructions are:
+
+\begin{itemize}
+    \item Array stores (in Java bytecodes {\tt IASTORE, LASTORE, FASTORE, \\DASTORE, AASTORE, BASTORE, CASTORE, SASTORE})
+    \item Field stores (in Java bytecodes {\tt PUTSTATIC, PUTFIELD})
+    \item Method calls (in Java bytecodes {\tt INVOKEVIRTUAL, INVOKESPECIAL, \\INVOKESTATIC, INVOKEINTERFACE})
+    \item Synchronization (in Java bytecodes {\tt MONITORENTER, MONITOREXIT})
+\end{itemize}
+
+Within the graph a frame state is represented as a node that is attached to the instruction that caused it to be generated using a control dependency (see Figure~\ref{fig:fs1}).
+Frame states also have data dependencies on the contents of the state: the local variables and the expression stack.
+
+The frame state at the method beginning does not have to be explicitely in the graph, because it can always be reconstructed at a later stage.
+We save the frame state at control flow merges if there is at least one frame state on any control flow path between a node and its immediate dominator.
+
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{fs1}
+    \nodetrisplit{store1}{ArrayStore}
+    \nodebi{load1}{ArrayLoad}
+    \controllabel{store1:succ1}{load1}
+    \nodetrisplit{store2}{FieldStore}
+    \control{load1}{store2}
+    end [shape=plaintext, label="...", width="2.0"]
+    store2:succ1:s -> end:n [color=red];
+    %
+    \nodeframestate{fs1}{FrameState}
+    \controllabel{store1:succ2}{fs1}
+    \nodeframestate{fs2}{FrameState}
+    \controllabel{store2:succ2}{fs2}
+\end{digraphenv}
+  \caption{Simple example using two frame states.}
+  \label{fig:fs1}
+\end{figure}
+
+
+A deoptimization node needs a valid frame state that specifies the location and state where the interpreter should continue.
+The algorithm for constructing frame states makes sure that every possible location in the graph has a well-defined frame state that can be used by a deoptimization instruction.
+Therefore, there are no direct links between the deoptimization instruction and its frame state thus allowing the deoptimization instructions to move freely around.
+
+\subsection{Partial Escape Analysis}
+
+A partial escape analysis can help to further reduce the number of frame states.
+A field or array store does not create a new frame state, when the object that is modified did not have a chance to escape between its creation and the store.
+
+Listing~\ref{lst:escape1} shows an example of a method that creates two \texttt{Point} objects, connects them, and returns them.
+The object allocation of the first \texttt{Point} object does not need a frame state.
+We can always reexecute the \texttt{NEW} bytecode again in the interpreter.
+The \texttt{Point} object allocated by the compiler will then simply disappear after the next garbage collection.
+The following field store is a thread-local memory store, because the \texttt{Point} object did not have any chance to escape.
+Same applies to the assignment of the \texttt{next} field and the third field assignment.
+Therefore, the whole method \texttt{getPoint} does not need an explicit frame state, because at any time during execution of this method, we can deoptimize and continue execution in the interpreter at the first bytecode of the method.
+
+\begin{lstlisting}[label=lst:escape1, caption=Example method that needs no frame state., captionpos=b]
+void getPoint() {
+  Point p = new Point();
+  p.x = 1;
+  p.next = new Point();
+  p.next.x = 2;
+  return p;
+}
+\end{lstlisting}
+
+The reduction of frame states makes it easier for the compiler to perform memory optimizations like memory access coalescing.
+We believe that this reduction on frame states is the key to effective vectorization and other compiler optimizations where compilers of compilers of unmanaged languages have advantages.
+
+\subsection{Guards}
+A guard is a node that deoptimizes based on a conditional expression.
+Guards are not attached to a certain frame state, they can move around freely and will always use the correct frame state when the nodes are scheduled (i.e., the last emitted frame state).
+The node that is guarded by the deoptimization has a data dependency on the guard and the guard in turn has a data dependency on the condition.
+A guard must not be moved above any \texttt{If} nodes.
+Therefore, we use \texttt{Anchor} instructions after a control flow split and a data dependency from the guard to this anchor.
+The anchor is the most distant instruction that is postdominated by the guarded instruction and the guard can be scheduled anywhere between those two nodes.
+This ensures maximum flexibility for the guard instruction and guarantees that we only deoptimize if the control flow would have reached the guarded instruction (without taking exceptions into account).
+
+To illustrate the strengths of this approach, we show the graph for the Java code snippet shown in \ref{lst:guard1}.
+The example looks artificial, but in case of method inlining, this is a pattern that is not unlikely to be present in a normal Java program.
+Figure \ref{fig:guard0} shows the compiler graph for the example method after graph building.
+The field stores are both represented by a single instruction and the null check that is implicitely incorporated in the field store.
+
+\begin{lstlisting}[label=lst:guard1, caption=Example method that demonstrates the strengths of modelling the guards explicitely., captionpos=b]
+void init(Point p) {
+  if (p != null) {
+    p.x = 0;
+  }
+  p.y = 0;
+}
+\end{lstlisting}
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{guard0}
+	\textnode{entry}{Entry}
+    \nodesplit{if}{If}
+    \node{merge}{Merge}
+    \node{return}{Return}
+    \node{cmpnull}{NonNull}
+    \textnode{p}{p}
+	\textnode{const0}{0}
+    \nodebisplit{store1}{FieldStore x}
+    \nodebisplit{store2}{FieldStore y}
+    \nodeframestate{fs1}{FrameState}
+    \nodeframestate{fs2}{FrameState}
+    \datalabel{store1:in1}{p}
+    \datalabel{store2:in1}{p}
+    \datalabel{store1:in2}{const0}
+    \datalabel{store2:in2}{const0}
+    \control{entry}{if}
+    \data{if}{cmpnull}
+    \controllabel{if:succ1}{merge}
+    \controllabel{if:succ2}{store1}
+    \controllabel{store1:succ1}{merge}
+    \controllabel{store1:succ2}{fs1}
+    \control{merge}{store2}
+    \controllabel{store2:succ1}{return}
+    \controllabel{store2:succ2}{fs2}
+    \data{cmpnull}{p}
+\end{digraphenv}
+  \caption{Initial graph with the two field stores.}
+  \label{fig:guard0}
+\end{figure}
+
+Figure~\ref{fig:guard1} shows the example graph at a later compilation phase when the field store instructions are lowered to memory store instructions and explicitely modelled null check guards.
+The guards are attached to anchor instructions that delimit their possible schedule.
+The first guard must not be moved outside the \texttt{if} block; the second guard may be moved before the \texttt{If} instruction, because at this point it is already guaranteed that the second store is executed.
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{guard1}
+	\textnode{entry}{Entry}
+    \node{anchor1}{Anchor}
+    \node{anchor2}{Anchor}
+    \nodesplit{if}{If}
+    \node{merge}{Merge}
+    \node{return}{Return}
+    \node{cmpnull}{NonNull}
+    \textnode{p}{p}
+	\textnode{const0}{0}
+    \nodeguard{guard1}{Guard}
+    \nodeguard{guard2}{Guard}
+    \nodetrisplit{store1}{MemStore 16 (int)}
+    \nodetrisplit{store2}{MemStore 20 (int)}
+    \nodeframestate{fs1}{FrameState}
+    \nodeframestate{fs2}{FrameState}
+    \data{store1:in1}{p}
+    \data{store2:in1}{p}
+    \data{store1:in2}{const0}
+    \data{store2:in2}{const0}
+    \data{store1:in3}{guard1}
+    \data{store2:in3}{guard2}
+    \data{guard1:in1}{anchor2}
+    \data{guard2:in1}{anchor1}
+    \data{guard1:in2}{cmpnull}
+    \data{guard2:in2}{cmpnull}
+    \control{entry}{anchor1}
+    \control{anchor1}{if}
+    \data{if}{cmpnull}
+    \controllabel{if:succ1}{merge}
+    \controllabel{if:succ2}{anchor2}
+    \control{anchor2}{store1}
+    \controllabel{store1:succ1}{merge}
+    \controllabel{store1:succ2}{fs1}
+    \control{merge}{store2}
+    \controllabel{store2:succ1}{return}
+    \controllabel{store2:succ2}{fs2}
+    \data{cmpnull}{p}
+\end{digraphenv}
+  \caption{A load guarded by a null check guard.}
+  \label{fig:guard1}
+\end{figure}
+
+The first guard can be easily removed, because it is guarded by an \texttt{If} instruction that checks the same condition.
+Therefore we can remove the guard and the anchor from the graph and this gives us the graph shown in Figure \ref{fig:guard2}.
+
+There is another optimization for guard instructions: If two guards that are anchored to the true and false branch of the same \texttt{If} instruction have the same condition, they can be merged, so that the resulting guard is anchored at the most distant node of which the \texttt{If} instruction is a postdominator.
+
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{guard2}
+	\textnode{entry}{Entry}
+    \node{anchor1}{Anchor}
+    \nodesplit{if}{If}
+    \node{merge}{Merge}
+    \node{return}{Return}
+    \node{cmpnull}{NonNull}
+    \textnode{p}{p}
+	\textnode{const0}{0}
+    \nodeguard{guard2}{Guard}
+    \nodetrisplit{store1}{MemStore 16 (int)}
+    \nodetrisplit{store2}{MemStore 20 (int)}
+    \nodeframestate{fs1}{FrameState}
+    \nodeframestate{fs2}{FrameState}
+    \data{store1:in1}{p}
+    \data{store2:in1}{p}
+    \data{store1:in2}{const0}
+    \data{store2:in2}{const0}
+    \data{store2:in3}{guard2}
+    \data{guard2:in1}{anchor1}
+    \data{guard2:in2}{cmpnull}
+    \control{entry}{anchor1}
+    \control{anchor1}{if}
+    \data{if}{cmpnull}
+    \controllabel{if:succ1}{merge}
+    \controllabel{if:succ2}{store1}
+    \controllabel{store1:succ1}{merge}
+    \controllabel{store1:succ2}{fs1}
+    \control{merge}{store2}
+    \controllabel{store2:succ1}{return}
+    \controllabel{store2:succ2}{fs2}
+    \data{cmpnull}{p}  
+\end{digraphenv}
+  \caption{After removing redundant guards.}
+  \label{fig:guard2}
+\end{figure}
+
+The remaining guard can now be moved above the \texttt{If} condition and be used to eliminate the need for the \texttt{If} node.
+From this point on, the guard can however no longer be moved below the first memory store.
+We use a control dependency from the guard to the field store to express this condition.
+The link between the second store and the guard and the control flow merge instruction is no longer necessary.
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{guard3}
+	\textnode{entry}{Entry}
+    \node{anchor1}{Anchor}
+    \node{return}{Return}
+    \node{cmpnull}{NonNull}
+    \textnode{p}{p}
+	\textnode{const0}{0}
+    \nodeguard{guard2}{Guard}
+    \nodetrisplit{store1}{MemStore 16 (int)}
+    \nodetrisplit{store2}{MemStore 20 (int)}
+    \nodeframestate{fs1}{FrameState}
+    \nodeframestate{fs2}{FrameState}
+    \data{store1:in1}{p}
+    \data{store2:in1}{p}
+    \data{store1:in2}{const0}
+    \data{store2:in2}{const0}
+    \data{store2:in3}{guard2}
+    \data{guard2:in1}{anchor1}
+    \data{guard2:in2}{cmpnull}
+    \control{guard2}{store1}
+    \control{entry}{anchor1}
+    \control{anchor1}{store1}
+    \controllabel{store1:succ2}{fs1}
+    \control{store1}{store2}
+    \controllabel{store2:succ1}{return}
+    \controllabel{store2:succ2}{fs2}
+    \data{cmpnull}{p}  
+\end{digraphenv}
+  \caption{After eliminating an if with a guard.}
+  \label{fig:guard3}
+\end{figure}
+
+At some point during the compilation, guards need to be fixed, which means that appropriate data and control dependencies will be inserted so that they cannot move outside the scope of the associated frame state.
+This will generate deoptimization-free zones that can be targeted by the most aggressive optimizations.
+A simple algorithm for this removal of frame states would be to move all guards as far upwards as possible and then the guards are fixed using anchor nodes.
+In our example, the guard is already fixed, so there is no deoptimization point that uses any of the memory store frame states.
+Therefore we can delete the frame states from the graph (see Figure \ref{fig:guard4}).
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{guard4}
+	\textnode{entry}{Entry}
+    \node{anchor1}{Anchor}
+    \node{return}{Return}
+    \node{cmpnull}{NonNull}
+    \textnode{p}{p}
+	\textnode{const0}{0}
+    \nodeguard{guard2}{Guard}
+    \nodetrisplit{store1}{MemStore 16 (int)}
+    \nodetrisplit{store2}{MemStore 20 (int)}
+    \data{store1:in1}{p}
+    \data{store2:in1}{p}
+    \data{store1:in2}{const0}
+    \data{store2:in2}{const0}
+    \data{store2:in3}{guard2}
+    \data{guard2:in1}{anchor1}
+    \data{guard2:in2}{cmpnull}
+    \control{guard2}{store1}
+    \control{entry}{anchor1}
+    \control{anchor1}{store1}
+    \control{store1}{store2}
+    \controllabel{store2:succ1}{return}
+    \data{cmpnull}{p}  
+\end{digraphenv}
+  \caption{After removing the frame states.}
+  \label{fig:guard4}
+\end{figure}
+
+Now we can use memory coalescing to combine the two stores without frame state to adjacent locations in the same object.
+This is only possible if the first store does not have a frame state.
+Figure \ref{fig:guard5} shows the resulting graph.
+
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{guard5}
+	\textnode{entry}{Entry}
+    \node{anchor1}{Anchor}
+    \node{return}{Return}
+    \node{cmpnull}{NonNull}
+    \textnode{p}{p}
+	\textnode{const0}{0}
+    \nodeguard{guard2}{Guard}
+    \nodetrisplit{store1}{MemStore 16 (long)}
+    \data{store1:in1}{p}
+    \data{store1:in2}{const0}
+    \data{guard2:in1}{anchor1}
+    \data{guard2:in2}{cmpnull}
+    \control{guard2}{store1}
+    \control{entry}{anchor1}
+    \control{anchor1}{store1}
+    \controllabel{store1:succ1}{return}
+    \data{cmpnull}{p}  
+\end{digraphenv}
+  \caption{After coalescing the two memory stores.}
+  \label{fig:guard5}
+\end{figure}
+
+A memory store that immediately follows a null check guard instruction on the same object, can be combined into a store with an implicit null check (that deoptimizes instead of throwing the exception).
+Therefore, we can remove the guard again and also the anchor is no longer necessary.
+Figure~\ref{fig:guard6} shows now that fully optimized graph that is generated for Listing~\ref{lst:guard1}.
+
+\begin{figure}[h]
+  \centering
+\begin{digraphenv}{scale=0.5}{guard6}
+	\textnode{entry}{Entry}
+    \node{return}{Return}
+    \textnode{p}{p}
+	\textnode{const0}{0}
+    \nodetrisplit{store1}{DeoptimizingMemStore 16 (long)}
+    \data{store1:in1}{p}
+    \data{store1:in2}{const0}
+    \control{entry}{store1}
+    \controllabel{store1:succ1}{return}
+\end{digraphenv}
+  \caption{Fully optimized method.}
+  \label{fig:guard6}
+\end{figure}
+
+
+\section{Conclusions}
+\label{sec:conclusions}
+This document sketched the strategy for the Graph compiler.
+We already reached M1 (as defined in Section~\ref{sec:mile}) and have the following plans for M2 to M4:
+\begin{description}
+\item[M2:] June 30th, 2011
+\item[M3:] August 15th, 2011
+\item[M4:] September 30th, 2011
+\end{description}
+After we reach M4, we want to create a new project road map that further improves the Graal compiler with respect to its two main goals: Modularity and peak performance.
+
+\end{document}
Binary file graal/com.oracle.max.graal.doc.initial/graph_test.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.doc.initial/graph_test.tex	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,160 @@
+\documentclass[twocolumn]{svjour3}
+\usepackage[pdftex]{graphicx}
+\usepackage{environ}
+\usepackage{amsmath}
+\usepackage{amsfonts}
+\usepackage[english]{babel}
+\usepackage[utf8]{inputenc} 
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage{color}
+
+\input{graphdrawing}
+
+\renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bf #1}
+
+\newcommand{\Sa}{{\Large$^*$}}
+\newcommand{\Sb}{{\Large$^\dag$}}
+\newcommand{\Sc}{{\Large$^\S$}}
+
+\smartqed  % flush right qed marks, e.g. at end of proof
+
+\journalname{Test}
+\def\makeheadbox{{%
+\hbox to0pt{\vbox{\baselineskip=10dd\hrule\hbox
+to\hsize{\vrule\kern3pt\vbox{\kern3pt
+\hbox{\bfseries Test}
+\kern3pt}\hfil\kern3pt\vrule}\hrule}%
+\hss}}}
+
+\begin{document}
+
+\author{}
+\institute{}
+
+\date{Created: \today}
+
+\title{Test}
+\subtitle{}
+
+\maketitle
+
+\begin{digraphenv}{scale=0.5}{layout1}
+    \nodestart
+    \nodeend
+    \data{a}{start}
+    \data{b}{start}
+    \node{a}{a}
+    \node{b}{b}
+    \nodesplit{if}{if}
+    \node{nop}{nop}
+    \nodebi{add}{+}
+    \controllabel{if:succ1}{nop}
+    \controllabel{if:succ2}{add}
+    \datalabel{add:in1}{a}
+    \datalabel{add:in2}{b}
+    \control{nop}{end}
+\end{digraphenv}
+
+\begin{digraphenv}{scale=0.5}{layout2}
+    \node{node1}{nop}
+    \nodebi{node2}{+}
+    \nodetri{node3}{phi}
+    \nodesplit{node4}{if}
+\end{digraphenv}
+
+\begin{digraphenv}{scale=0.5}{layout3}
+    \node{a}{a}
+    \node{b}{b}
+    \nodesplit{if}{if}
+    \node{nop}{nop}
+    \nodebi{add}{+}
+    \controllabel{if:succ1}{nop}
+    \controllabel{if:succ2}{add}
+    \datalabel{add:in1}{a}
+    \datalabel{add:in2}{b}
+\end{digraphenv}
+
+\begin{digraphenv}{scale=0.5}{layout4}
+    \node{arr}{arr}
+    \node{i}{i}
+    \node{j}{j}
+    \node{v}{v}
+    \nodetri{astore1}{astore}
+    \datalabel{astore1:in1}{arr}
+    \datalabel{astore1:in2}{i}
+    \datalabel{astore1:in3}{v}
+    \nodebi{add}{+}
+    \datalabel{add:in1}{i}
+    \datalabel{add:in2}{j}
+    \nodetri{astore2}{astore}
+    \datalabel{astore2:in1}{arr}
+    \datalabel{astore2:in2}{add}
+    \datalabel{astore2:in3}{v}
+    \cnode{fs}{framestate}{lightblue}
+    \control{fs}{astore2}
+    \data{fs}{astore1}
+%    \data{fs}{arr}
+%    \data{fs}{i}
+%    \data{fs}{j}
+%    \data{fs}{v}
+    \control{astore1}{astore2}
+\end{digraphenv}
+
+\begin{digraphenv}{scale=0.5}{layout5}
+    \nodestart
+    \nodeend
+    % input projections
+    \node{a}{proj:a}
+    \node{b}{proj:b}
+    \data{a}{start}
+    \data{b}{start}
+    % if
+    \nodebi{cmp1}{&lt;}
+    \datalabel{cmp1:in1}{a}
+    \datalabel{cmp1:in2}{b}
+    \nodesplit{if}{if}
+    \data{if}{cmp1}
+    \control{start}{if}
+    % branches
+    \nodebi{add1}{+}
+    \datalabel{add1:in1}{a}
+    \datalabel{add1:in2}{b}
+    \nodebi{sub1}{-}
+    \datalabel{sub1:in1}{a}
+    \datalabel{sub1:in2}{b}
+    \controllabel{if:succ1}{add1}
+    \controllabel{if:succ2}{sub1}
+    % merge
+    \nodebi{merge}{merge}
+    \control{add1}{merge}
+    \control{sub1}{merge}
+    % phi
+    \nodebi{phi1}{phi}
+    \datalabel{phi1:in1}{add1}
+    \datalabel{phi1:in2}{sub1}
+    % ret
+    \node{ret}{ret}
+    \data{ret}{phi1}
+    \control{merge}{ret}
+    \control{ret}{end}
+\end{digraphenv}
+
+\end{document}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.doc.initial/graphdrawing.tex	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,109 @@
+
+% graph drawing
+\newwrite\dotfile 
+\newcommand{\digraph}[3][scale=1]{ 
+  \immediate\openout\dotfile=dot_temp_#2.dot 
+  \immediate\write\dotfile{digraph #2 { margin=0; pad=0; concentrate=false; \string#3}} 
+  \immediate\closeout\dotfile
+  \immediate\write18{bash -c "dot -Tpdf dot_temp_#2.dot > dot_temp_#2.pdf"}  
+  \IfFileExists{dot_temp_#2.pdf}
+  % the pdf exists: include it 
+  { \includegraphics[#1]{dot_temp_#2} } 
+  % the pdf was not created - show a hint
+  { \fbox{ \begin{tabular}{l} 
+        The file \texttt{dot_temp_#2.pdf} hasn't been created from 
+        \texttt{dot_temp_#2.dot} yet. \\
+        We attempted to create it with:\\
+        `\texttt{dot -Tpdf dot_temp_#2.dot > dot_temp_#2.pdf}' \\
+        but that seems not to have worked. You need to execute `\texttt{pdflatex}' with \\
+        the `\texttt{-shell-escape} option.
+      \end{tabular}} 
+  } 
+}
+
+\NewEnviron{digraphenv}[2]{\digraph[#1]{#2}{ nodesep="0.1"; ranksep="0.08 equally"; \BODY }}
+
+\newcommand{\control}[2]{#1:successors:s -> #2:predecessors:n [color=red];}
+\newcommand{\controllabel}[2]{#1:s -> #2:predecessors:n [color=red];}
+\newcommand{\data}[2]{#2:usages:s -> #1:inputs [color=black,dir=back];}
+\newcommand{\datalabel}[2]{#2:usages:s -> #1:n [color=black,dir=back];}
+\newcommand{\datalabeltext}[3]{#2:usages:s -> #1:n [color=black,dir=back,label="#3"];}
+
+\newcommand{\textnode}[2]{#1 [shape=plaintext, label="#2"]}
+\newcommand{\genericnodestart}[1]{#1 [shape=plaintext, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD CELLPADDING="0"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR><TD WIDTH="15" HEIGHT="5" PORT="predecessors" BGCOLOR="rosybrown1"></TD></TR></TABLE></TD><TD COLSPAN="2" CELLPADDING="0" ALIGN="RIGHT"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR>}
+\newcommand{\genericnodeend}[0]{</TR></TABLE></TD><TD CELLPADDING="0"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR><TD WIDTH="15" HEIGHT="5" PORT="usages" BGCOLOR="lightgrey"></TD></TR></TABLE></TD></TR></TABLE>>]}
+\newcommand{\portinput}[1]{<TD WIDTH="15" HEIGHT="5" PORT="#1" BGCOLOR="lightgrey"></TD>}
+\newcommand{\portsuccessor}[1]{<TD WIDTH="15" HEIGHT="5" PORT="#1" BGCOLOR="rosybrown1"></TD>}
+\newcommand{\portempty}[0]{<TD WIDTH="15" HEIGHT="5"></TD>}
+\newcommand{\genericnodelabel}[2]{</TR></TABLE></TD></TR><TR><TD BORDER="1" COLSPAN="3" BGCOLOR="#2"><FONT POINT-SIZE="12">#1</FONT></TD></TR><TR><TD COLSPAN="2" CELLPADDING="0" ALIGN="RIGHT"><TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0"><TR>}
+
+\newcommand{\nodestart}[0]{start [shape=plaintext, rank=source, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD COLSPAN="3"><TABLE BORDER="0"><TR><TD></TD> \genericnodelabel{start}{lightyellow} \portsuccessor{successors} \portempty \genericnodeend }
+
+\newcommand{\nodeend}[0]{\genericnodestart{end} \portempty \portinput{inputs} \genericnodelabel{end}{lightyellow} <TD></TD></TR></TABLE></TD><TD></TD></TR></TABLE>>]}
+
+\newcommand{\nodeconst}[2]{#1 [margin="0.05, 0.05", shape=plaintext, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD BORDER="1" BGCOLOR="white"><FONT POINT-SIZE="12">#2</FONT></TD></TR><TR><TD WIDTH="15" HEIGHT="5" PORT="usages" BGCOLOR="lightgrey"></TD></TR></TABLE>>]}
+\newcommand{\nodeframestate}[2]{#1 [margin="0.05, 0.05", shape=plaintext, label=< <TABLE BORDER="0" CELLSPACING="0"><TR><TD WIDTH="15" HEIGHT="5" PORT="predecessors" BGCOLOR="rosybrown1"></TD><TD WIDTH="15" HEIGHT="5"></TD><TD HEIGHT="5" PORT="inputs" BGCOLOR="lightgrey"></TD></TR><TR><TD BORDER="1" COLSPAN="3" BGCOLOR="lightblue"><FONT POINT-SIZE="12">#2</FONT></TD></TR></TABLE>>]}
+
+
+\newcommand{\node}[2]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \genericnodeend }
+\newcommand{\nodebi}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \genericnodeend }
+\newcommand{\nodetri}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \portempty \genericnodeend }
+\newcommand{\nodequad}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \portinput{in4} \genericnodelabel{#2}{white} \portsuccessor{successors} \portempty \portempty \portempty \genericnodeend }
+\newcommand{\nodesplit}[2]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \genericnodeend }
+\newcommand{\nodequadsplit}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \portinput{in4} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portempty \portempty \genericnodeend }
+\newcommand{\nodetrisplit}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portempty \genericnodeend }
+\newcommand{\nodesplittri}[2]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portsuccessor{succ3} \genericnodeend }
+\newcommand{\nodebisplit}[2]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \genericnodelabel{#2}{white} \portsuccessor{succ1} \portsuccessor{succ2} \portempty \genericnodeend }
+
+\newcommand{\nodeguard}[2]{\cnodebi{#1}{#2}{rosybrown1}}
+
+\newcommand{\cnode}[3]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{#3} \portsuccessor{successors} \portempty \genericnodeend }
+\newcommand{\cnodebi}[3]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \genericnodelabel{#2}{#3} \portsuccessor{successors} \portempty \genericnodeend }
+\newcommand{\cnodetri}[3]{\genericnodestart{#1} \portinput{in1} \portinput{in2} \portinput{in3} \genericnodelabel{#2}{#3} \portsuccessor{successors} \portempty \portempty \genericnodeend }
+\newcommand{\cnodesplit}[3]{\genericnodestart{#1} \portempty \portinput{inputs} \genericnodelabel{#2}{#3} \portsuccessor{succ1} \portsuccessor{succ2} \genericnodeend }
+
+% this doesn't work:
+%\newenvironment{graphfigure}[2]{\begin{figure}[h] \label{fig:#1} \centering \begin{digraphenv}{scale=0.5}{#1}}{\end{digraphenv} \caption{#2} \end{figure}}
+
+%%%%%%%%%%%%%% example:
+
+% \begin{digraphenv}{scale=0.5}{MyGraph}
+% \node{start}{start}
+% \node{end}{end}
+% % input projections
+% \node{a}{proj:a}
+% \node{b}{proj:b}
+% \data{a}{start}
+% \data{b}{start}
+% % if
+% \nodebi{cmp1}{&lt;}
+% \datalabel{cmp1:in1}{a}
+% \datalabel{cmp1:in2}{b}
+% \nodesplit{if}{if}
+% \data{if}{cmp1}
+% \control{start}{if}
+% % branches
+% \nodebi{add1}{+}
+% \datalabel{add1:in1}{a}
+% \datalabel{add1:in2}{b}
+% \nodebi{sub1}{-}
+% \datalabel{sub1:in1}{a}
+% \datalabel{sub1:in2}{b}
+% \controllabel{if:succ1}{add1}
+% \controllabel{if:succ2}{sub1}
+% % merge
+% \nodebi{merge}{merge}
+% \control{add1}{merge}
+% \control{sub1}{merge}
+% % phi
+% \nodebi{phi1}{phi}
+% \datalabel{phi1:in1}{add1}
+% \datalabel{phi1:in2}{sub1}
+% % ret
+% \node{ret}{ret}
+% \data{ret}{phi1}
+% \control{merge}{ret}
+% \control{ret}{end}
+% \end{digraphenv}
+
+%%%%%%%%%%%%%%%
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.doc.initial/svglov3.clo	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,101 @@
+% SVJour3 DOCUMENT CLASS OPTION SVGLOV3 -- for standardised journals
+%
+% This is an enhancement for the LaTeX
+% SVJour3 document class for Springer journals
+%
+%%
+%%
+%% \CharacterTable
+%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%%   Digits        \0\1\2\3\4\5\6\7\8\9
+%%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%%   Dollar        \$     Percent       \%     Ampersand     \&
+%%   Acute accent  \'     Left paren    \(     Right paren   \)
+%%   Asterisk      \*     Plus          \+     Comma         \,
+%%   Minus         \-     Point         \.     Solidus       \/
+%%   Colon         \:     Semicolon     \;     Less than     \<
+%%   Equals        \=     Greater than  \>     Question mark \?
+%%   Commercial at \@     Left bracket  \[     Backslash     \\
+%%   Right bracket \]     Circumflex    \^     Underscore    \_
+%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%%   Right brace   \}     Tilde         \~}
+\ProvidesFile{svglov3.clo}
+              [2006/02/03 v3.1
+      style option for standardised journals]
+\typeout{SVJour Class option: svglov3.clo for standardised journals}
+\def\validfor{svjour3}
+\ExecuteOptions{final,10pt,runningheads}
+% No size changing allowed, hence a "copy" of size10.clo is included
+\renewcommand\normalsize{%
+\if@twocolumn
+   \@setfontsize\normalsize\@xpt{12.5pt}%
+\else
+   \if@smallext
+      \@setfontsize\normalsize\@xpt\@xiipt
+   \else
+      \@setfontsize\normalsize{9.5pt}{11.5pt}%
+   \fi
+\fi
+   \abovedisplayskip=3 mm plus6pt minus 4pt
+   \belowdisplayskip=3 mm plus6pt minus 4pt
+   \abovedisplayshortskip=0.0 mm plus6pt
+   \belowdisplayshortskip=2 mm plus4pt minus 4pt
+   \let\@listi\@listI}
+\normalsize
+\newcommand\small{%
+\if@twocolumn
+   \@setfontsize\small{8.5pt}\@xpt
+\else
+   \if@smallext
+      \@setfontsize\small\@viiipt{9.5pt}%
+   \else
+      \@setfontsize\small\@viiipt{9.25pt}%
+   \fi
+\fi
+   \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
+   \abovedisplayshortskip \z@ \@plus2\p@
+   \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+   \def\@listi{\leftmargin\leftmargini
+               \parsep 0\p@ \@plus1\p@ \@minus\p@
+               \topsep 4\p@ \@plus2\p@ \@minus4\p@
+               \itemsep0\p@}%
+   \belowdisplayskip \abovedisplayskip
+}
+\let\footnotesize\small
+\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
+\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
+\if@twocolumn
+   \newcommand\large{\@setfontsize\large\@xiipt\@xivpt}
+   \newcommand\LARGE{\@setfontsize\LARGE{16pt}{18pt}}
+\else
+   \newcommand\large{\@setfontsize\large\@xipt\@xiipt}
+   \newcommand\LARGE{\@setfontsize\LARGE{13pt}{15pt}}
+\fi
+\newcommand\Large{\@setfontsize\Large\@xivpt{16dd}}
+\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
+\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
+%
+\def\runheadhook{\rlap{\smash{\lower6.5pt\hbox to\textwidth{\hrulefill}}}}
+\if@twocolumn
+\setlength{\textwidth}{17.4cm}
+\setlength{\textheight}{234mm}
+\AtEndOfClass{\setlength\columnsep{6mm}}
+\else
+   \if@smallext
+      \setlength{\textwidth}{11.9cm}
+      \setlength{\textheight}{19.4cm}
+   \else
+      \setlength{\textwidth}{12.2cm}
+      \setlength{\textheight}{19.8cm}
+   \fi
+\fi
+%
+\AtBeginDocument{%
+\@ifundefined{@journalname}
+ {\typeout{Unknown journal: specify \string\journalname\string{%
+<name of your journal>\string} in preambel^^J}}{}}
+%
+\endinput
+%%
+%% End of file `svglov3.clo'.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.doc.initial/svjour3.cls	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,1431 @@
+% SVJour3 DOCUMENT CLASS -- version 3.2 for LaTeX2e
+%
+% LaTeX document class for Springer journals
+%
+%%
+%%
+%% \CharacterTable
+%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%%   Digits        \0\1\2\3\4\5\6\7\8\9
+%%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%%   Dollar        \$     Percent       \%     Ampersand     \&
+%%   Acute accent  \'     Left paren    \(     Right paren   \)
+%%   Asterisk      \*     Plus          \+     Comma         \,
+%%   Minus         \-     Point         \.     Solidus       \/
+%%   Colon         \:     Semicolon     \;     Less than     \<
+%%   Equals        \=     Greater than  \>     Question mark \?
+%%   Commercial at \@     Left bracket  \[     Backslash     \\
+%%   Right bracket \]     Circumflex    \^     Underscore    \_
+%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%%   Right brace   \}     Tilde         \~}
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesClass{svjour3}[2007/05/08 v3.2
+^^JLaTeX document class for Springer journals]
+\newcommand\@ptsize{}
+\newif\if@restonecol
+\newif\if@titlepage
+\@titlepagefalse
+\DeclareOption{a4paper}
+   {\setlength\paperheight {297mm}%
+    \setlength\paperwidth  {210mm}}
+\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
+\DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
+\DeclareOption{draft}{\setlength\overfullrule{5pt}}
+\DeclareOption{final}{\setlength\overfullrule{0pt}}
+\DeclareOption{fleqn}{\input{fleqn.clo}\AtBeginDocument{\mathindent\z@}%
+\AtBeginDocument{\@ifpackageloaded{amsmath}{\@mathmargin\z@}{}}%
+\PassOptionsToPackage{fleqn}{amsmath}}
+%%%
+\DeclareOption{onecolumn}{}
+\DeclareOption{smallcondensed}{}
+\DeclareOption{twocolumn}{\@twocolumntrue\ExecuteOptions{fleqn}}
+\newif\if@smallext\@smallextfalse
+\DeclareOption{smallextended}{\@smallexttrue}
+\let\if@mathematic\iftrue
+\let\if@numbook\iffalse
+\DeclareOption{numbook}{\let\if@envcntsect\iftrue
+  \AtEndOfPackage{%
+   \renewcommand\thefigure{\thesection.\@arabic\c@figure}%
+   \renewcommand\thetable{\thesection.\@arabic\c@table}%
+   \renewcommand\theequation{\thesection.\@arabic\c@equation}%
+   \@addtoreset{figure}{section}%
+   \@addtoreset{table}{section}%
+   \@addtoreset{equation}{section}%
+  }%
+}
+\DeclareOption{openbib}{%
+  \AtEndOfPackage{%
+   \renewcommand\@openbib@code{%
+      \advance\leftmargin\bibindent
+      \itemindent -\bibindent
+      \listparindent \itemindent
+      \parsep \z@
+      }%
+   \renewcommand\newblock{\par}}%
+}
+\DeclareOption{natbib}{%
+\AtEndOfClass{\RequirePackage{natbib}%
+% Changing some parameters of NATBIB
+\setlength{\bibhang}{\parindent}%
+%\setlength{\bibsep}{0mm}%
+\let\bibfont=\small
+\def\@biblabel#1{#1.}%
+\newcommand{\etal}{et al.}%
+\bibpunct{(}{)}{;}{a}{}{,}}}
+%
+\let\if@runhead\iffalse
+\DeclareOption{runningheads}{\let\if@runhead\iftrue}
+\let\if@smartrunh\iffalse
+\DeclareOption{smartrunhead}{\let\if@smartrunh\iftrue}
+\DeclareOption{nosmartrunhead}{\let\if@smartrunh\iffalse}
+\let\if@envcntreset\iffalse
+\DeclareOption{envcountreset}{\let\if@envcntreset\iftrue}
+\let\if@envcntsame\iffalse
+\DeclareOption{envcountsame}{\let\if@envcntsame\iftrue}
+\let\if@envcntsect\iffalse
+\DeclareOption{envcountsect}{\let\if@envcntsect\iftrue}
+\let\if@referee\iffalse
+\DeclareOption{referee}{\let\if@referee\iftrue}
+\def\makereferee{\def\baselinestretch{2}}
+\let\if@instindent\iffalse
+\DeclareOption{instindent}{\let\if@instindent\iftrue}
+\let\if@smartand\iffalse
+\DeclareOption{smartand}{\let\if@smartand\iftrue}
+\let\if@spthms\iftrue
+\DeclareOption{nospthms}{\let\if@spthms\iffalse}
+%
+% language and babel dependencies
+\DeclareOption{deutsch}{\def\switcht@@therlang{\switcht@deutsch}%
+\gdef\svlanginfo{\typeout{Man spricht deutsch.}\global\let\svlanginfo\relax}}
+\DeclareOption{francais}{\def\switcht@@therlang{\switcht@francais}%
+\gdef\svlanginfo{\typeout{On parle francais.}\global\let\svlanginfo\relax}}
+\let\switcht@@therlang\relax
+\let\svlanginfo\relax
+%
+\AtBeginDocument{\@ifpackageloaded{babel}{%
+\@ifundefined{extrasenglish}{}{\addto\extrasenglish{\switcht@albion}}%
+\@ifundefined{extrasUKenglish}{}{\addto\extrasUKenglish{\switcht@albion}}%
+\@ifundefined{extrasfrenchb}{}{\addto\extrasfrenchb{\switcht@francais}}%
+\@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht@deutsch}}%
+\@ifundefined{extrasngerman}{}{\addto\extrasngerman{\switcht@deutsch}}%
+}{\switcht@@therlang}%
+}
+%
+\def\ClassInfoNoLine#1#2{%
+   \ClassInfo{#1}{#2\@gobble}%
+}
+\let\journalopt\@empty
+\DeclareOption*{%
+\InputIfFileExists{sv\CurrentOption.clo}{%
+\global\let\journalopt\CurrentOption}{%
+\ClassWarning{Springer-SVJour3}{Specified option or subpackage
+"\CurrentOption" not found -}\OptionNotUsed}}
+\ExecuteOptions{a4paper,twoside,10pt,instindent}
+\ProcessOptions
+%
+\ifx\journalopt\@empty\relax
+\ClassInfoNoLine{Springer-SVJour3}{extra/valid Springer sub-package (-> *.clo)
+\MessageBreak not found in option list of \string\documentclass
+\MessageBreak  - autoactivating "global" style}{}
+\input{svglov3.clo}
+\else
+\@ifundefined{validfor}{%
+\ClassError{Springer-SVJour3}{Possible option clash for sub-package
+\MessageBreak "sv\journalopt.clo" - option file not valid
+\MessageBreak for this class}{Perhaps you used an option of the old
+Springer class SVJour!}
+}{}
+\fi
+%
+\if@smartrunh\AtEndDocument{\islastpageeven\getlastpagenumber}\fi
+%
+\newcommand{\twocoltest}[2]{\if@twocolumn\def\@gtempa{#2}\else\def\@gtempa{#1}\fi
+\@gtempa\makeatother}
+\newcommand{\columncase}{\makeatletter\twocoltest}
+%
+\DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{"00}
+\DeclareMathSymbol{\Delta}{\mathalpha}{letters}{"01}
+\DeclareMathSymbol{\Theta}{\mathalpha}{letters}{"02}
+\DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{"03}
+\DeclareMathSymbol{\Xi}{\mathalpha}{letters}{"04}
+\DeclareMathSymbol{\Pi}{\mathalpha}{letters}{"05}
+\DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{"06}
+\DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{"07}
+\DeclareMathSymbol{\Phi}{\mathalpha}{letters}{"08}
+\DeclareMathSymbol{\Psi}{\mathalpha}{letters}{"09}
+\DeclareMathSymbol{\Omega}{\mathalpha}{letters}{"0A}
+%
+\setlength\parindent{15\p@}
+\setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@}
+\setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@}
+\setlength\headheight{12\p@}
+\setlength\headsep   {14.50dd}
+\setlength\topskip   {10\p@}
+\setlength\footskip{30\p@}
+\setlength\maxdepth{.5\topskip}
+%
+\@settopoint\textwidth
+\setlength\marginparsep {10\p@}
+\setlength\marginparpush{5\p@}
+\setlength\topmargin{-10pt}
+\if@twocolumn
+   \setlength\oddsidemargin {-30\p@}
+   \setlength\evensidemargin{-30\p@}
+\else
+   \setlength\oddsidemargin {\z@}
+   \setlength\evensidemargin{\z@}
+\fi
+\setlength\marginparwidth  {48\p@}
+\setlength\footnotesep{8\p@}
+\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
+\setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
+\setlength\intextsep   {20\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
+\setlength\@fptop{0\p@}
+\setlength\@fpsep{12\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\@fpbot{0\p@ \@plus 1fil}
+\setlength\@dblfptop{0\p@}
+\setlength\@dblfpsep{12\p@ \@plus 2\p@ \@minus 2\p@}
+\setlength\@dblfpbot{0\p@ \@plus 1fil}
+\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
+\def\@listi{\leftmargin\leftmargini
+            \parsep \z@
+            \topsep 6\p@ \@plus2\p@ \@minus4\p@
+            \itemsep\parsep}
+\let\@listI\@listi
+\@listi
+\def\@listii {\leftmargin\leftmarginii
+              \labelwidth\leftmarginii
+              \advance\labelwidth-\labelsep
+              \topsep    \z@
+              \parsep    \topsep
+              \itemsep   \parsep}
+\def\@listiii{\leftmargin\leftmarginiii
+              \labelwidth\leftmarginiii
+              \advance\labelwidth-\labelsep
+              \topsep    \z@
+              \parsep    \topsep
+              \itemsep   \parsep}
+\def\@listiv {\leftmargin\leftmarginiv
+              \labelwidth\leftmarginiv
+              \advance\labelwidth-\labelsep}
+\def\@listv  {\leftmargin\leftmarginv
+              \labelwidth\leftmarginv
+              \advance\labelwidth-\labelsep}
+\def\@listvi {\leftmargin\leftmarginvi
+              \labelwidth\leftmarginvi
+              \advance\labelwidth-\labelsep}
+%
+\setlength\lineskip{1\p@}
+\setlength\normallineskip{1\p@}
+\renewcommand\baselinestretch{}
+\setlength\parskip{0\p@ \@plus \p@}
+\@lowpenalty   51
+\@medpenalty  151
+\@highpenalty 301
+\setcounter{topnumber}{4}
+\renewcommand\topfraction{.9}
+\setcounter{bottomnumber}{2}
+\renewcommand\bottomfraction{.7}
+\setcounter{totalnumber}{6}
+\renewcommand\textfraction{.1}
+\renewcommand\floatpagefraction{.85}
+\setcounter{dbltopnumber}{3}
+\renewcommand\dbltopfraction{.85}
+\renewcommand\dblfloatpagefraction{.85}
+\def\ps@headings{%
+    \let\@oddfoot\@empty\let\@evenfoot\@empty
+    \def\@evenhead{\small\csname runheadhook\endcsname
+    \rlap{\thepage}\hfil\leftmark\unskip}%
+    \def\@oddhead{\small\csname runheadhook\endcsname
+    \ignorespaces\rightmark\hfil\llap{\thepage}}%
+    \let\@mkboth\@gobbletwo
+    \let\sectionmark\@gobble
+    \let\subsectionmark\@gobble
+    }
+% make indentations changeable
+\def\setitemindent#1{\settowidth{\labelwidth}{#1}%
+        \leftmargini\labelwidth
+        \advance\leftmargini\labelsep
+   \def\@listi{\leftmargin\leftmargini
+        \labelwidth\leftmargini\advance\labelwidth by -\labelsep
+        \parsep=\parskip
+        \topsep=\medskipamount
+        \itemsep=\parskip \advance\itemsep by -\parsep}}
+\def\setitemitemindent#1{\settowidth{\labelwidth}{#1}%
+        \leftmarginii\labelwidth
+        \advance\leftmarginii\labelsep
+\def\@listii{\leftmargin\leftmarginii
+        \labelwidth\leftmarginii\advance\labelwidth by -\labelsep
+        \parsep=\parskip
+        \topsep=\z@
+        \itemsep=\parskip \advance\itemsep by -\parsep}}
+% labels of description
+\def\descriptionlabel#1{\hspace\labelsep #1\hfil}
+% adjusted environment "description"
+% if an optional parameter (at the first two levels of lists)
+% is present, its width is considered to be the widest mark
+% throughout the current list.
+\def\description{\@ifnextchar[{\@describe}{\list{}{\labelwidth\z@
+          \itemindent-\leftmargin \let\makelabel\descriptionlabel}}}
+\let\enddescription\endlist
+%
+\def\describelabel#1{#1\hfil}
+\def\@describe[#1]{\relax\ifnum\@listdepth=0
+\setitemindent{#1}\else\ifnum\@listdepth=1
+\setitemitemindent{#1}\fi\fi
+\list{--}{\let\makelabel\describelabel}}
+%
+\newdimen\logodepth
+\logodepth=1.2cm
+\newdimen\headerboxheight
+\headerboxheight=163pt % 18 10.5dd-lines - 2\baselineskip
+\if@twocolumn\else\advance\headerboxheight by-14.5mm\fi
+\newdimen\betweenumberspace          % dimension for space between
+\betweenumberspace=3.33pt            % number and text of titles.
+\newdimen\aftertext                  % dimension for space after
+\aftertext=5pt                       % text of title.
+\newdimen\headlineindent             % dimension for space between
+\headlineindent=1.166cm              % number and text of headings.
+\if@mathematic
+   \def\runinend{} % \enspace}
+   \def\floatcounterend{\enspace}
+   \def\sectcounterend{}
+\else
+   \def\runinend{.}
+   \def\floatcounterend{.\ }
+   \def\sectcounterend{.}
+\fi
+\def\email#1{\emailname: #1}
+\def\keywords#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
+\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
+}\noindent\keywordname\enspace\ignorespaces#1\par}}
+%
+\def\subclassname{{\bfseries Mathematics Subject Classification
+(2000)}\enspace}
+\def\subclass#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
+\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
+}\noindent\subclassname\ignorespaces#1\par}}
+%
+\def\PACSname{\textbf{PACS}\enspace}
+\def\PACS#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
+\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
+}\noindent\PACSname\ignorespaces#1\par}}
+%
+\def\CRclassname{{\bfseries CR Subject Classification}\enspace}
+\def\CRclass#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
+\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
+}\noindent\CRclassname\ignorespaces#1\par}}
+%
+\def\ESMname{\textbf{Electronic Supplementary Material}\enspace}
+\def\ESM#1{\par\addvspace\medskipamount
+\noindent\ESMname\ignorespaces#1\par}
+%
+\newcounter{inst}
+\newcounter{auth}
+\def\authdepth{2}
+\newdimen\instindent
+\newbox\authrun
+\newtoks\authorrunning
+\newbox\titrun
+\newtoks\titlerunning
+\def\authorfont{\bfseries}
+
+\def\combirunning#1{\gdef\@combi{#1}}
+\def\@combi{}
+\newbox\combirun
+%
+\def\ps@last{\def\@evenhead{\small\rlap{\thepage}\hfil
+\lastevenhead}}
+\newcounter{lastpage}
+\def\islastpageeven{\@ifundefined{lastpagenumber}
+{\setcounter{lastpage}{0}}{\setcounter{lastpage}{\lastpagenumber}}
+\ifnum\value{lastpage}>0
+   \ifodd\value{lastpage}%
+   \else
+      \if@smartrunh
+         \thispagestyle{last}%
+      \fi
+   \fi
+\fi}
+\def\getlastpagenumber{\clearpage
+\addtocounter{page}{-1}%
+   \immediate\write\@auxout{\string\gdef\string\lastpagenumber{\thepage}}%
+   \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}}}%
+   \addtocounter{page}{1}}
+
+\def\journalname#1{\gdef\@journalname{#1}}
+
+\def\dedication#1{\gdef\@dedic{#1}}
+\def\@dedic{}
+
+\let\@date\undefined
+\def\notused{~}
+
+\def\institute#1{\gdef\@institute{#1}}
+
+\def\offprints#1{\begingroup
+\def\protect{\noexpand\protect\noexpand}\xdef\@thanks{\@thanks
+\protect\footnotetext[0]{\unskip\hskip-15pt{\itshape Send offprint requests
+to\/}: \ignorespaces#1}}\endgroup\ignorespaces}
+
+%\def\mail#1{\gdef\@mail{#1}}
+%\def\@mail{}
+
+\def\@thanks{}
+
+\def\@fnsymbol#1{\ifcase#1\or\star\or{\star\star}\or{\star\star\star}%
+   \or \dagger\or \ddagger\or
+   \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger
+   \or \ddagger\ddagger \else\@ctrerr\fi\relax}
+%
+%\def\invthanks#1{\footnotetext[0]{\kern-\bibindent#1}}
+%
+\def\nothanksmarks{\def\thanks##1{\protected@xdef\@thanks{\@thanks
+        \protect\footnotetext[0]{\kern-\bibindent##1}}}}
+%
+\def\subtitle#1{\gdef\@subtitle{#1}}
+\def\@subtitle{}
+
+\def\headnote#1{\gdef\@headnote{#1}}
+\def\@headnote{}
+
+\def\papertype#1{\gdef\paper@type{\MakeUppercase{#1}}}
+\def\paper@type{}
+
+\def\ch@ckobl#1#2{\@ifundefined{@#1}
+ {\typeout{SVJour3 warning: Missing
+\expandafter\string\csname#1\endcsname}%
+  \csname #1\endcsname{#2}}
+ {}}
+%
+\def\ProcessRunnHead{%
+    \def\\{\unskip\ \ignorespaces}%
+    \def\thanks##1{\unskip{}}%
+    \instindent=\textwidth
+    \advance\instindent by-\headlineindent
+    \if!\the\titlerunning!\else
+      \edef\@title{\the\titlerunning}%
+    \fi
+    \global\setbox\titrun=\hbox{\small\rmfamily\unboldmath\ignorespaces\@title
+                                \unskip}%
+    \ifdim\wd\titrun>\instindent
+       \typeout{^^JSVJour3 Warning: Title too long for running head.}%
+       \typeout{Please supply a shorter form with \string\titlerunning
+                \space prior to \string\maketitle}%
+       \global\setbox\titrun=\hbox{\small\rmfamily
+       Title Suppressed Due to Excessive Length}%
+    \fi
+    \xdef\@title{\copy\titrun}%
+%
+    \if!\the\authorrunning!
+    \else
+      \setcounter{auth}{1}%
+      \edef\@author{\the\authorrunning}%
+    \fi
+    \ifnum\value{inst}>\authdepth
+       \def\stripauthor##1\and##2\endauthor{%
+       \protected@xdef\@author{##1\unskip\unskip\if!##2!\else\ et al.\fi}}%
+       \expandafter\stripauthor\@author\and\endauthor
+    \else
+       \gdef\and{\unskip, \ignorespaces}%
+       {\def\and{\noexpand\protect\noexpand\and}%
+       \protected@xdef\@author{\@author}}
+    \fi
+    \global\setbox\authrun=\hbox{\small\rmfamily\unboldmath\ignorespaces
+                                 \@author\unskip}%
+    \ifdim\wd\authrun>\instindent
+    \typeout{^^JSVJour3 Warning: Author name(s) too long for running head.
+             ^^JPlease supply a shorter form with \string\authorrunning
+             \space prior to \string\maketitle}%
+    \global\setbox\authrun=\hbox{\small\rmfamily Please give a shorter version
+          with: {\tt\string\authorrunning\space and
+             \string\titlerunning\space prior to \string\maketitle}}%
+    \fi
+    \xdef\@author{\copy\authrun}%
+    \markboth{\@author}{\@title}%
+}
+%
+\let\orithanks=\thanks
+\def\thanks#1{\ClassWarning{SVJour3}{\string\thanks\space may only be
+used inside of \string\title, \string\author,\MessageBreak
+and \string\date\space prior to \string\maketitle}}
+%
+\def\maketitle{\par\let\thanks=\orithanks
+\ch@ckobl{journalname}{Noname}
+\ch@ckobl{date}{the date of receipt and acceptance should be inserted
+later}
+\ch@ckobl{title}{A title should be given}
+\ch@ckobl{author}{Name(s) and initial(s) of author(s) should be given}
+\ch@ckobl{institute}{Address(es) of author(s) should be given}
+\begingroup
+%
+    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
+    \def\@makefnmark{$^{\@thefnmark}$}%
+    \renewcommand\@makefntext[1]{%
+    \noindent
+    \hb@xt@\bibindent{\hss\@makefnmark\enspace}##1\vrule height0pt
+    width0pt depth8pt}
+%
+ \def\lastand{\ifnum\value{inst}=2\relax
+                 \unskip{} \andname\
+              \else
+                 \unskip, \andname\
+              \fi}%
+ \def\and{\stepcounter{auth}\relax
+          \if@smartand
+             \ifnum\value{auth}=\value{inst}%
+                \lastand
+             \else
+                \unskip,
+             \fi
+          \else
+             \unskip,
+          \fi}%
+ \thispagestyle{empty}
+ \ifnum \col@number=\@ne
+   \@maketitle
+ \else
+   \twocolumn[\@maketitle]%
+ \fi
+%
+ \global\@topnum\z@
+ \if!\@thanks!\else
+    \@thanks
+\insert\footins{\vskip-3pt\hrule\@width\if@twocolumn\columnwidth
+\else 38mm\fi\vskip3pt}%
+ \fi
+ {\def\thanks##1{\unskip{}}%
+ \def\iand{\\[5pt]\let\and=\nand}%
+ \def\nand{\ifhmode\unskip\nobreak\fi\ $\cdot$ }%
+ \let\and=\nand
+ \def\at{\\\let\and=\iand}%
+ \footnotetext[0]{\kern-\bibindent
+ \ignorespaces\@institute}\vspace{5dd}}%
+%\if!\@mail!\else
+%   \footnotetext[0]{\kern-\bibindent\mailname\
+%   \ignorespaces\@mail}%
+%\fi
+%
+ \if@runhead
+    \ProcessRunnHead
+ \fi
+%
+ \endgroup
+ \setcounter{footnote}{0}
+ \global\let\thanks\relax
+ \global\let\maketitle\relax
+ \global\let\@maketitle\relax
+ \global\let\@thanks\@empty
+ \global\let\@author\@empty
+ \global\let\@date\@empty
+ \global\let\@title\@empty
+ \global\let\@subtitle\@empty
+ \global\let\title\relax
+ \global\let\author\relax
+ \global\let\date\relax
+ \global\let\and\relax}
+
+\def\makeheadbox{{%
+\hbox to0pt{\vbox{\baselineskip=10dd\hrule\hbox
+to\hsize{\vrule\kern3pt\vbox{\kern3pt
+\hbox{\bfseries\@journalname\ manuscript No.}
+\hbox{(will be inserted by the editor)}
+\kern3pt}\hfil\kern3pt\vrule}\hrule}%
+\hss}}}
+%
+\def\rubric{\setbox0=\hbox{\small\strut}\@tempdima=\ht0\advance
+\@tempdima\dp0\advance\@tempdima2\fboxsep\vrule\@height\@tempdima
+\@width\z@}
+\newdimen\rubricwidth
+%
+\def\@maketitle{\newpage
+\normalfont
+\vbox to0pt{\if@twocolumn\vskip-39pt\else\vskip-49pt\fi
+\nointerlineskip
+\makeheadbox\vss}\nointerlineskip
+\vbox to 0pt{\offinterlineskip\rubricwidth=\columnwidth
+%%%%\vskip-12.5pt          % -12.5pt
+\if@twocolumn\else % one column journal
+   \divide\rubricwidth by144\multiply\rubricwidth by89 % perform golden section
+   \vskip-\topskip
+\fi
+\hrule\@height0.35mm\noindent
+\advance\fboxsep by.25mm
+\global\advance\rubricwidth by0pt
+\rubric
+\vss}\vskip19.5pt    % war 9pt
+%
+\if@twocolumn\else
+ \gdef\footnoterule{%
+  \kern-3\p@
+  \hrule\@width38mm     % \columnwidth  \rubricwidth
+  \kern2.6\p@}
+\fi
+%
+ \setbox\authrun=\vbox\bgroup
+     \if@twocolumn
+        \hrule\@height10.5mm\@width0\p@
+     \else
+        \hrule\@height 2mm\@width0\p@
+     \fi
+     \pretolerance=10000
+     \rightskip=0pt plus 4cm
+    \nothanksmarks
+%   \if!\@headnote!\else
+%     \noindent
+%     {\LARGE\normalfont\itshape\ignorespaces\@headnote\par}\vskip 3.5mm
+%   \fi
+    {\LARGE\bfseries
+     \noindent\ignorespaces
+     \@title \par}\vskip 17pt\relax
+    \if!\@subtitle!\else
+      {\large\bfseries
+      \pretolerance=10000
+      \rightskip=0pt plus 3cm
+      \vskip-12pt
+%     \noindent\ignorespaces\@subtitle \par}\vskip 11.24pt\relax
+      \noindent\ignorespaces\@subtitle \par}\vskip 17pt\relax
+    \fi
+    {\authorfont
+    \setbox0=\vbox{\setcounter{auth}{1}\def\and{\stepcounter{auth} }%
+                   \hfuzz=2\textwidth\def\thanks##1{}\@author}%
+    \setcounter{footnote}{0}%
+    \global\value{inst}=\value{auth}%
+    \setcounter{auth}{1}%
+    \if@twocolumn
+       \rightskip43mm plus 4cm minus 3mm
+    \else % one column journal
+       \rightskip=\linewidth
+       \advance\rightskip by-\rubricwidth
+       \advance\rightskip by0pt plus 4cm minus 3mm
+    \fi
+%
+\def\and{\unskip\nobreak\enskip{\boldmath$\cdot$}\enskip\ignorespaces}%
+    \noindent\ignorespaces\@author\vskip7.23pt}
+%
+    \small
+    \if!\@dedic!\else
+       \par
+       \normalsize\it
+       \addvspace\baselineskip
+       \noindent\@dedic
+    \fi
+ \egroup % end of header box
+ \@tempdima=\headerboxheight
+ \advance\@tempdima by-\ht\authrun
+ \unvbox\authrun
+ \ifdim\@tempdima>0pt
+    \vrule width0pt height\@tempdima\par
+ \fi
+ \noindent{\small\@date\if@twocolumn\vskip 7.2mm\else\vskip 5.2mm\fi}
+ \global\@minipagetrue
+ \global\everypar{\global\@minipagefalse\global\everypar{}}%
+%\vskip22.47pt
+}
+%
+\if@mathematic
+   \def\vec#1{\ensuremath{\mathchoice
+                     {\mbox{\boldmath$\displaystyle\mathbf{#1}$}}
+                     {\mbox{\boldmath$\textstyle\mathbf{#1}$}}
+                     {\mbox{\boldmath$\scriptstyle\mathbf{#1}$}}
+                     {\mbox{\boldmath$\scriptscriptstyle\mathbf{#1}$}}}}
+\else
+   \def\vec#1{\ensuremath{\mathchoice
+                     {\mbox{\boldmath$\displaystyle#1$}}
+                     {\mbox{\boldmath$\textstyle#1$}}
+                     {\mbox{\boldmath$\scriptstyle#1$}}
+                     {\mbox{\boldmath$\scriptscriptstyle#1$}}}}
+\fi
+%
+\def\tens#1{\ensuremath{\mathsf{#1}}}
+%
+\setcounter{secnumdepth}{3}
+\newcounter {section}
+\newcounter {subsection}[section]
+\newcounter {subsubsection}[subsection]
+\newcounter {paragraph}[subsubsection]
+\newcounter {subparagraph}[paragraph]
+\renewcommand\thesection      {\@arabic\c@section}
+\renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}
+\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
+\renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
+\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
+%
+\def\@hangfrom#1{\setbox\@tempboxa\hbox{#1}%
+      \hangindent \z@\noindent\box\@tempboxa}
+%
+\def\@seccntformat#1{\csname the#1\endcsname\sectcounterend
+\hskip\betweenumberspace}
+%
+% \newif\if@sectrule
+% \if@twocolumn\else\let\@sectruletrue=\relax\fi
+% \if@avier\let\@sectruletrue=\relax\fi
+% \def\makesectrule{\if@sectrule\global\@sectrulefalse\null\vglue-\topskip
+% \hrule\nobreak\parskip=5pt\relax\fi}
+% %
+% \let\makesectruleori=\makesectrule
+% \def\restoresectrule{\global\let\makesectrule=\makesectruleori\global\@sectrulefalse}
+% \def\nosectrule{\let\makesectrule=\restoresectrule}
+%
+\def\@startsection#1#2#3#4#5#6{%
+  \if@noskipsec \leavevmode \fi
+  \par
+  \@tempskipa #4\relax
+  \@afterindenttrue
+  \ifdim \@tempskipa <\z@
+    \@tempskipa -\@tempskipa \@afterindentfalse
+  \fi
+  \if@nobreak
+    \everypar{}%
+  \else
+    \addpenalty\@secpenalty\addvspace\@tempskipa
+  \fi
+% \ifnum#2=1\relax\@sectruletrue\fi
+  \@ifstar
+    {\@ssect{#3}{#4}{#5}{#6}}%
+    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
+%
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+  \ifnum #2>\c@secnumdepth
+    \let\@svsec\@empty
+  \else
+    \refstepcounter{#1}%
+    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
+  \fi
+  \@tempskipa #5\relax
+  \ifdim \@tempskipa>\z@
+    \begingroup
+      #6{% \makesectrule
+        \@hangfrom{\hskip #3\relax\@svsec}%
+          \raggedright
+          \hyphenpenalty \@M%
+          \interlinepenalty \@M #8\@@par}%
+    \endgroup
+    \csname #1mark\endcsname{#7}%
+    \addcontentsline{toc}{#1}{%
+      \ifnum #2>\c@secnumdepth \else
+        \protect\numberline{\csname the#1\endcsname\sectcounterend}%
+      \fi
+      #7}%
+  \else
+    \def\@svsechd{%
+      #6{\hskip #3\relax
+      \@svsec #8\/\hskip\aftertext}%
+      \csname #1mark\endcsname{#7}%
+      \addcontentsline{toc}{#1}{%
+        \ifnum #2>\c@secnumdepth \else
+          \protect\numberline{\csname the#1\endcsname}%
+        \fi
+        #7}}%
+  \fi
+  \@xsect{#5}}
+%
+\def\@ssect#1#2#3#4#5{%
+  \@tempskipa #3\relax
+  \ifdim \@tempskipa>\z@
+    \begingroup
+      #4{% \makesectrule
+        \@hangfrom{\hskip #1}%
+          \interlinepenalty \@M #5\@@par}%
+    \endgroup
+  \else
+    \def\@svsechd{#4{\hskip #1\relax #5}}%
+  \fi
+  \@xsect{#3}}
+
+%
+% measures and setting of sections
+%
+\def\section{\@startsection{section}{1}{\z@}%
+    {-21dd plus-8pt minus-4pt}{10.5dd}
+     {\normalsize\bfseries\boldmath}}
+\def\subsection{\@startsection{subsection}{2}{\z@}%
+    {-21dd plus-8pt minus-4pt}{10.5dd}
+     {\normalsize\upshape}}
+\def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+    {-13dd plus-8pt minus-4pt}{10.5dd}
+     {\normalsize\itshape}}
+\def\paragraph{\@startsection{paragraph}{4}{\z@}%
+    {-13pt plus-8pt minus-4pt}{\z@}{\normalsize\itshape}}
+
+\setlength\leftmargini  {\parindent}
+\leftmargin  \leftmargini
+\setlength\leftmarginii {\parindent}
+\setlength\leftmarginiii {1.87em}
+\setlength\leftmarginiv  {1.7em}
+\setlength\leftmarginv  {.5em}
+\setlength\leftmarginvi {.5em}
+\setlength  \labelsep  {.5em}
+\setlength  \labelwidth{\leftmargini}
+\addtolength\labelwidth{-\labelsep}
+\@beginparpenalty -\@lowpenalty
+\@endparpenalty   -\@lowpenalty
+\@itempenalty     -\@lowpenalty
+\renewcommand\theenumi{\@arabic\c@enumi}
+\renewcommand\theenumii{\@alph\c@enumii}
+\renewcommand\theenumiii{\@roman\c@enumiii}
+\renewcommand\theenumiv{\@Alph\c@enumiv}
+\newcommand\labelenumi{\theenumi.}
+\newcommand\labelenumii{(\theenumii)}
+\newcommand\labelenumiii{\theenumiii.}
+\newcommand\labelenumiv{\theenumiv.}
+\renewcommand\p@enumii{\theenumi}
+\renewcommand\p@enumiii{\theenumi(\theenumii)}
+\renewcommand\p@enumiv{\p@enumiii\theenumiii}
+\newcommand\labelitemi{\normalfont\bfseries --}
+\newcommand\labelitemii{\normalfont\bfseries --}
+\newcommand\labelitemiii{$\m@th\bullet$}
+\newcommand\labelitemiv{$\m@th\cdot$}
+
+\if@spthms
+% definition of the "\spnewtheorem" command.
+%
+% Usage:
+%
+%     \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font}
+% or  \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font}
+% or  \spnewtheorem*{env_nam}{caption}{cap_font}{body_font}
+%
+% New is "cap_font" and "body_font". It stands for
+% fontdefinition of the caption and the text itself.
+%
+% "\spnewtheorem*" gives a theorem without number.
+%
+% A defined spnewthoerem environment is used as described
+% by Lamport.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\@thmcountersep{}
+\def\@thmcounterend{}
+\newcommand\nocaption{\noexpand\@gobble}
+\newdimen\spthmsep \spthmsep=5pt
+
+\def\spnewtheorem{\@ifstar{\@sthm}{\@Sthm}}
+
+% definition of \spnewtheorem with number
+
+\def\@spnthm#1#2{%
+  \@ifnextchar[{\@spxnthm{#1}{#2}}{\@spynthm{#1}{#2}}}
+\def\@Sthm#1{\@ifnextchar[{\@spothm{#1}}{\@spnthm{#1}}}
+
+\def\@spxnthm#1#2[#3]#4#5{\expandafter\@ifdefinable\csname #1\endcsname
+   {\@definecounter{#1}\@addtoreset{#1}{#3}%
+   \expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand
+     \csname the#3\endcsname \noexpand\@thmcountersep \@thmcounter{#1}}%
+   \expandafter\xdef\csname #1name\endcsname{#2}%
+   \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#4}{#5}}%
+                              \global\@namedef{end#1}{\@endtheorem}}}
+
+\def\@spynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname
+   {\@definecounter{#1}%
+   \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}%
+   \expandafter\xdef\csname #1name\endcsname{#2}%
+   \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#3}{#4}}%
+                               \global\@namedef{end#1}{\@endtheorem}}}
+
+\def\@spothm#1[#2]#3#4#5{%
+  \@ifundefined{c@#2}{\@latexerr{No theorem environment `#2' defined}\@eha}%
+  {\expandafter\@ifdefinable\csname #1\endcsname
+  {\global\@namedef{the#1}{\@nameuse{the#2}}%
+  \expandafter\xdef\csname #1name\endcsname{#3}%
+  \global\@namedef{#1}{\@spthm{#2}{\csname #1name\endcsname}{#4}{#5}}%
+  \global\@namedef{end#1}{\@endtheorem}}}}
+
+\def\@spthm#1#2#3#4{\topsep 7\p@ \@plus2\p@ \@minus4\p@
+\labelsep=\spthmsep\refstepcounter{#1}%
+\@ifnextchar[{\@spythm{#1}{#2}{#3}{#4}}{\@spxthm{#1}{#2}{#3}{#4}}}
+
+\def\@spxthm#1#2#3#4{\@spbegintheorem{#2}{\csname the#1\endcsname}{#3}{#4}%
+                    \ignorespaces}
+
+\def\@spythm#1#2#3#4[#5]{\@spopargbegintheorem{#2}{\csname
+       the#1\endcsname}{#5}{#3}{#4}\ignorespaces}
+
+\def\normalthmheadings{\def\@spbegintheorem##1##2##3##4{\trivlist\normalfont
+                 \item[\hskip\labelsep{##3##1\ ##2\@thmcounterend}]##4}
+\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
+      \item[\hskip\labelsep{##4##1\ ##2}]{##4(##3)\@thmcounterend\ }##5}}
+\normalthmheadings
+
+\def\reversethmheadings{\def\@spbegintheorem##1##2##3##4{\trivlist\normalfont
+                 \item[\hskip\labelsep{##3##2\ ##1\@thmcounterend}]##4}
+\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
+      \item[\hskip\labelsep{##4##2\ ##1}]{##4(##3)\@thmcounterend\ }##5}}
+
+% definition of \spnewtheorem* without number
+
+\def\@sthm#1#2{\@Ynthm{#1}{#2}}
+
+\def\@Ynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname
+   {\global\@namedef{#1}{\@Thm{\csname #1name\endcsname}{#3}{#4}}%
+    \expandafter\xdef\csname #1name\endcsname{#2}%
+    \global\@namedef{end#1}{\@endtheorem}}}
+
+\def\@Thm#1#2#3{\topsep 7\p@ \@plus2\p@ \@minus4\p@
+\@ifnextchar[{\@Ythm{#1}{#2}{#3}}{\@Xthm{#1}{#2}{#3}}}
+
+\def\@Xthm#1#2#3{\@Begintheorem{#1}{#2}{#3}\ignorespaces}
+
+\def\@Ythm#1#2#3[#4]{\@Opargbegintheorem{#1}
+       {#4}{#2}{#3}\ignorespaces}
+
+\def\@Begintheorem#1#2#3{#3\trivlist
+                           \item[\hskip\labelsep{#2#1\@thmcounterend}]}
+
+\def\@Opargbegintheorem#1#2#3#4{#4\trivlist
+      \item[\hskip\labelsep{#3#1}]{#3(#2)\@thmcounterend\ }}
+
+% initialize theorem environment
+
+\if@envcntsect
+   \def\@thmcountersep{.}
+   \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
+\else
+   \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape}
+   \if@envcntreset
+      \@addtoreset{theorem}{section}
+   \else
+      \@addtoreset{theorem}{chapter}
+   \fi
+\fi
+
+%definition of divers theorem environments
+\spnewtheorem*{claim}{Claim}{\itshape}{\rmfamily}
+\spnewtheorem*{proof}{Proof}{\itshape}{\rmfamily}
+\if@envcntsame % all environments like "Theorem" - using its counter
+   \def\spn@wtheorem#1#2#3#4{\@spothm{#1}[theorem]{#2}{#3}{#4}}
+\else % all environments with their own counter
+   \if@envcntsect % show section counter
+      \def\spn@wtheorem#1#2#3#4{\@spxnthm{#1}{#2}[section]{#3}{#4}}
+   \else % not numbered with section
+      \if@envcntreset
+         \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
+                                   \@addtoreset{#1}{section}}
+      \else
+         \let\spn@wtheorem=\@spynthm
+      \fi
+   \fi
+\fi
+%
+\let\spdefaulttheorem=\spn@wtheorem
+%
+\spn@wtheorem{case}{Case}{\itshape}{\rmfamily}
+\spn@wtheorem{conjecture}{Conjecture}{\itshape}{\rmfamily}
+\spn@wtheorem{corollary}{Corollary}{\bfseries}{\itshape}
+\spn@wtheorem{definition}{Definition}{\bfseries}{\rmfamily}
+\spn@wtheorem{example}{Example}{\itshape}{\rmfamily}
+\spn@wtheorem{exercise}{Exercise}{\bfseries}{\rmfamily}
+\spn@wtheorem{lemma}{Lemma}{\bfseries}{\itshape}
+\spn@wtheorem{note}{Note}{\itshape}{\rmfamily}
+\spn@wtheorem{problem}{Problem}{\bfseries}{\rmfamily}
+\spn@wtheorem{property}{Property}{\itshape}{\rmfamily}
+\spn@wtheorem{proposition}{Proposition}{\bfseries}{\itshape}
+\spn@wtheorem{question}{Question}{\itshape}{\rmfamily}
+\spn@wtheorem{solution}{Solution}{\bfseries}{\rmfamily}
+\spn@wtheorem{remark}{Remark}{\itshape}{\rmfamily}
+%
+\newenvironment{theopargself}
+    {\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
+         \item[\hskip\labelsep{##4##1\ ##2}]{##4##3\@thmcounterend\ }##5}
+     \def\@Opargbegintheorem##1##2##3##4{##4\trivlist
+         \item[\hskip\labelsep{##3##1}]{##3##2\@thmcounterend\ }}}{}
+\newenvironment{theopargself*}
+    {\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
+         \item[\hskip\labelsep{##4##1\ ##2}]{\hspace*{-\labelsep}##4##3\@thmcounterend}##5}
+     \def\@Opargbegintheorem##1##2##3##4{##4\trivlist
+         \item[\hskip\labelsep{##3##1}]{\hspace*{-\labelsep}##3##2\@thmcounterend}}}{}
+%
+\fi
+
+\def\@takefromreset#1#2{%
+    \def\@tempa{#1}%
+    \let\@tempd\@elt
+    \def\@elt##1{%
+        \def\@tempb{##1}%
+        \ifx\@tempa\@tempb\else
+            \@addtoreset{##1}{#2}%
+        \fi}%
+    \expandafter\expandafter\let\expandafter\@tempc\csname cl@#2\endcsname
+    \expandafter\def\csname cl@#2\endcsname{}%
+    \@tempc
+    \let\@elt\@tempd}
+
+\def\squareforqed{\hbox{\rlap{$\sqcap$}$\sqcup$}}
+\def\qed{\ifmmode\else\unskip\quad\fi\squareforqed}
+\def\smartqed{\def\qed{\ifmmode\squareforqed\else{\unskip\nobreak\hfil
+\penalty50\hskip1em\null\nobreak\hfil\squareforqed
+\parfillskip=0pt\finalhyphendemerits=0\endgraf}\fi}}
+
+% Define `abstract' environment
+\def\abstract{\topsep=0pt\partopsep=0pt\parsep=0pt\itemsep=0pt\relax
+\trivlist\item[\hskip\labelsep
+{\bfseries\abstractname}]\if!\abstractname!\hskip-\labelsep\fi}
+\if@twocolumn
+% \if@avier
+%   \def\endabstract{\endtrivlist\addvspace{5mm}\strich}
+%   \def\strich{\hrule\vskip1ptplus12pt}
+% \else
+    \def\endabstract{\endtrivlist\addvspace{3mm}}
+% \fi
+\else
+\fi
+%
+\newenvironment{verse}
+               {\let\\\@centercr
+                \list{}{\itemsep      \z@
+                        \itemindent   -1.5em%
+                        \listparindent\itemindent
+                        \rightmargin  \leftmargin
+                        \advance\leftmargin 1.5em}%
+                \item\relax}
+               {\endlist}
+\newenvironment{quotation}
+               {\list{}{\listparindent 1.5em%
+                        \itemindent    \listparindent
+                        \rightmargin   \leftmargin
+                        \parsep        \z@ \@plus\p@}%
+                \item\relax}
+               {\endlist}
+\newenvironment{quote}
+               {\list{}{\rightmargin\leftmargin}%
+                \item\relax}
+               {\endlist}
+\newcommand\appendix{\par\small
+  \setcounter{section}{0}%
+  \setcounter{subsection}{0}%
+  \renewcommand\thesection{\@Alph\c@section}}
+\setlength\arraycolsep{1.5\p@}
+\setlength\tabcolsep{6\p@}
+\setlength\arrayrulewidth{.4\p@}
+\setlength\doublerulesep{2\p@}
+\setlength\tabbingsep{\labelsep}
+\skip\@mpfootins = \skip\footins
+\setlength\fboxsep{3\p@}
+\setlength\fboxrule{.4\p@}
+\renewcommand\theequation{\@arabic\c@equation}
+\newcounter{figure}
+\renewcommand\thefigure{\@arabic\c@figure}
+\def\fps@figure{tbp}
+\def\ftype@figure{1}
+\def\ext@figure{lof}
+\def\fnum@figure{\figurename~\thefigure}
+\newenvironment{figure}
+               {\@float{figure}}
+               {\end@float}
+\newenvironment{figure*}
+               {\@dblfloat{figure}}
+               {\end@dblfloat}
+\newcounter{table}
+\renewcommand\thetable{\@arabic\c@table}
+\def\fps@table{tbp}
+\def\ftype@table{2}
+\def\ext@table{lot}
+\def\fnum@table{\tablename~\thetable}
+\newenvironment{table}
+               {\@float{table}}
+               {\end@float}
+\newenvironment{table*}
+               {\@dblfloat{table}}
+               {\end@dblfloat}
+%
+\def \@floatboxreset {%
+        \reset@font
+        \small
+        \@setnobreak
+        \@setminipage
+}
+%
+\newcommand{\tableheadseprule}{\noalign{\hrule height.375mm}}
+%
+\newlength\abovecaptionskip
+\newlength\belowcaptionskip
+\setlength\abovecaptionskip{10\p@}
+\setlength\belowcaptionskip{0\p@}
+\newcommand\leftlegendglue{}
+
+\def\fig@type{figure}
+
+\newdimen\figcapgap\figcapgap=3pt
+\newdimen\tabcapgap\tabcapgap=5.5pt
+
+\@ifundefined{floatlegendstyle}{\def\floatlegendstyle{\bfseries}}{}
+
+\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname
+  ext@#1\endcsname}{#1}{\protect\numberline{\csname
+  the#1\endcsname}{\ignorespaces #2}}\begingroup
+    \@parboxrestore
+    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+  \endgroup}
+
+\def\capstrut{\vrule\@width\z@\@height\topskip}
+
+\@ifundefined{captionstyle}{\def\captionstyle{\normalfont\small}}{}
+
+\long\def\@makecaption#1#2{%
+ \captionstyle
+ \ifx\@captype\fig@type
+   \vskip\figcapgap
+ \fi
+ \setbox\@tempboxa\hbox{{\floatlegendstyle #1\floatcounterend}%
+ \capstrut #2}%
+ \ifdim \wd\@tempboxa >\hsize
+   {\floatlegendstyle #1\floatcounterend}\capstrut #2\par
+ \else
+   \hbox to\hsize{\leftlegendglue\unhbox\@tempboxa\hfil}%
+ \fi
+ \ifx\@captype\fig@type\else
+   \vskip\tabcapgap
+ \fi}
+
+\newdimen\figgap\figgap=1cc
+\long\def\@makesidecaption#1#2{%
+   \parbox[b]{\@tempdimb}{\captionstyle{\floatlegendstyle
+                                         #1\floatcounterend}#2}}
+\def\sidecaption#1\caption{%
+\setbox\@tempboxa=\hbox{#1\unskip}%
+\if@twocolumn
+ \ifdim\hsize<\textwidth\else
+   \ifdim\wd\@tempboxa<\columnwidth
+      \typeout{Double column float fits into single column -
+            ^^Jyou'd better switch the environment. }%
+   \fi
+ \fi
+\fi
+\@tempdimb=\hsize
+\advance\@tempdimb by-\figgap
+\advance\@tempdimb by-\wd\@tempboxa
+\ifdim\@tempdimb<3cm
+    \typeout{\string\sidecaption: No sufficient room for the legend;
+             using normal \string\caption. }%
+   \unhbox\@tempboxa
+   \let\@capcommand=\@caption
+\else
+   \let\@capcommand=\@sidecaption
+   \leavevmode
+   \unhbox\@tempboxa
+   \hfill
+\fi
+\refstepcounter\@captype
+\@dblarg{\@capcommand\@captype}}
+
+\long\def\@sidecaption#1[#2]#3{\addcontentsline{\csname
+  ext@#1\endcsname}{#1}{\protect\numberline{\csname
+  the#1\endcsname}{\ignorespaces #2}}\begingroup
+    \@parboxrestore
+    \@makesidecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+  \endgroup}
+
+% Define `acknowledgement' environment
+\def\acknowledgement{\par\addvspace{17pt}\small\rmfamily
+\trivlist\if!\ackname!\item[]\else
+\item[\hskip\labelsep
+{\bfseries\ackname}]\fi}
+\def\endacknowledgement{\endtrivlist\addvspace{6pt}}
+\newenvironment{acknowledgements}{\begin{acknowledgement}}
+{\end{acknowledgement}}
+% Define `noteadd' environment
+\def\noteadd{\par\addvspace{17pt}\small\rmfamily
+\trivlist\item[\hskip\labelsep
+{\itshape\noteaddname}]}
+\def\endnoteadd{\endtrivlist\addvspace{6pt}}
+
+\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
+\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
+\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
+\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
+\newcommand\@pnumwidth{1.55em}
+\newcommand\@tocrmarg{2.55em}
+\newcommand\@dotsep{4.5}
+\setcounter{tocdepth}{1}
+\newcommand\tableofcontents{%
+    \section*{\contentsname}%
+    \@starttoc{toc}%
+    \addtocontents{toc}{\begingroup\protect\small}%
+    \AtEndDocument{\addtocontents{toc}{\endgroup}}%
+    }
+\newcommand*\l@part[2]{%
+  \ifnum \c@tocdepth >-2\relax
+    \addpenalty\@secpenalty
+    \addvspace{2.25em \@plus\p@}%
+    \begingroup
+      \setlength\@tempdima{3em}%
+      \parindent \z@ \rightskip \@pnumwidth
+      \parfillskip -\@pnumwidth
+      {\leavevmode
+       \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
+       \nobreak
+       \if@compatibility
+         \global\@nobreaktrue
+         \everypar{\global\@nobreakfalse\everypar{}}%
+      \fi
+    \endgroup
+  \fi}
+\newcommand*\l@section{\@dottedtocline{1}{0pt}{1.5em}}
+\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
+\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
+\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
+\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
+\newcommand\listoffigures{%
+    \section*{\listfigurename
+      \@mkboth{\listfigurename}%
+              {\listfigurename}}%
+    \@starttoc{lof}%
+    }
+\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
+\newcommand\listoftables{%
+    \section*{\listtablename
+      \@mkboth{\listtablename}{\listtablename}}%
+    \@starttoc{lot}%
+    }
+\let\l@table\l@figure
+\newdimen\bibindent
+\setlength\bibindent{\parindent}
+\def\@biblabel#1{#1.}
+\def\@lbibitem[#1]#2{\item[{[#1]}\hfill]\if@filesw
+      {\let\protect\noexpand
+       \immediate
+       \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
+\newenvironment{thebibliography}[1]
+     {\section*{\refname
+        \@mkboth{\refname}{\refname}}\small
+      \list{\@biblabel{\@arabic\c@enumiv}}%
+           {\settowidth\labelwidth{\@biblabel{#1}}%
+            \leftmargin\labelwidth
+            \advance\leftmargin\labelsep
+            \@openbib@code
+            \usecounter{enumiv}%
+            \let\p@enumiv\@empty
+            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+      \sloppy\clubpenalty4000\widowpenalty4000%
+      \sfcode`\.\@m}
+     {\def\@noitemerr
+       {\@latex@warning{Empty `thebibliography' environment}}%
+      \endlist}
+%
+\newcount\@tempcntc
+\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
+  \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do
+    {\@ifundefined
+       {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bfseries
+        ?}\@warning
+       {Citation `\@citeb' on page \thepage \space undefined}}%
+    {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}%
+     \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne
+       \@citea\def\@citea{,\hskip0.1em\ignorespaces}\hbox{\csname b@\@citeb\endcsname}%
+     \else
+      \advance\@tempcntb\@ne
+      \ifnum\@tempcntb=\@tempcntc
+      \else\advance\@tempcntb\m@ne\@citeo
+      \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}}
+\def\@citeo{\ifnum\@tempcnta>\@tempcntb\else
+            \@citea\def\@citea{,\hskip0.1em\ignorespaces}%
+  \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else
+   {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else \def\@citea{--}\fi
+    \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi}
+%
+\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
+\let\@openbib@code\@empty
+\newenvironment{theindex}
+               {\if@twocolumn
+                  \@restonecolfalse
+                \else
+                  \@restonecoltrue
+                \fi
+                \columnseprule \z@
+                \columnsep 35\p@
+                \twocolumn[\section*{\indexname}]%
+                \@mkboth{\indexname}{\indexname}%
+                \thispagestyle{plain}\parindent\z@
+                \parskip\z@ \@plus .3\p@\relax
+                \let\item\@idxitem}
+               {\if@restonecol\onecolumn\else\clearpage\fi}
+\newcommand\@idxitem{\par\hangindent 40\p@}
+\newcommand\subitem{\@idxitem \hspace*{20\p@}}
+\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
+\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
+
+\if@twocolumn
+ \renewcommand\footnoterule{%
+  \kern-3\p@
+  \hrule\@width\columnwidth
+  \kern2.6\p@}
+\else
+ \renewcommand\footnoterule{%
+  \kern-3\p@
+  \hrule\@width.382\columnwidth
+  \kern2.6\p@}
+\fi
+\newcommand\@makefntext[1]{%
+    \noindent
+    \hb@xt@\bibindent{\hss\@makefnmark\enspace}#1}
+%
+\def\trans@english{\switcht@albion}
+\def\trans@french{\switcht@francais}
+\def\trans@german{\switcht@deutsch}
+\newenvironment{translation}[1]{\if!#1!\else
+\@ifundefined{selectlanguage}{\csname trans@#1\endcsname}{\selectlanguage{#1}}%
+\fi}{}
+% languages
+% English section
+\def\switcht@albion{%\typeout{English spoken.}%
+ \def\abstractname{Abstract}%
+ \def\ackname{Acknowledgements}%
+ \def\andname{and}%
+ \def\lastandname{, and}%
+ \def\appendixname{Appendix}%
+ \def\chaptername{Chapter}%
+ \def\claimname{Claim}%
+ \def\conjecturename{Conjecture}%
+ \def\contentsname{Contents}%
+ \def\corollaryname{Corollary}%
+ \def\definitionname{Definition}%
+ \def\emailname{E-mail}%
+ \def\examplename{Example}%
+ \def\exercisename{Exercise}%
+ \def\figurename{Fig.}%
+ \def\keywordname{{\bfseries Keywords}}%
+ \def\indexname{Index}%
+ \def\lemmaname{Lemma}%
+ \def\contriblistname{List of Contributors}%
+ \def\listfigurename{List of Figures}%
+ \def\listtablename{List of Tables}%
+ \def\mailname{{\itshape Correspondence to\/}:}%
+ \def\noteaddname{Note added in proof}%
+ \def\notename{Note}%
+ \def\partname{Part}%
+ \def\problemname{Problem}%
+ \def\proofname{Proof}%
+ \def\propertyname{Property}%
+ \def\questionname{Question}%
+ \def\refname{References}%
+ \def\remarkname{Remark}%
+ \def\seename{see}%
+ \def\solutionname{Solution}%
+ \def\tablename{Table}%
+ \def\theoremname{Theorem}%
+}\switcht@albion % make English default
+%
+% French section
+\def\switcht@francais{\svlanginfo
+%\typeout{On parle francais.}%
+ \def\abstractname{R\'esum\'e\runinend}%
+ \def\ackname{Remerciements\runinend}%
+ \def\andname{et}%
+ \def\lastandname{ et}%
+ \def\appendixname{Appendice}%
+ \def\chaptername{Chapitre}%
+ \def\claimname{Pr\'etention}%
+ \def\conjecturename{Hypoth\`ese}%
+ \def\contentsname{Table des mati\`eres}%
+ \def\corollaryname{Corollaire}%
+ \def\definitionname{D\'efinition}%
+ \def\emailname{E-mail}%
+ \def\examplename{Exemple}%
+ \def\exercisename{Exercice}%
+ \def\figurename{Fig.}%
+ \def\keywordname{{\bfseries Mots-cl\'e\runinend}}%
+ \def\indexname{Index}%
+ \def\lemmaname{Lemme}%
+ \def\contriblistname{Liste des contributeurs}%
+ \def\listfigurename{Liste des figures}%
+ \def\listtablename{Liste des tables}%
+ \def\mailname{{\itshape Correspondence to\/}:}%
+ \def\noteaddname{Note ajout\'ee \`a l'\'epreuve}%
+ \def\notename{Remarque}%
+ \def\partname{Partie}%
+ \def\problemname{Probl\`eme}%
+ \def\proofname{Preuve}%
+ \def\propertyname{Caract\'eristique}%
+%\def\propositionname{Proposition}%
+ \def\questionname{Question}%
+ \def\refname{Bibliographie}%
+ \def\remarkname{Remarque}%
+ \def\seename{voyez}%
+ \def\solutionname{Solution}%
+%\def\subclassname{{\it Subject Classifications\/}:}%
+ \def\tablename{Tableau}%
+ \def\theoremname{Th\'eor\`eme}%
+}
+%
+% German section
+\def\switcht@deutsch{\svlanginfo
+%\typeout{Man spricht deutsch.}%
+ \def\abstractname{Zusammenfassung\runinend}%
+ \def\ackname{Danksagung\runinend}%
+ \def\andname{und}%
+ \def\lastandname{ und}%
+ \def\appendixname{Anhang}%
+ \def\chaptername{Kapitel}%
+ \def\claimname{Behauptung}%
+ \def\conjecturename{Hypothese}%
+ \def\contentsname{Inhaltsverzeichnis}%
+ \def\corollaryname{Korollar}%
+%\def\definitionname{Definition}%
+ \def\emailname{E-Mail}%
+ \def\examplename{Beispiel}%
+ \def\exercisename{\"Ubung}%
+ \def\figurename{Abb.}%
+ \def\keywordname{{\bfseries Schl\"usselw\"orter\runinend}}%
+ \def\indexname{Index}%
+%\def\lemmaname{Lemma}%
+ \def\contriblistname{Mitarbeiter}%
+ \def\listfigurename{Abbildungsverzeichnis}%
+ \def\listtablename{Tabellenverzeichnis}%
+ \def\mailname{{\itshape Correspondence to\/}:}%
+ \def\noteaddname{Nachtrag}%
+ \def\notename{Anmerkung}%
+ \def\partname{Teil}%
+%\def\problemname{Problem}%
+ \def\proofname{Beweis}%
+ \def\propertyname{Eigenschaft}%
+%\def\propositionname{Proposition}%
+ \def\questionname{Frage}%
+ \def\refname{Literatur}%
+ \def\remarkname{Anmerkung}%
+ \def\seename{siehe}%
+ \def\solutionname{L\"osung}%
+%\def\subclassname{{\it Subject Classifications\/}:}%
+ \def\tablename{Tabelle}%
+%\def\theoremname{Theorem}%
+}
+\newcommand\today{}
+\edef\today{\ifcase\month\or
+  January\or February\or March\or April\or May\or June\or
+  July\or August\or September\or October\or November\or December\fi
+  \space\number\day, \number\year}
+\setlength\columnsep{1.5cc}
+\setlength\columnseprule{0\p@}
+%
+\frenchspacing
+\clubpenalty=10000
+\widowpenalty=10000
+\def\thisbottomragged{\def\@textbottom{\vskip\z@ plus.0001fil
+\global\let\@textbottom\relax}}
+\pagestyle{headings}
+\pagenumbering{arabic}
+\if@twocolumn
+   \twocolumn
+\fi
+%\if@avier
+%   \onecolumn
+%   \setlength{\textwidth}{156mm}
+%   \setlength{\textheight}{226mm}
+%\fi
+\if@referee
+   \makereferee
+\fi
+\flushbottom
+\endinput
+%%
+%% End of file `svjour3.cls'.
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Graph.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Graph.java	Wed Jun 08 14:10:06 2011 +0200
@@ -35,6 +35,7 @@
     private final ArrayList<Node> nodes;
     private final StartNode start;
     int nextId;
+    int deletedNodeCount;
 
     static int nextGraphId = 0;
     int id = nextGraphId++;
@@ -49,6 +50,10 @@
         start = new StartNode(this);
     }
 
+    public int getDeletedNodeCount() {
+        return deletedNodeCount;
+    }
+
     public List<Node> getNodes() {
         return Collections.unmodifiableList(nodes);
     }
@@ -61,6 +66,7 @@
 
     void unregister(Node node) {
         nodes.set(node.id(), Node.Null);
+        deletedNodeCount++;
     }
 
     public StartNode start() {
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Node.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/Node.java	Wed Jun 08 14:10:06 2011 +0200
@@ -115,7 +115,7 @@
     public boolean isDeleted() {
         return id == DeletedID;
     }
-    
+
     public void forceDelete() {
         for (Node n : usages) {
             n.inputs.silentRemove(this);
--- a/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeArray.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.graph/src/com/oracle/max/graal/graph/NodeArray.java	Wed Jun 08 14:10:06 2011 +0200
@@ -128,7 +128,7 @@
         }
         return result;
     }
-    
+
     int silentRemove(Node n) {
         return silentReplace(n, null);
     }
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/Compiler.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/Compiler.java	Wed Jun 08 14:10:06 2011 +0200
@@ -28,6 +28,6 @@
 
     VMEntries getVMEntries();
     VMExits getVMExits();
-    C1XCompiler getCompiler();
+    GraalCompiler getCompiler();
 
 }
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/CompilerImpl.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/CompilerImpl.java	Wed Jun 08 14:10:06 2011 +0200
@@ -35,7 +35,7 @@
 import com.sun.cri.xir.*;
 
 /**
- * Singleton class holding the instance of the C1XCompiler.
+ * Singleton class holding the instance of the GraalCompiler.
  */
 public final class CompilerImpl implements Compiler, Remote {
 
@@ -51,11 +51,11 @@
             throw new IllegalStateException("Compiler already initialized");
         }
 
-        String remote = System.getProperty("c1x.remote");
+        String remote = System.getProperty("graal.remote");
         if (remote != null) {
             // remote compilation (will not create a local Compiler)
             try {
-                System.out.println("C1X compiler started in client/server mode, server: " + remote);
+                System.out.println("Graal compiler started in client/server mode, server: " + remote);
                 Socket socket = new Socket(remote, 1199);
                 ReplacingStreams streams = new ReplacingStreams(socket.getOutputStream(), socket.getInputStream());
                 streams.getInvocation().sendResult(new VMEntriesNative());
@@ -87,11 +87,11 @@
         @Override
         public void run() {
             VMExitsNative.compileMethods = false;
-            if (C1XOptions.PrintMetrics) {
-                C1XMetrics.print();
+            if (GraalOptions.PrintMetrics) {
+                GraalMetrics.print();
             }
-            if (C1XOptions.PrintTimers) {
-                C1XTimers.print();
+            if (GraalOptions.PrintTimers) {
+                GraalTimers.print();
             }
             if (PrintGCStats) {
                 printGCStats();
@@ -121,7 +121,7 @@
 
     private final VMEntries vmEntries;
     private final VMExits vmExits;
-    private C1XCompiler compiler;
+    private GraalCompiler compiler;
 
     private final HotSpotRuntime runtime;
     private final CiTarget target;
@@ -152,15 +152,15 @@
         vmEntries = entries;
         vmExits = exits;
 
-        // initialize compiler and C1XOptions
+        // initialize compiler and GraalOptions
         HotSpotVMConfig config = vmEntries.getConfiguration();
         config.check();
 
-        // these options are important - c1x4hotspot will not generate correct code without them
-        C1XOptions.GenSpecialDivChecks = true;
-        C1XOptions.NullCheckUniquePc = true;
-        C1XOptions.InvokeSnippetAfterArguments = true;
-        C1XOptions.StackShadowPages = config.stackShadowPages;
+        // these options are important - graal will not generate correct code without them
+        GraalOptions.GenSpecialDivChecks = true;
+        GraalOptions.NullCheckUniquePc = true;
+        GraalOptions.InvokeSnippetAfterArguments = true;
+        GraalOptions.StackShadowPages = config.stackShadowPages;
 
         runtime = new HotSpotRuntime(config, this);
         registerConfig = runtime.globalStubRegConfig;
@@ -179,9 +179,9 @@
     }
 
     @Override
-    public C1XCompiler getCompiler() {
+    public GraalCompiler getCompiler() {
         if (compiler == null) {
-            compiler = new C1XCompiler(runtime, target, generator, registerConfig);
+            compiler = new GraalCompiler(runtime, target, generator, registerConfig);
         }
         return compiler;
     }
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotField.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotField.java	Wed Jun 08 14:10:06 2011 +0200
@@ -60,10 +60,10 @@
     @Override
     public CiConstant constantValue(CiConstant receiver) {
         if (receiver == null) {
-            if (constant == null && holder.isResolved() && holder.isSubtypeOf(compiler.getVMEntries().getType(C1XOptions.class))) {
+            if (constant == null && holder.isResolved() && holder.isSubtypeOf(compiler.getVMEntries().getType(GraalOptions.class))) {
                 Field f;
                 try {
-                    f = C1XOptions.class.getField(name);
+                    f = GraalOptions.class.getField(name);
                 } catch (SecurityException e1) {
                     return null;
                 } catch (NoSuchFieldException e1) {
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotOptions.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotOptions.java	Wed Jun 08 14:10:06 2011 +0200
@@ -31,9 +31,9 @@
 public class HotSpotOptions {
 
     public static void setDefaultOptions() {
-        C1XOptions.CommentedAssembly = false;
-        C1XOptions.MethodEndBreakpointGuards = 2;
-        C1XOptions.ResolveClassBeforeStaticInvoke = false;
+        GraalOptions.CommentedAssembly = false;
+        GraalOptions.MethodEndBreakpointGuards = 2;
+        GraalOptions.ResolveClassBeforeStaticInvoke = false;
     }
 
     public static boolean setOption(String option) {
@@ -60,7 +60,7 @@
 
         Field f;
         try {
-            f = C1XOptions.class.getField(fieldName);
+            f = GraalOptions.class.getField(fieldName);
 
             if (value == null) {
                 if (f.getType() == Float.TYPE) {
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotProxy.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotProxy.java	Wed Jun 08 14:10:06 2011 +0200
@@ -31,7 +31,7 @@
     }
 
     private enum CompilerObjectType {
-        // this enum needs to have the same values as the one in c1x_Compiler.hpp
+        // this enum needs to have the same values as the one in graal_Compiler.hpp
         STUB(0x100000000000000L),
         METHOD(0x200000000000000L),
         CLASS(0x300000000000000L),
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRegisterConfig.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRegisterConfig.java	Wed Jun 08 14:10:06 2011 +0200
@@ -35,7 +35,7 @@
 
 public class HotSpotRegisterConfig implements RiRegisterConfig {
 
-    // be careful - the contents of this array are duplicated in c1x_CodeInstaller.cpp
+    // be careful - the contents of this array are duplicated in graal_CodeInstaller.cpp
     private final CiRegister[] allocatable = {
         rax, rbx, rcx, rdx, rsi, rdi, r8, r9, /* r10, */r11, r12, r13, r14, /*r15*/
         xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotVMConfig.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotVMConfig.java	Wed Jun 08 14:10:06 2011 +0200
@@ -25,7 +25,7 @@
 import com.sun.cri.ci.*;
 
 /**
- * Used to communicate configuration details, runtime offsets, etc. to c1x upon compileMethod.
+ * Used to communicate configuration details, runtime offsets, etc. to graal upon compileMethod.
  */
 public final class HotSpotVMConfig extends CompilerObject {
 
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotXirGenerator.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotXirGenerator.java	Wed Jun 08 14:10:06 2011 +0200
@@ -40,7 +40,7 @@
 
 public class HotSpotXirGenerator implements RiXirGenerator {
 
-    // this needs to correspond to c1x_CodeInstaller.hpp
+    // this needs to correspond to graal_CodeInstaller.hpp
     // @formatter:off
     private static final Integer MARK_VERIFIED_ENTRY            = 0x0001;
     private static final Integer MARK_UNVERIFIED_ENTRY          = 0x0002;
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/VMExitsNative.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/VMExitsNative.java	Wed Jun 08 14:10:06 2011 +0200
@@ -85,7 +85,7 @@
 
             if (result.bailout() != null) {
                 Throwable cause = result.bailout().getCause();
-                if (!C1XOptions.QuietBailout) {
+                if (!GraalOptions.QuietBailout) {
                     StringWriter out = new StringWriter();
                     result.bailout().printStackTrace(new PrintWriter(out));
                     TTY.println("Bailout:\n" + out.toString());
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/logging/CountingProxy.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/logging/CountingProxy.java	Wed Jun 08 14:10:06 2011 +0200
@@ -33,7 +33,7 @@
  */
 public class CountingProxy<T> implements InvocationHandler {
 
-    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("c1x.countcalls"));
+    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("graal.countcalls"));
 
     private T delegate;
 
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/logging/Logger.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/logging/Logger.java	Wed Jun 08 14:10:06 2011 +0200
@@ -31,7 +31,7 @@
  */
 public class Logger {
 
-    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("c1x.debug"));
+    public static final boolean ENABLED = Boolean.valueOf(System.getProperty("graal.debug"));
     private static final int SPACING = 4;
     private static Deque<Boolean> openStack = new LinkedList<Boolean>();
     private static boolean open = false;
@@ -41,7 +41,7 @@
 
     static {
         PrintStream ps = null;
-        String filename = System.getProperty("c1x.info_file");
+        String filename = System.getProperty("graal.info_file");
         if (filename != null && !"".equals(filename)) {
             try {
                 ps = new PrintStream(new FileOutputStream(filename));
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/server/package-info.java	Wed Jun 08 13:06:45 2011 +0200
+++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/server/package-info.java	Wed Jun 08 14:10:06 2011 +0200
@@ -21,9 +21,6 @@
  * questions.
  */
 /**
- * Implementation of a compilation server socket that delegates incoming requests to C1X.
- *
- * @author Lukas Stadler
- * @author Thomas Wuerthinger
+ * Implementation of a compilation server socket that delegates incoming requests to Graal.
  */
 package com.oracle.max.graal.runtime.server;
--- a/rundacapo.sh	Wed Jun 08 13:06:45 2011 +0200
+++ b/rundacapo.sh	Wed Jun 08 14:10:06 2011 +0200
@@ -15,4 +15,4 @@
   echo "DACAPO is not defined. It must point to a Dacapo benchmark directory."
   exit 1;
 fi
-${JDK7}/bin/java -client -d64 -graal -XX:-C1XBailoutIsFatal -XX:+PrintCompilation -C1X:-QuietBailout -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness --preserve $*
+${JDK7}/bin/java -client -d64 -graal -XX:-GraalBailoutIsFatal -XX:+PrintCompilation -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness --preserve $*
--- a/runtests.sh	Wed Jun 08 13:06:45 2011 +0200
+++ b/runtests.sh	Wed Jun 08 14:10:06 2011 +0200
@@ -12,4 +12,4 @@
   exit 1;
 fi
 TESTDIR=${MAXINE}/com.oracle.max.vm/test
-${JDK7}/bin/java -client -d64 -graal -ea -esa -Xcomp -C1X:PrintIdealGraphLevel=0 -C1X:PrintFilter=anewarray -C1X:-PrintCFGToFile -C1X:-PrintAssembly -XX:-TraceSignals -XX:-TraceDeoptimization -XX:-TraceExceptions -XX:+PrintCompilation -XX:CompileOnly=jtt -Xbootclasspath/p:"${MAXINE}/com.oracle.max.vm/bin" -Xbootclasspath/p:"${MAXINE}/com.oracle.max.base/bin" $1 test.com.sun.max.vm.compiler.JavaTester -verbose=1 -gen-run-scheme=false -run-scheme-package=all ${TESTDIR}/jtt/bytecode ${TESTDIR}/jtt/except ${TESTDIR}/jtt/hotpath ${TESTDIR}/jtt/jdk ${TESTDIR}/jtt/lang ${TESTDIR}/jtt/loop ${TESTDIR}/jtt/micro ${TESTDIR}/jtt/optimize ${TESTDIR}/jtt/reflect ${TESTDIR}/jtt/threads
+${JDK7}/bin/java -client -d64 -graal -ea -esa -Xcomp -XX:+PrintCompilation -XX:CompileOnly=jtt -Xbootclasspath/p:"${MAXINE}/com.oracle.max.vm/bin" -Xbootclasspath/p:"${MAXINE}/com.oracle.max.base/bin" $1 test.com.sun.max.vm.compiler.JavaTester -verbose=1 -gen-run-scheme=false -run-scheme-package=all ${TESTDIR}/jtt/bytecode ${TESTDIR}/jtt/except ${TESTDIR}/jtt/hotpath ${TESTDIR}/jtt/jdk ${TESTDIR}/jtt/lang ${TESTDIR}/jtt/loop ${TESTDIR}/jtt/micro ${TESTDIR}/jtt/optimize ${TESTDIR}/jtt/reflect ${TESTDIR}/jtt/threads
--- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -592,8 +592,8 @@
 
 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) {
   OopMapSet* oop_maps = new OopMapSet();
-  if (UseC1X) {
-    // c1x passes the argument in r10
+  if (UseGraal) {
+    // graal passes the argument in r10
     OopMap* oop_map = save_live_registers(sasm, 1);
 
     // now all registers are saved and can be used freely
@@ -772,7 +772,7 @@
   return oop_maps;
 }
 
-void Runtime1::c1x_generate_handle_exception(StubAssembler *sasm, OopMapSet* oop_maps, OopMap* oop_map) {
+void Runtime1::graal_generate_handle_exception(StubAssembler *sasm, OopMapSet* oop_maps, OopMap* oop_map) {
   NOT_LP64(fatal("64 bit only"));
   // incoming parameters
   const Register exception_oop = j_rarg0;
@@ -780,7 +780,7 @@
   const Register exception_pc = j_rarg1;
   const Register thread = r15_thread;
 
-  __ block_comment("c1x_generate_handle_exception");
+  __ block_comment("graal_generate_handle_exception");
 
   // verify that rax, contains a valid exception
   __ verify_not_null_oop(exception_oop);
@@ -1047,7 +1047,7 @@
   return oop_maps;
 }
 
-JRT_ENTRY(void, c1x_create_null_exception(JavaThread* thread))
+JRT_ENTRY(void, graal_create_null_exception(JavaThread* thread))
   thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL)());
 JRT_END
 
@@ -1346,8 +1346,8 @@
         // will be place in C abi locations
 
 #ifdef _LP64
-        __ verify_oop((UseC1X) ? j_rarg0 : c_rarg0);
-        __ mov(rax, (UseC1X) ? j_rarg0 : c_rarg0);
+        __ verify_oop((UseGraal) ? j_rarg0 : c_rarg0);
+        __ mov(rax, (UseGraal) ? j_rarg0 : c_rarg0);
 #else
         // The object is passed on the stack and we haven't pushed a
         // frame yet so it's one work away from top of stack.
@@ -1480,7 +1480,7 @@
 
         Label success;
         Label miss;
-        if (UseC1X) {
+        if (UseGraal) {
           // TODO this should really be within the XirSnippets
           __ check_klass_subtype_fast_path(rsi, rax, rcx, &success, &miss, NULL);
         };
@@ -1886,7 +1886,7 @@
       break;
 #endif // !SERIALGC
 
-    case c1x_unwind_exception_call_id: {
+    case graal_unwind_exception_call_id: {
       // remove the frame from the stack
       __ movptr(rsp, rbp);
       __ pop(rbp);
@@ -1900,7 +1900,7 @@
         __ enter();
         oop_maps = new OopMapSet();
         OopMap* oop_map = save_live_registers(sasm, 0);
-        int call_offset = __ call_RT(rax, noreg, (address)c1x_create_null_exception, 0);
+        int call_offset = __ call_RT(rax, noreg, (address)graal_create_null_exception, 0);
         oop_maps->add_gc_map(call_offset, oop_map);
         __ leave();
       }
@@ -1914,15 +1914,15 @@
       break;
     }
 
-    case c1x_handle_exception_id: {
-      StubFrame f(sasm, "c1x_handle_exception", dont_gc_arguments);
+    case graal_handle_exception_id: {
+      StubFrame f(sasm, "graal_handle_exception", dont_gc_arguments);
       oop_maps = new OopMapSet();
       OopMap* oop_map = save_live_registers(sasm, 1, false);
-      c1x_generate_handle_exception(sasm, oop_maps, oop_map);
+      graal_generate_handle_exception(sasm, oop_maps, oop_map);
       break;
     }
 
-    case c1x_slow_subtype_check_id: {
+    case graal_slow_subtype_check_id: {
       Label success;
       Label miss;
 
@@ -1941,13 +1941,13 @@
       break;
     }
 
-    case c1x_verify_pointer_id: {
-      __ verify_oop(r13, "c1x verify pointer");
+    case graal_verify_pointer_id: {
+      __ verify_oop(r13, "graal verify pointer");
       __ ret(0);
       break;
     }
 
-    case c1x_arithmetic_frem_id: {
+    case graal_arithmetic_frem_id: {
       __ subptr(rsp, 8);
       __ movflt(Address(rsp, 0), xmm1);
       __ fld_s(Address(rsp, 0));
@@ -1968,7 +1968,7 @@
       __ ret(0);
       break;
     }
-    case c1x_arithmetic_drem_id: {
+    case graal_arithmetic_drem_id: {
       __ subptr(rsp, 8);
       __ movdbl(Address(rsp, 0), xmm1);
       __ fld_d(Address(rsp, 0));
@@ -1989,7 +1989,7 @@
       __ ret(0);
       break;
     }
-    case c1x_monitorenter_id: {
+    case graal_monitorenter_id: {
       Label slow_case;
 
       Register obj = j_rarg0;
@@ -2008,7 +2008,7 @@
 
       __ bind(slow_case);
       {
-        StubFrame f(sasm, "c1x_monitorenter", dont_gc_arguments);
+        StubFrame f(sasm, "graal_monitorenter", dont_gc_arguments);
         OopMap* map = save_live_registers(sasm, 1, save_fpu_registers);
 
         // Called with store_parameter and not C abi
@@ -2021,7 +2021,7 @@
       __ ret(0);
       break;
     }
-    case c1x_monitorexit_id: {
+    case graal_monitorexit_id: {
       Label slow_case;
 
       Register obj = j_rarg0;
@@ -2042,7 +2042,7 @@
 
       __ bind(slow_case);
       {
-        StubFrame f(sasm, "c1x_monitorexit", dont_gc_arguments);
+        StubFrame f(sasm, "graal_monitorexit", dont_gc_arguments);
         OopMap* map = save_live_registers(sasm, 2, save_fpu_registers);
 
         // note: really a leaf routine but must setup last java sp
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -2650,7 +2650,7 @@
   __ bind(no_pending_exception);
 #endif
 
-  // (tw) Start of C1X uncommon trap code.
+  // (tw) Start of graal uncommon trap code.
   __ jmp(cont);
 
   int jmp_uncommon_trap_offset = __ pc() - start;
@@ -2685,7 +2685,7 @@
   __ jmp(after_fetch_unroll_info_call);
 
 
-  // (tw) End of C1X uncommon trap code.
+  // (tw) End of graal uncommon trap code.
 
   __ bind(cont);
 
--- a/src/share/vm/c1/c1_Compiler.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/c1/c1_Compiler.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -90,7 +90,7 @@
 
 
 void Compiler::compile_method(ciEnv* env, ciMethod* method, int entry_bci) {
-  assert(!UseC1X, "c1 called in UseC1X mode!");
+  assert(!UseGraal, "c1 called in UseGraal mode!");
   // Allocate buffer blob once at startup since allocation for each
   // compilation seems to be too expensive (at least on Intel win32).
   BufferBlob* buffer_blob = CompilerThread::current()->get_buffer_blob();
--- a/src/share/vm/c1/c1_Runtime1.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/c1/c1_Runtime1.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -201,11 +201,11 @@
     case slow_subtype_check_id:
     case fpu2long_stub_id:
     case unwind_exception_id:
-    case c1x_verify_pointer_id:
-    case c1x_unwind_exception_call_id:
-    case c1x_slow_subtype_check_id:
-    case c1x_arithmetic_frem_id:
-    case c1x_arithmetic_drem_id:
+    case graal_verify_pointer_id:
+    case graal_unwind_exception_call_id:
+    case graal_slow_subtype_check_id:
+    case graal_arithmetic_frem_id:
+    case graal_arithmetic_drem_id:
 #ifndef TIERED
     case counter_overflow_id: // Not generated outside the tiered world
 #endif
@@ -468,7 +468,7 @@
   thread->set_is_method_handle_return(false);
 
   Handle exception(thread, ex);
-  if (UseC1X && exception.is_null()) {
+  if (UseGraal && exception.is_null()) {
     exception = Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL);
   }
   nm = CodeCache::find_nmethod(pc);
@@ -661,7 +661,7 @@
 JRT_ENTRY_NO_ASYNC(void, Runtime1::monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock))
   NOT_PRODUCT(_monitorenter_slowcase_cnt++;)
 #ifdef ASSERT
-  if (TraceC1X >= 3) {
+  if (Tracegraal >= 3) {
     tty->print_cr("entered locking slow case with obj=" INTPTR_FORMAT " and lock= " INTPTR_FORMAT, obj, lock);
   }
   if (PrintBiasedLockingStatistics) {
@@ -689,7 +689,7 @@
     }
   }
 #ifdef ASSERT
-  if (TraceC1X >= 3) {
+  if (Tracegraal >= 3) {
     tty->print_cr("exiting locking lock state: obj=" INTPTR_FORMAT, lock->obj());
     lock->lock()->print_on(tty);
     tty->print_cr("");
--- a/src/share/vm/c1/c1_Runtime1.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/c1/c1_Runtime1.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -70,14 +70,14 @@
   stub(g1_post_barrier_slow)         \
   stub(fpu2long_stub)                \
   stub(counter_overflow)             \
-  stub(c1x_unwind_exception_call)    \
-  stub(c1x_handle_exception)         \
-  stub(c1x_slow_subtype_check)       \
-  stub(c1x_arithmetic_frem)          \
-  stub(c1x_arithmetic_drem)          \
-  stub(c1x_monitorenter)             \
-  stub(c1x_monitorexit)              \
-  stub(c1x_verify_pointer)           \
+  stub(graal_unwind_exception_call)    \
+  stub(graal_handle_exception)         \
+  stub(graal_slow_subtype_check)       \
+  stub(graal_arithmetic_frem)          \
+  stub(graal_arithmetic_drem)          \
+  stub(graal_monitorenter)             \
+  stub(graal_monitorexit)              \
+  stub(graal_verify_pointer)           \
   last_entry(number_of_ids)
 
 #define DECLARE_STUB_ID(x)       x ## _id ,
@@ -133,7 +133,7 @@
   static OopMapSet* generate_exception_throw(StubAssembler* sasm, address target, bool has_argument);
   static OopMapSet* generate_handle_exception(StubID id, StubAssembler* sasm);
   static void       generate_unwind_exception(StubAssembler *sasm);
-  static void       c1x_generate_handle_exception(StubAssembler *sasm, OopMapSet* oop_maps, OopMap* oop_map);
+  static void       graal_generate_handle_exception(StubAssembler *sasm, OopMapSet* oop_maps, OopMap* oop_map);
   static OopMapSet* generate_patching(StubAssembler* sasm, address target);
 
   static OopMapSet* generate_stub_call(StubAssembler* sasm, Register result, address entry,
--- a/src/share/vm/c1/c1_globals.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/c1/c1_globals.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -53,14 +53,14 @@
 //
 #define C1_FLAGS(develop, develop_pd, product, product_pd, notproduct)      \
                                                                             \
-  product(bool, UseC1X, false,                                              \
-          "Use C1X instead of C1")                                          \
-  product(bool, C1XBailoutIsFatal, true,                                    \
-          "Abort the VM on C1X bailout")                                    \
-  product(bool, BootstrapC1X, false,                                        \
-          "Bootstrap C1X before running Java main method")                  \
-  product(intx, TraceC1X, 0,                                                \
-          "Trace level for C1X")                                            \
+  product(bool, UseGraal, false,                                              \
+          "Use graal instead of C1")                                          \
+  product(bool, GraalBailoutIsFatal, true,                                    \
+          "Abort the VM on graal bailout")                                    \
+  product(bool, Bootstrapgraal, false,                                        \
+          "Bootstrap graal before running Java main method")                  \
+  product(intx, Tracegraal, 0,                                                \
+          "Trace level for graal")                                            \
   product(bool, TraceSignals, false,                                        \
           "Trace signals and implicit exception handling")                  \
   /* Printing */                                                            \
--- a/src/share/vm/c1x/c1x_CodeInstaller.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,740 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "c1x/c1x_Compiler.hpp"
-#include "c1x/c1x_CodeInstaller.hpp"
-#include "c1x/c1x_JavaAccess.hpp"
-#include "c1x/c1x_VmIds.hpp"
-#include "c1/c1_Runtime1.hpp"
-#include "classfile/vmSymbols.hpp"
-#include "vmreg_x86.inline.hpp"
-
-
-// TODO this should be handled in a more robust way - not hard coded...
-Register CPU_REGS[] = { rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15 };
-bool OOP_ALLOWED[] = {true, true, true, true, false, false, true, true, true, true, false, true, true, true, true, true};
-const static int NUM_CPU_REGS = sizeof(CPU_REGS) / sizeof(Register);
-XMMRegister XMM_REGS[] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 };
-const static int NUM_XMM_REGS = sizeof(XMM_REGS) / sizeof(XMMRegister);
-const static int NUM_REGS = NUM_CPU_REGS + NUM_XMM_REGS;
-const static jlong NO_REF_MAP = 0x8000000000000000L;
-
-// convert c1x register indices (as used in oop maps) to hotspot registers
-VMReg get_hotspot_reg(jint c1x_reg) {
-
-  assert(c1x_reg >= 0 && c1x_reg < NUM_REGS, "invalid register number");
-  if (c1x_reg < NUM_CPU_REGS) {
-    return CPU_REGS[c1x_reg]->as_VMReg();
-  } else {
-    return XMM_REGS[c1x_reg - NUM_CPU_REGS]->as_VMReg();
-  }
-}
-
-static bool is_bit_set(oop bit_map, int i) {
-  const int MapWordBits = 64;
-  if (i < MapWordBits) {
-    jlong low = CiBitMap::low(bit_map);
-    return (low & (1LL << i)) != 0;
-  } else {
-    jint extra_idx = (i - MapWordBits) / MapWordBits;
-    arrayOop extra = (arrayOop) CiBitMap::extra(bit_map);
-    assert(extra_idx >= 0 && extra_idx < extra->length(), "unexpected index");
-    jlong word = ((jlong*) extra->base(T_LONG))[extra_idx];
-    return (word & (1LL << (i % MapWordBits))) != 0;
-  }
-}
-
-// creates a hotspot oop map out of the byte arrays provided by CiDebugInfo
-static OopMap* create_oop_map(jint frame_size, jint parameter_count, oop debug_info) {
-  OopMap* map = new OopMap(frame_size, parameter_count);
-  oop register_map = (oop) CiDebugInfo::registerRefMap(debug_info);
-  oop frame_map = (oop) CiDebugInfo::frameRefMap(debug_info);
-
-  if (register_map != NULL) {
-    assert(CiBitMap::size(register_map) == (unsigned) NUM_CPU_REGS, "unexpected register_map length");
-    for (jint i = 0; i < NUM_CPU_REGS; i++) {
-      bool is_oop = is_bit_set(register_map, i);
-      VMReg reg = get_hotspot_reg(i);
-      if (is_oop) {
-        assert(OOP_ALLOWED[i], "this register may never be an oop, register map misaligned?");
-        map->set_oop(reg);
-      } else {
-        map->set_value(reg);
-      }
-    }
-  }
-
-  if (frame_size > 0) {
-    assert(CiBitMap::size(frame_map) == frame_size / HeapWordSize, "unexpected frame_map length");
-
-    for (jint i = 0; i < frame_size / HeapWordSize; i++) {
-      bool is_oop = is_bit_set(frame_map, i);
-      // hotspot stack slots are 4 bytes
-      VMReg reg = VMRegImpl::stack2reg(i * 2);
-      if (is_oop) {
-        map->set_oop(reg);
-      } else {
-        map->set_value(reg);
-      }
-    }
-  } else {
-    assert(frame_map == NULL || CiBitMap::size(frame_map) == 0, "cannot have frame_map for frames with size 0");
-  }
-
-  return map;
-}
-
-// TODO: finish this - c1x doesn't provide any scope values at the moment
-static ScopeValue* get_hotspot_value(oop value, int frame_size) {
-  if (value == CiValue::IllegalValue()) {
-    return new LocationValue(Location::new_stk_loc(Location::invalid, 0));
-  }
-
-  BasicType type = C1XCompiler::kindToBasicType(CiKind::typeChar(CiValue::kind(value)));
-  Location::Type locationType = Location::normal;
-  if (type == T_OBJECT || type == T_ARRAY) locationType = Location::oop;
-  if (value->is_a(CiRegisterValue::klass())) {
-    jint number = CiRegister::number(CiRegisterValue::reg(value));
-    if (number < 16) {
-      return new LocationValue(Location::new_reg_loc(locationType, as_Register(number)->as_VMReg()));
-    } else {
-      return new LocationValue(Location::new_reg_loc(locationType, as_XMMRegister(number - 16)->as_VMReg()));
-    }
-  } else if (value->is_a(CiStackSlot::klass())) {
-    jint index = CiStackSlot::index(value);
-    if (index >= 0) {
-      return new LocationValue(Location::new_stk_loc(locationType, index * HeapWordSize));
-    } else {
-      int frame_size_bytes = frame_size + 2 * HeapWordSize;
-      return new LocationValue(Location::new_stk_loc(locationType, -(index * HeapWordSize) + frame_size_bytes));
-    }
-  } else if (value->is_a(CiConstant::klass())){
-    oop obj = CiConstant::object(value);
-    jlong prim = CiConstant::primitive(value);
-    if (type == T_INT || type == T_FLOAT || type == T_SHORT || type == T_CHAR || type == T_BOOLEAN || type == T_BYTE) {
-      return new ConstantIntValue(*(jint*)&prim);
-    } else if (type == T_LONG || type == T_DOUBLE) {
-      return new ConstantLongValue(prim);
-    } else if (type == T_OBJECT) {
-      oop obj = CiConstant::object(value);
-      if (obj == NULL) {
-        return new ConstantOopWriteValue(NULL);
-      } else {
-        return new ConstantOopWriteValue(JNIHandles::make_global(obj));
-      }
-    } else if (type == T_ADDRESS) {
-      return new ConstantLongValue(prim);
-    }
-    tty->print("%i", type);
-  } else {
-    value->klass()->print();
-    value->print();
-  }
-  ShouldNotReachHere();
-  return NULL;
-}
-
-// constructor used to create a method
-CodeInstaller::CodeInstaller(Handle target_method) {
-  ciMethod *ciMethodObject = NULL;
-  {
-    No_Safepoint_Verifier no_safepoint;
-    _env = CURRENT_ENV;
-
-    initialize_fields(target_method);
-    assert(_hotspot_method != NULL && _name == NULL, "installMethod needs NON-NULL method and NULL name");
-    assert(_hotspot_method->is_a(HotSpotMethodResolved::klass()), "installMethod needs a HotSpotMethodResolved");
-
-    methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(_hotspot_method));
-    ciMethodObject = (ciMethod *) _env->get_object(method);
-    _parameter_count = method->size_of_parameters();
-  }
-
-  // (very) conservative estimate: each site needs a relocation
-  //CodeBuffer buffer("temp c1x method", _total_size, _sites->length() * relocInfo::length_limit);
-  CodeBuffer buffer(CompilerThread::current()->get_buffer_blob());
-  initialize_buffer(buffer);
-  process_exception_handlers();
-
-  int stack_slots = (_frame_size / HeapWordSize) + 2; // conversion to words, need to add two slots for ret address and frame pointer
-  ThreadToNativeFromVM t((JavaThread*) Thread::current());
-  _env->register_method(ciMethodObject, -1, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
-      &_implicit_exception_table, C1XCompiler::instance(), _env->comp_level(), false, false);
-
-}
-
-// constructor used to create a stub
-CodeInstaller::CodeInstaller(Handle target_method, jlong& id) {
-  No_Safepoint_Verifier no_safepoint;
-  _env = CURRENT_ENV;
-
-  initialize_fields(target_method);
-  assert(_hotspot_method == NULL && _name != NULL, "installMethod needs NON-NULL name and NULL method");
-
-  // (very) conservative estimate: each site needs a relocation
-  CodeBuffer buffer(CompilerThread::current()->get_buffer_blob());
-  initialize_buffer(buffer);
-
-  const char* cname = java_lang_String::as_utf8_string(_name);
-  BufferBlob* blob = BufferBlob::create(strdup(cname), &buffer); // this is leaking strings... but only a limited number of stubs will be created
-  IF_TRACE_C1X_3 Disassembler::decode((CodeBlob*) blob);
-  id = VmIds::addStub(blob->code_begin());
-}
-
-void CodeInstaller::initialize_fields(Handle target_method) {
-  _citarget_method = HotSpotTargetMethod::targetMethod(target_method);
-  _hotspot_method = HotSpotTargetMethod::method(target_method);
-  _name = HotSpotTargetMethod::name(target_method);
-  _sites = (arrayOop) HotSpotTargetMethod::sites(target_method);
-  oop assumptions = CiTargetMethod::assumptions(_citarget_method);
-  if (assumptions != NULL) {
-    _assumptions = (arrayOop) CiAssumptions::list(assumptions);
-  } else {
-    _assumptions = NULL;
-  }
-  _exception_handlers = (arrayOop) HotSpotTargetMethod::exceptionHandlers(target_method);
-
-  _code = (arrayOop) CiTargetMethod::targetCode(_citarget_method);
-  _code_size = CiTargetMethod::targetCodeSize(_citarget_method);
-  _frame_size = CiTargetMethod::frameSize(_citarget_method);
-  _custom_stack_area_offset = CiTargetMethod::customStackAreaOffset(_citarget_method);
-
-
-  // (very) conservative estimate: each site needs a constant section entry
-  _constants_size = _sites->length() * (BytesPerLong*2);
-  _total_size = align_size_up(_code_size, HeapWordSize) + _constants_size;
-
-  _next_call_type = MARK_INVOKE_INVALID;
-}
-
-// perform data and call relocation on the CodeBuffer
-void CodeInstaller::initialize_buffer(CodeBuffer& buffer) {
-  int locs_buffer_size = _sites->length() * (relocInfo::length_limit + sizeof(relocInfo));
-  char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size);
-  buffer.insts()->initialize_shared_locs((relocInfo*)locs_buffer, locs_buffer_size / sizeof(relocInfo));
-  buffer.initialize_stubs_size(256);
-  buffer.initialize_consts_size(_constants_size);
-
-  _oop_recorder = new OopRecorder(_env->arena());
-  _env->set_oop_recorder(_oop_recorder);
-  _debug_recorder = new DebugInformationRecorder(_env->oop_recorder());
-  _debug_recorder->set_oopmaps(new OopMapSet());
-  _dependencies = new Dependencies(_env);
-
-  _env->set_oop_recorder(_oop_recorder);
-  _env->set_debug_info(_debug_recorder);
-  _env->set_dependencies(_dependencies);
-  buffer.initialize_oop_recorder(_oop_recorder);
-
-  _instructions = buffer.insts();
-  _constants = buffer.consts();
-
-  // copy the code into the newly created CodeBuffer
-  memcpy(_instructions->start(), _code->base(T_BYTE), _code_size);
-  _instructions->set_end(_instructions->start() + _code_size);
-
-  oop* sites = (oop*) _sites->base(T_OBJECT);
-  for (int i = 0; i < _sites->length(); i++) {
-    oop site = sites[i];
-    jint pc_offset = CiTargetMethod_Site::pcOffset(site);
-
-    if (site->is_a(CiTargetMethod_Safepoint::klass())) {
-      TRACE_C1X_4("safepoint at %i", pc_offset);
-      site_Safepoint(buffer, pc_offset, site);
-    } else if (site->is_a(CiTargetMethod_Call::klass())) {
-      TRACE_C1X_4("call at %i", pc_offset);
-      site_Call(buffer, pc_offset, site);
-    } else if (site->is_a(CiTargetMethod_DataPatch::klass())) {
-      TRACE_C1X_4("datapatch at %i", pc_offset);
-      site_DataPatch(buffer, pc_offset, site);
-    } else if (site->is_a(CiTargetMethod_Mark::klass())) {
-      TRACE_C1X_4("mark at %i", pc_offset);
-      site_Mark(buffer, pc_offset, site);
-    } else {
-      fatal("unexpected Site subclass");
-    }
-  }
-
-
-  if (_assumptions != NULL) {
-    oop* assumptions = (oop*) _assumptions->base(T_OBJECT);
-    for (int i = 0; i < _assumptions->length(); ++i) {
-      oop assumption = assumptions[i];
-      if (assumption != NULL) {
-        if (assumption->is_a(CiAssumptions_ConcreteSubtype::klass())) {
-          assumption_ConcreteSubtype(assumption);
-        } else if (assumption->is_a(CiAssumptions_ConcreteMethod::klass())) {
-          assumption_ConcreteMethod(assumption);
-        } else {
-          fatal("unexpected Assumption subclass");
-        }
-      }
-    }
-  }
-}
-
-void CodeInstaller::assumption_ConcreteSubtype(oop assumption) {
-  oop context_oop = CiAssumptions_ConcreteSubtype::context(assumption);
-  oop type_oop = CiAssumptions_ConcreteSubtype::subtype(assumption);
-
-  ciKlass* context = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(context_oop)));
-  ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type_oop)));
-
-  _dependencies->assert_leaf_type(type);
-  if (context != type) {
-    assert(context->is_abstract(), "");
-    ThreadToNativeFromVM trans(JavaThread::current());
-    _dependencies->assert_abstract_with_unique_concrete_subtype(context, type);
-  }
-}
-
-void CodeInstaller::assumption_ConcreteMethod(oop assumption) {
-  oop context_oop = CiAssumptions_ConcreteMethod::context(assumption);
-  oop method_oop = CiAssumptions_ConcreteMethod::method(assumption);
-  jlong context_oop_id = HotSpotMethodResolved::vmId(context_oop);
-  jlong method_oop_id = HotSpotMethodResolved::vmId(method_oop);
-  methodOop method = VmIds::get<methodOop>(method_oop_id);
-  methodOop context = VmIds::get<methodOop>(context_oop_id);
-
-  ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method);
-  ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context);
-  ciKlass* context_klass = c->holder();
-  {
-    ThreadToNativeFromVM trans(JavaThread::current());
-    _dependencies->assert_unique_concrete_method(context_klass, m);
-  }
-}
-
-void CodeInstaller::process_exception_handlers() {
-  // allocate some arrays for use by the collection code.
-  const int num_handlers = 5;
-  GrowableArray<intptr_t>* bcis = new GrowableArray<intptr_t> (num_handlers);
-  GrowableArray<intptr_t>* scope_depths = new GrowableArray<intptr_t> (num_handlers);
-  GrowableArray<intptr_t>* pcos = new GrowableArray<intptr_t> (num_handlers);
-
-  if (_exception_handlers != NULL) {
-    oop* exception_handlers = (oop*) _exception_handlers->base(T_OBJECT);
-    for (int i = 0; i < _exception_handlers->length(); i++) {
-      jint pc_offset = CiTargetMethod_Site::pcOffset(exception_handlers[i]);
-      int start = i;
-      while ((i + 1) < _exception_handlers->length() && CiTargetMethod_Site::pcOffset(exception_handlers[i + 1]) == pc_offset)
-        i++;
-
-      // empty the arrays
-      bcis->trunc_to(0);
-      scope_depths->trunc_to(0);
-      pcos->trunc_to(0);
-
-      for (int j = start; j <= i; j++) {
-        oop exc = exception_handlers[j];
-        jint handler_offset = CiTargetMethod_ExceptionHandler::handlerPos(exc);
-        jint handler_bci = CiTargetMethod_ExceptionHandler::handlerBci(exc);
-        jint bci = CiTargetMethod_ExceptionHandler::bci(exc);
-        jint scope_level = CiTargetMethod_ExceptionHandler::scopeLevel(exc);
-        Handle handler_type = CiTargetMethod_ExceptionHandler::exceptionType(exc);
-
-        assert(handler_offset != -1, "must have been generated");
-
-        int e = bcis->find(handler_bci);
-        if (e >= 0 && scope_depths->at(e) == scope_level) {
-          // two different handlers are declared to dispatch to the same
-          // catch bci.  During parsing we created edges for each
-          // handler but we really only need one.  The exception handler
-          // table will also get unhappy if we try to declare both since
-          // it's nonsensical.  Just skip this handler.
-          continue;
-        }
-
-        bcis->append(handler_bci);
-        if (handler_bci == -1) {
-          // insert a wildcard handler at scope depth 0 so that the
-          // exception lookup logic with find it.
-          scope_depths->append(0);
-        } else {
-          scope_depths->append(scope_level);
-        }
-        pcos->append(handler_offset);
-
-        // stop processing once we hit a catch any
-        //        if (handler->is_catch_all()) {
-        //          assert(i == handlers->length() - 1, "catch all must be last handler");
-        //        }
-
-      }
-      _exception_handler_table.add_subtable(pc_offset, bcis, scope_depths, pcos);
-    }
-  }
-
-}
-
-void CodeInstaller::record_scope(jint pc_offset, oop code_pos) {
-  oop caller_pos = CiCodePos::caller(code_pos);
-  if (caller_pos != NULL) {
-    record_scope(pc_offset, caller_pos);
-  }
-  oop frame = NULL;
-  if (code_pos->klass()->klass_part()->name() == vmSymbols::com_sun_cri_ci_CiFrame()) {
-    frame = code_pos;
-  }
-
-  oop hotspot_method = CiCodePos::method(code_pos);
-  assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotMethodResolved::klass()), "unexpected hotspot method");
-  methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method));
-  ciMethod *cimethod = (ciMethod *) _env->get_object(method);
-  jint bci = CiCodePos::bci(code_pos);
-  bool reexecute;
-  if (bci == -1) {
-     reexecute = false;
-  } else {
-    Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci));
-    reexecute = Interpreter::bytecode_should_reexecute(code);
-  }
-
-  if (TraceC1X >= 2) {
-    tty->print_cr("Recording scope pc_offset=%d bci=%d frame=%d", pc_offset, bci, frame);
-  }
-
-  if (frame != NULL) {
-    jint local_count = CiFrame::numLocals(frame);
-    jint expression_count = CiFrame::numStack(frame);
-    jint monitor_count = CiFrame::numLocks(frame);
-    arrayOop values = (arrayOop) CiFrame::values(frame);
-
-    assert(local_count + expression_count + monitor_count == values->length(), "unexpected values length");
-
-    GrowableArray<ScopeValue*>* locals = new GrowableArray<ScopeValue*> ();
-    GrowableArray<ScopeValue*>* expressions = new GrowableArray<ScopeValue*> ();
-    GrowableArray<MonitorValue*>* monitors = new GrowableArray<MonitorValue*> ();
-
-    if (TraceC1X >= 2) {
-      tty->print_cr("Scope at bci %d with %d values", bci, values->length());
-      tty->print_cr("%d locals %d expressions, %d monitors", local_count, expression_count, monitor_count);
-    }
-
-    for (jint i = 0; i < values->length(); i++) {
-      ScopeValue* value = get_hotspot_value(((oop*) values->base(T_OBJECT))[i], _frame_size);
-
-      if (i < local_count) {
-        locals->append(value);
-      } else if (i < local_count + expression_count) {
-        expressions->append(value);
-      } else {
-        assert(value->is_location(), "invalid monitor location");
-        LocationValue* loc = (LocationValue*)value;
-        int monitor_offset = loc->location().stack_offset();
-        LocationValue* obj = new LocationValue(Location::new_stk_loc(Location::oop, monitor_offset + BasicObjectLock::obj_offset_in_bytes()));
-        monitors->append(new MonitorValue(obj, Location::new_stk_loc(Location::normal, monitor_offset  + BasicObjectLock::lock_offset_in_bytes())));
-      }
-    }
-    DebugToken* locals_token = _debug_recorder->create_scope_values(locals);
-    DebugToken* expressions_token = _debug_recorder->create_scope_values(expressions);
-    DebugToken* monitors_token = _debug_recorder->create_monitor_values(monitors);
-
-    _debug_recorder->describe_scope(pc_offset, cimethod, bci, reexecute, false, false, locals_token, expressions_token, monitors_token);
-  } else {
-    _debug_recorder->describe_scope(pc_offset, cimethod, bci, reexecute, false, false, NULL, NULL, NULL);
-  }
-}
-
-void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site) {
-  oop debug_info = CiTargetMethod_Safepoint::debugInfo(site);
-  assert(debug_info != NULL, "debug info expected");
-
-  // address instruction = _instructions->start() + pc_offset;
-  // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
-  _debug_recorder->add_safepoint(pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info));
-
-  oop code_pos = CiDebugInfo::codePos(debug_info);
-  record_scope(pc_offset, code_pos);
-
-  _debug_recorder->end_safepoint(pc_offset);
-}
-
-void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) {
-  oop runtime_call = CiTargetMethod_Call::runtimeCall(site);
-  oop hotspot_method = CiTargetMethod_Call::method(site);
-  oop symbol = CiTargetMethod_Call::symbol(site);
-  oop global_stub = CiTargetMethod_Call::globalStubID(site);
-
-  oop debug_info = CiTargetMethod_Call::debugInfo(site);
-
-  assert((runtime_call ? 1 : 0) + (hotspot_method ? 1 : 0) + (symbol ? 1 : 0) + (global_stub ? 1 : 0) == 1, "Call site needs exactly one type");
-
-  assert(NativeCall::instruction_size == (int)NativeJump::instruction_size, "unexpected size)");
-  jint next_pc_offset = pc_offset + NativeCall::instruction_size;
-
-  if (debug_info != NULL) {
-    _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info));
-    oop code_pos = CiDebugInfo::codePos(debug_info);
-    record_scope(next_pc_offset, code_pos);
-  }
-
-  if (runtime_call != NULL) {
-    NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
-    if (runtime_call == CiRuntimeCall::Debug()) {
-      TRACE_C1X_3("CiRuntimeCall::Debug()");
-    } else if (runtime_call == CiRuntimeCall::UnwindException()) {
-      call->set_destination(Runtime1::entry_for(Runtime1::c1x_unwind_exception_call_id));
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-      TRACE_C1X_3("CiRuntimeCall::UnwindException()");
-    } else if (runtime_call == CiRuntimeCall::HandleException()) {
-      call->set_destination(Runtime1::entry_for(Runtime1::c1x_handle_exception_id));
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-      TRACE_C1X_3("CiRuntimeCall::HandleException()");
-    } else if (runtime_call == CiRuntimeCall::JavaTimeMillis()) {
-      call->set_destination((address)os::javaTimeMillis);
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-      TRACE_C1X_3("CiRuntimeCall::JavaTimeMillis()");
-    } else if (runtime_call == CiRuntimeCall::JavaTimeNanos()) {
-      call->set_destination((address)os::javaTimeNanos);
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-      TRACE_C1X_3("CiRuntimeCall::JavaTimeNanos()");
-    } else if (runtime_call == CiRuntimeCall::ArithmeticFrem()) {
-      call->set_destination(Runtime1::entry_for(Runtime1::c1x_arithmetic_frem_id));
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-      TRACE_C1X_3("CiRuntimeCall::ArithmeticFrem()");
-    } else if (runtime_call == CiRuntimeCall::ArithmeticDrem()) {
-      call->set_destination(Runtime1::entry_for(Runtime1::c1x_arithmetic_drem_id));
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-      TRACE_C1X_3("CiRuntimeCall::ArithmeticDrem()");
-    } else if (runtime_call == CiRuntimeCall::RegisterFinalizer()) {
-      call->set_destination(Runtime1::entry_for(Runtime1::register_finalizer_id));
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-    } else if (runtime_call == CiRuntimeCall::Deoptimize()) {
-      call->set_destination(SharedRuntime::deopt_blob()->uncommon_trap());
-      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
-    } else {
-      runtime_call->print();
-      fatal("runtime_call not implemented");
-    }
-  } else if (global_stub != NULL) {
-    NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset);
-    assert(java_lang_boxing_object::is_instance(global_stub, T_LONG), "global_stub needs to be of type Long");
-
-    if (inst->is_call()) {
-      nativeCall_at((address)inst)->set_destination(VmIds::getStub(global_stub));
-    } else {
-      nativeJump_at((address)inst)->set_jump_destination(VmIds::getStub(global_stub));
-    }
-    _instructions->relocate((address)inst, runtime_call_Relocation::spec(), Assembler::call32_operand);
-    TRACE_C1X_3("relocating (stub)  at %016x", inst);
-  } else if (symbol != NULL) {
-    fatal("symbol");
-  } else { // method != NULL
-    NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
-    assert(hotspot_method != NULL, "unexpected RiMethod");
-    assert(debug_info != NULL, "debug info expected");
-
-    methodOop method = NULL;
-    if (hotspot_method->is_a(HotSpotMethodResolved::klass())) method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method));
-
-    assert(debug_info != NULL, "debug info expected");
-
-    TRACE_C1X_3("method call");
-    switch (_next_call_type) {
-      case MARK_INVOKEVIRTUAL:
-      case MARK_INVOKEINTERFACE: {
-        assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface");
-
-        call->set_destination(SharedRuntime::get_resolve_virtual_call_stub());
-        _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc), Assembler::call32_operand);
-        break;
-      }
-      case MARK_INVOKESTATIC: {
-        assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic");
-        call->set_destination(SharedRuntime::get_resolve_static_call_stub());
-        _instructions->relocate(call->instruction_address(), relocInfo::static_call_type, Assembler::call32_operand);
-        break;
-      }
-      case MARK_INVOKESPECIAL: {
-        assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial");
-
-        call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub());
-        _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type, Assembler::call32_operand);
-        break;
-      }
-      case MARK_INVOKE_INVALID:
-      default:
-        fatal("invalid _next_call_type value");
-        break;
-    }
-  }
-  _next_call_type = MARK_INVOKE_INVALID;
-  if (debug_info != NULL) {
-    _debug_recorder->end_safepoint(next_pc_offset);
-  }
-}
-
-void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) {
-  oop constant = CiTargetMethod_DataPatch::constant(site);
-  oop kind = CiConstant::kind(constant);
-
-  address instruction = _instructions->start() + pc_offset;
-
-  char typeChar = CiKind::typeChar(kind);
-  switch (typeChar) {
-    case 'z':
-    case 'b':
-    case 's':
-    case 'c':
-    case 'i':
-      fatal("int-sized values not expected in DataPatch")
-      ;
-      break;
-    case 'f':
-    case 'l':
-    case 'd': {
-      address operand = Assembler::locate_operand(instruction, Assembler::disp32_operand);
-      address next_instruction = Assembler::locate_next_instruction(instruction);
-      // we don't care if this is a long/double/etc., the primitive field contains the right bits
-      int size = _constants->size();
-      if (typeChar == 'd' || typeChar == 'l') {
-        size = _constants->align_at_start(size);
-      }
-      address dest = _constants->start() + size;
-      _constants->set_end(dest + BytesPerLong);
-      *(jlong*) dest = CiConstant::primitive(constant);
-
-      long disp = dest - next_instruction;
-      assert(disp == (jint) disp, "disp doesn't fit in 32 bits");
-      *((jint*) operand) = (jint) disp;
-
-      _instructions->relocate(instruction, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS), Assembler::disp32_operand);
-      TRACE_C1X_3("relocating (%c) at %016x/%016x with destination at %016x (%d)", typeChar, instruction, operand, dest, size);
-      break;
-    }
-    case 'a': {
-      address operand = Assembler::locate_operand(instruction, Assembler::imm_operand);
-      Handle obj = CiConstant::object(constant);
-
-      if (obj->is_a(HotSpotTypeResolved::klass())) {
-        assert(!obj.is_null(), "");
-        *((jobject*) operand) = JNIHandles::make_local(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(obj)));
-        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
-        TRACE_C1X_3("relocating (HotSpotType) at %016x/%016x", instruction, operand);
-      } else {
-        jobject value;
-        if (obj() == HotSpotProxy::DUMMY_CONSTANT_OBJ()) {
-          value = (jobject) Universe::non_oop_word();
-        } else {
-          value = JNIHandles::make_local(obj());
-        }
-        *((jobject*) operand) = value;
-        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
-        TRACE_C1X_3("relocating (oop constant) at %016x/%016x", instruction, operand);
-      }
-      break;
-    }
-    default:
-      fatal("unexpected CiKind in DataPatch");
-      break;
-  }
-}
-
-void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, oop site) {
-  oop id_obj = CiTargetMethod_Mark::id(site);
-  arrayOop references = (arrayOop) CiTargetMethod_Mark::references(site);
-
-  if (id_obj != NULL) {
-    assert(java_lang_boxing_object::is_instance(id_obj, T_INT), "Integer id expected");
-    jint id = id_obj->int_field(java_lang_boxing_object::value_offset_in_bytes(T_INT));
-
-    address instruction = _instructions->start() + pc_offset;
-
-    switch (id) {
-      case MARK_UNVERIFIED_ENTRY:
-        _offsets.set_value(CodeOffsets::Entry, pc_offset);
-        break;
-      case MARK_VERIFIED_ENTRY:
-        _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset);
-        break;
-      case MARK_OSR_ENTRY:
-        _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset);
-        break;
-      case MARK_UNWIND_ENTRY:
-        _offsets.set_value(CodeOffsets::UnwindHandler, pc_offset);
-        break;
-      case MARK_EXCEPTION_HANDLER_ENTRY:
-        _offsets.set_value(CodeOffsets::Exceptions, pc_offset);
-        break;
-      case MARK_DEOPT_HANDLER_ENTRY:
-        _offsets.set_value(CodeOffsets::Deopt, pc_offset);
-        break;
-      case MARK_STATIC_CALL_STUB: {
-        assert(references->length() == 1, "static call stub needs one reference");
-        oop ref = ((oop*) references->base(T_OBJECT))[0];
-        address call_pc = _instructions->start() + CiTargetMethod_Site::pcOffset(ref);
-        _instructions->relocate(instruction, static_stub_Relocation::spec(call_pc));
-        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
-        break;
-      }
-      case MARK_INVOKE_INVALID:
-      case MARK_INVOKEINTERFACE:
-      case MARK_INVOKESTATIC:
-      case MARK_INVOKESPECIAL:
-      case MARK_INVOKEVIRTUAL:
-        _next_call_type = (MarkId) id;
-        _invoke_mark_pc = instruction;
-        break;
-      case MARK_IMPLICIT_NULL:
-        _implicit_exception_table.append(pc_offset, pc_offset);
-        break;
-      case MARK_KLASS_PATCHING:
-      case MARK_ACCESS_FIELD_PATCHING: {
-        unsigned char* byte_count = (unsigned char*) (instruction - 1);
-        unsigned char* byte_skip = (unsigned char*) (instruction - 2);
-        unsigned char* being_initialized_entry_offset = (unsigned char*) (instruction - 3);
-
-        assert(*byte_skip == 5, "unexpected byte_skip");
-
-        assert(references->length() == 2, "MARK_KLASS_PATCHING/MARK_ACCESS_FIELD_PATCHING needs 2 references");
-        oop ref1 = ((oop*) references->base(T_OBJECT))[0];
-        oop ref2 = ((oop*) references->base(T_OBJECT))[1];
-        int i_byte_count = CiTargetMethod_Site::pcOffset(ref2) - CiTargetMethod_Site::pcOffset(ref1);
-        assert(i_byte_count == (unsigned char)i_byte_count, "invalid offset");
-        *byte_count = i_byte_count;
-        *being_initialized_entry_offset = *byte_count + *byte_skip;
-
-        // we need to correct the offset of a field access - it's created with MAX_INT to ensure the correct size, and hotspot expects 0
-        if (id == MARK_ACCESS_FIELD_PATCHING) {
-          NativeMovRegMem* inst = nativeMovRegMem_at(_instructions->start() + CiTargetMethod_Site::pcOffset(ref1));
-          assert(inst->offset() == max_jint, "unexpected offset value");
-          inst->set_offset(0);
-        }
-        break;
-      }
-      case MARK_DUMMY_OOP_RELOCATION: {
-        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
-
-        RelocIterator iter(_instructions, (address) instruction, (address) (instruction + 1));
-        relocInfo::change_reloc_info_for_address(&iter, (address) instruction, relocInfo::oop_type, relocInfo::none);
-        break;
-      }
-      default:
-        ShouldNotReachHere();
-        break;
-    }
-  }
-}
-
--- a/src/share/vm/c1x/c1x_CodeInstaller.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * This class handles the conversion from a CiTargetMethod to a CodeBlob or an nmethod.
- */
-class CodeInstaller {
-private:
-  // these need to correspond to HotSpotXirGenerator.java
-  enum MarkId {
-    MARK_VERIFIED_ENTRY             = 0x0001,
-    MARK_UNVERIFIED_ENTRY           = 0x0002,
-    MARK_OSR_ENTRY                  = 0x0003,
-    MARK_UNWIND_ENTRY               = 0x0004,
-    MARK_EXCEPTION_HANDLER_ENTRY    = 0x0005,
-    MARK_DEOPT_HANDLER_ENTRY        = 0x0006,
-    MARK_STATIC_CALL_STUB           = 0x1000,
-    MARK_INVOKE_INVALID             = 0x2000,
-    MARK_INVOKEINTERFACE            = 0x2001,
-    MARK_INVOKESTATIC               = 0x2002,
-    MARK_INVOKESPECIAL              = 0x2003,
-    MARK_INVOKEVIRTUAL              = 0x2004,
-    MARK_IMPLICIT_NULL              = 0x3000,
-    MARK_KLASS_PATCHING             = 0x4000,
-    MARK_DUMMY_OOP_RELOCATION       = 0x4001,
-    MARK_ACCESS_FIELD_PATCHING      = 0x4002
-  };
-
-  ciEnv*        _env;
-
-  oop           _citarget_method;
-  oop           _hotspot_method;
-  oop           _name;
-  arrayOop      _sites;
-  arrayOop      _assumptions;
-  arrayOop      _exception_handlers;
-  CodeOffsets   _offsets;
-
-  arrayOop      _code;
-  jint          _code_size;
-  jint          _frame_size;
-  jint          _custom_stack_area_offset;
-  jint          _parameter_count;
-  jint          _constants_size;
-  jint          _total_size;
-
-  MarkId        _next_call_type;
-  address       _invoke_mark_pc;
-
-  CodeSection*  _instructions;
-  CodeSection*  _constants;
-
-  OopRecorder*              _oop_recorder;
-  DebugInformationRecorder* _debug_recorder;
-  Dependencies*             _dependencies;
-  ExceptionHandlerTable     _exception_handler_table;
-  ImplicitExceptionTable    _implicit_exception_table;
-
-public:
-
-  // constructor used to create a method
-  CodeInstaller(Handle target_method);
-
-  // constructor used to create a stub
-  CodeInstaller(Handle target_method, jlong& id);
-
-private:
-  // extract the fields of the CiTargetMethod
-  void initialize_fields(Handle target_method);
-
-  // perform data and call relocation on the CodeBuffer
-  void initialize_buffer(CodeBuffer& buffer);
-
-  void assumption_ConcreteSubtype(oop assumption);
-  void assumption_ConcreteMethod(oop assumption);
-
-  void site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site);
-  void site_Call(CodeBuffer& buffer, jint pc_offset, oop site);
-  void site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site);
-  void site_Mark(CodeBuffer& buffer, jint pc_offset, oop site);
-
-  void record_scope(jint pc_offset, oop code_pos);
-
-  void process_exception_handlers();
-
-};
--- a/src/share/vm/c1x/c1x_Compiler.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "c1x/c1x_Compiler.hpp"
-#include "c1x/c1x_JavaAccess.hpp"
-#include "c1x/c1x_VMExits.hpp"
-#include "c1x/c1x_VMEntries.hpp"
-#include "c1x/c1x_VmIds.hpp"
-#include "c1/c1_Runtime1.hpp"
-#include "runtime/arguments.hpp"
-
-C1XCompiler* C1XCompiler::_instance = NULL;
-
-C1XCompiler::C1XCompiler() {
-  _initialized = false;
-  assert(_instance == NULL, "only one instance allowed");
-  _instance = this;
-}
-
-// Initialization
-void C1XCompiler::initialize() {
-  if (_initialized) return;
-  CompilerThread* THREAD = CompilerThread::current();
-  _initialized = true;
-  TRACE_C1X_1("C1XCompiler::initialize");
-
-  VmIds::initializeObjects();
-
-  initialize_buffer_blob();
-  Runtime1::initialize(THREAD->get_buffer_blob());
-
-  JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment();
-  jclass klass = env->FindClass("com/oracle/max/graal/runtime/VMEntriesNative");
-  if (klass == NULL) {
-    tty->print_cr("c1x VMEntries class not found");
-    vm_abort(false);
-  }
-  env->RegisterNatives(klass, VMEntries_methods, VMEntries_methods_count());
-
-  {
-    VM_ENTRY_MARK;
-    check_pending_exception("Could not register natives");
-  }
-
-  c1x_compute_offsets();
-
-  {
-    VM_ENTRY_MARK;
-    HandleMark hm;
-    VMExits::setDefaultOptions();
-    for (int i = 0; i < Arguments::num_c1x_args(); ++i) {
-      const char* arg = Arguments::c1x_args_array()[i];
-      Handle option = java_lang_String::create_from_str(arg, THREAD);
-      jboolean result = VMExits::setOption(option);
-      if (!result) {
-        tty->print_cr("Invalid option for C1X!");
-        vm_abort(false);
-      }
-    }
-
-    VMExits::initializeCompiler();
-  }
-}
-
-void C1XCompiler::initialize_buffer_blob() {
-
-  CompilerThread* THREAD = CompilerThread::current();
-  if (THREAD->get_buffer_blob() == NULL) {
-    // setup CodeBuffer.  Preallocate a BufferBlob of size
-    // NMethodSizeLimit plus some extra space for constants.
-    int code_buffer_size = Compilation::desired_max_code_buffer_size() +
-      Compilation::desired_max_constant_size();
-    BufferBlob* blob = BufferBlob::create("C1X temporary CodeBuffer",
-                                          code_buffer_size);
-    guarantee(blob != NULL, "must create code buffer");
-    THREAD->set_buffer_blob(blob);
-  }
-}
-
-// Compilation entry point for methods
-void C1XCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
-  initialize();
-  VM_ENTRY_MARK;
-  ResourceMark rm;
-  HandleMark hm;
-
-  initialize_buffer_blob();
-  VmIds::initializeObjects();
-
-  TRACE_C1X_2("C1XCompiler::compile_method");
-
-  CompilerThread::current()->set_compiling(true);
-  methodOop method = (methodOop) target->get_oop();
-  VMExits::compileMethod(VmIds::add<methodOop>(method), VmIds::toString<Handle>(method->name(), THREAD), entry_bci);
-  CompilerThread::current()->set_compiling(false);
-
-  VmIds::cleanupLocalObjects();
-  TRACE_C1X_2("C1XCompiler::compile_method exit");
-}
-
-// Print compilation timers and statistics
-void C1XCompiler::print_timers() {
-  TRACE_C1X_1("C1XCompiler::print_timers");
-}
-
-oop C1XCompiler::get_RiType(ciType *type, KlassHandle accessor, TRAPS) {
-  if (type->is_loaded()) {
-    if (type->is_primitive_type()) {
-      return VMExits::createRiTypePrimitive((int) type->basic_type(), THREAD);
-    }
-    KlassHandle klass = (klassOop) type->get_oop();
-    Handle name = VmIds::toString<Handle>(klass->name(), THREAD);
-    return createHotSpotTypeResolved(klass, name, CHECK_NULL);
-  } else {
-    Symbol* name = ((ciKlass *) type)->name()->get_symbol();
-    return VMExits::createRiTypeUnresolved(VmIds::toString<Handle>(name, THREAD), THREAD);
-  }
-}
-
-oop C1XCompiler::get_RiField(ciField *field, ciInstanceKlass* accessor_klass, KlassHandle accessor, Bytecodes::Code byteCode, TRAPS) {
-  bool will_link = field->will_link_from_vm(accessor_klass, byteCode);
-  int offset = (field->holder()->is_loaded() && will_link) ? field->offset() : -1;
-  Handle field_name = VmIds::toString<Handle>(field->name()->get_symbol(), CHECK_0);
-  Handle field_holder = get_RiType(field->holder(), accessor, CHECK_0);
-  Handle field_type = get_RiType(field->type(), accessor, CHECK_0);
-  int flags = field->flags().as_int();
-  return VMExits::createRiField(field_holder, field_name, field_type, offset, flags, THREAD);
-}
-
-oop C1XCompiler::createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS) {
-  if (klass->c1x_mirror() != NULL) {
-    return klass->c1x_mirror();
-  }
-
-  instanceKlass::cast(HotSpotTypeResolved::klass())->initialize(CHECK_NULL);
-  Handle obj = instanceKlass::cast(HotSpotTypeResolved::klass())->allocate_instance(CHECK_NULL);
-  assert(obj() != NULL, "must succeed in allocating instance");
-
-  HotSpotTypeResolved::set_compiler(obj, VMExits::compilerInstance()());
-
-  if (klass->oop_is_instance()) {
-    instanceKlass* ik = (instanceKlass*)klass()->klass_part();
-    Handle full_name = java_lang_String::create_from_str(ik->signature_name(), CHECK_NULL);
-    HotSpotType::set_name(obj, full_name());
-  } else {
-    HotSpotType::set_name(obj, name());
-  }
-
-  HotSpotTypeResolved::set_javaMirror(obj, klass->java_mirror());
-  HotSpotTypeResolved::set_simpleName(obj, name());
-  HotSpotTypeResolved::set_accessFlags(obj, klass->access_flags().as_int());
-  HotSpotTypeResolved::set_isInterface(obj, klass->is_interface());
-  HotSpotTypeResolved::set_isInstanceClass(obj, klass->oop_is_instance());
-
-  if (klass->oop_is_javaArray()) {
-    HotSpotTypeResolved::set_isArrayClass(obj, true);
-    HotSpotTypeResolved::set_componentType(obj, NULL);
-  } else {
-    HotSpotTypeResolved::set_isArrayClass(obj, false);
-    HotSpotTypeResolved::set_componentType(obj, NULL);
-    HotSpotTypeResolved::set_isInitialized(obj, instanceKlass::cast(klass())->is_initialized());
-    HotSpotTypeResolved::set_instanceSize(obj, instanceKlass::cast(klass())->size_helper() * HeapWordSize);
-    HotSpotTypeResolved::set_hasFinalizer(obj, klass->has_finalizer());
-  }
-
-  // TODO replace these with correct values
-  HotSpotTypeResolved::set_hasSubclass(obj, false);
-  HotSpotTypeResolved::set_hasFinalizableSubclass(obj, false);
-
-  klass->set_c1x_mirror(obj());
-
-  return obj();
-}
-
-BasicType C1XCompiler::kindToBasicType(jchar ch) {
-  switch(ch) {
-    case 'z': return T_BOOLEAN;
-    case 'b': return T_BYTE;
-    case 's': return T_SHORT;
-    case 'c': return T_CHAR;
-    case 'i': return T_INT;
-    case 'f': return T_FLOAT;
-    case 'l': return T_LONG;
-    case 'd': return T_DOUBLE;
-    case 'a': return T_OBJECT;
-    case 'r': return T_ADDRESS;
-    case '-': return T_ILLEGAL;
-    default:
-      fatal(err_msg("unexpected CiKind: %c", ch));
-      break;
-  }
-  return T_ILLEGAL;
-}
-
--- a/src/share/vm/c1x/c1x_Compiler.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "compiler/abstractCompiler.hpp"
-
-class C1XCompiler : public AbstractCompiler {
-
-private:
-
-  bool                  _initialized;
-
-  static C1XCompiler*   _instance;
-
-public:
-
-  C1XCompiler();
-
-  static C1XCompiler* instance() { return _instance; }
-
-
-  virtual const char* name() { return "C1X"; }
-
-  // Native / OSR not supported
-  virtual bool supports_native()                 { return false; }
-  virtual bool supports_osr   ()                 { return false; }
-
-  // Pretend to be C1
-  bool is_c1   ()                                { return true; }
-  bool is_c2   ()                                { return false; }
-
-  // Initialization
-  virtual void initialize();
-
-  // Compilation entry point for methods
-  virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
-
-  // Print compilation timers and statistics
-  virtual void print_timers();
-
-  static oop get_RiType(ciType *klass, KlassHandle accessor, TRAPS);
-  static oop get_RiField(ciField *ciField, ciInstanceKlass* accessor_klass, KlassHandle accessor, Bytecodes::Code byteCode, TRAPS);
-
-  static oop createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS);
-
-  static BasicType kindToBasicType(jchar ch);
-
-  static int to_cp_index_u2(int index) {
-    // Swap.
-    index = ((index & 0xFF) << 8) | (index >> 8);
-    // Tag.
-    index = index + constantPoolOopDesc::CPCACHE_INDEX_TAG;
-    return index;
-  }
-
-private:
-
-  void initialize_buffer_blob();
-};
-
-// Tracing macros
-
-#define IF_TRACE_C1X_1 if (!(TraceC1X >= 1)) ; else
-#define IF_TRACE_C1X_2 if (!(TraceC1X >= 2)) ; else
-#define IF_TRACE_C1X_3 if (!(TraceC1X >= 3)) ; else
-#define IF_TRACE_C1X_4 if (!(TraceC1X >= 4)) ; else
-#define IF_TRACE_C1X_5 if (!(TraceC1X >= 5)) ; else
-
-// using commas and else to keep one-instruction semantics
-
-#define TRACE_C1X_1 if (!(TraceC1X >= 1 && (tty->print("TraceC1X-1: "), true))) ; else tty->print_cr
-#define TRACE_C1X_2 if (!(TraceC1X >= 2 && (tty->print("   TraceC1X-2: "), true))) ; else tty->print_cr
-#define TRACE_C1X_3 if (!(TraceC1X >= 3 && (tty->print("      TraceC1X-3: "), true))) ; else tty->print_cr
-#define TRACE_C1X_4 if (!(TraceC1X >= 4 && (tty->print("         TraceC1X-4: "), true))) ; else tty->print_cr
-#define TRACE_C1X_5 if (!(TraceC1X >= 5 && (tty->print("            TraceC1X-5: "), true))) ; else tty->print_cr
-
-
-
--- a/src/share/vm/c1x/c1x_JavaAccess.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "c1x/c1x_JavaAccess.hpp"
-#include "runtime/jniHandles.hpp"
-#include "classfile/symbolTable.hpp"
-// This function is similar to javaClasses.cpp, it computes the field offset of a (static or instance) field.
-// It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded.
-
-static void compute_offset(int &dest_offset, klassOop klass_oop, const char* name, const char* signature, bool static_field) {
-  Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name));
-  Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature));
-#ifdef DEBUG
-  if (name_symbol == NULL) {
-    tty->print_cr("symbol with name %s was not found in symbol table (klass=%s)", name, klass_oop->klass_part()->name()->as_C_string());
-  }
-#endif
-  assert(name_symbol != NULL, "symbol not found - class layout changed?");
-  assert(signature_symbol != NULL, "symbol not found - class layout changed?");
-
-  instanceKlass* ik = instanceKlass::cast(klass_oop);
-  fieldDescriptor fd;
-  if (!ik->find_field(name_symbol, signature_symbol, &fd)) {
-    ResourceMark rm;
-    tty->print_cr("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name());
-    fatal("Invalid layout of preloaded class");
-  }
-  assert(fd.is_static() == static_field, "static/instance mismatch");
-  dest_offset = fd.offset();
-}
-
-// This piece of macro magic creates the contents of the c1x_compute_offsets method that initializes the field indices of all the access classes.
-
-#define START_CLASS(name) { klassOop k = SystemDictionary::name##_klass(); assert(k != NULL, "Could not find class " #name "");
-
-#define END_CLASS }
-
-#define FIELD(klass, name, signature, static_field) compute_offset(klass::_##name##_offset, k, #name, signature, static_field);
-#define CHAR_FIELD(klass, name) FIELD(klass, name, "C", false)
-#define INT_FIELD(klass, name) FIELD(klass, name, "I", false)
-#define BOOLEAN_FIELD(klass, name) FIELD(klass, name, "Z", false)
-#define LONG_FIELD(klass, name) FIELD(klass, name, "J", false)
-#define OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, false)
-#define STATIC_OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, true)
-
-
-void c1x_compute_offsets() {
-  COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, OOP_FIELD, STATIC_OOP_FIELD)
-}
-
-#define EMPTY0
-#define EMPTY1(x)
-#define EMPTY2(x,y)
-#define FIELD2(klass, name) int klass::_##name##_offset = 0;
-#define FIELD3(klass, name, sig) FIELD2(klass, name)
-
-COMPILER_CLASSES_DO(EMPTY1, EMPTY0, FIELD2, FIELD2, FIELD2, FIELD2, FIELD3, FIELD3)
-
-
-
-
-
--- a/src/share/vm/c1x/c1x_JavaAccess.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-void c1x_compute_offsets();
-
-#include "classfile/systemDictionary.hpp"
-#include "oops/instanceMirrorKlass.hpp"
-
-/* This macro defines the structure of the CiTargetMethod - classes.
- * It will generate classes with accessors similar to javaClasses.hpp, but with specializations for oops, Handles and jni handles.
- *
- * The public interface of these classes will look like this:
-
- * class CiStackSlot : AllStatic {
- * public:
- *   static klassOop klass();
- *   static jint  index(oop obj);
- *   static jint  index(Handle obj);
- *   static jint  index(jobject obj);
- *   static void set_index(oop obj, jint x);
- *   static void set_index(Handle obj, jint x);
- *   static void set_index(jobject obj, jint x);
- * };
- *
- */
-
-#define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, oop_field, static_oop_field)   \
-  start_class(HotSpotTypeResolved)                                                      \
-    oop_field(HotSpotTypeResolved, compiler, "Lcom/oracle/max/graal/runtime/Compiler;") \
-    oop_field(HotSpotTypeResolved, javaMirror, "Ljava/lang/Class;")                     \
-    oop_field(HotSpotTypeResolved, simpleName, "Ljava/lang/String;")                    \
-    int_field(HotSpotTypeResolved, accessFlags)                                         \
-    boolean_field(HotSpotTypeResolved, hasFinalizer)                                    \
-    boolean_field(HotSpotTypeResolved, hasSubclass)                                     \
-    boolean_field(HotSpotTypeResolved, hasFinalizableSubclass)                          \
-    boolean_field(HotSpotTypeResolved, isInitialized)                                   \
-    boolean_field(HotSpotTypeResolved, isArrayClass)                                    \
-    boolean_field(HotSpotTypeResolved, isInstanceClass)                                 \
-    boolean_field(HotSpotTypeResolved, isInterface)                                     \
-    int_field(HotSpotTypeResolved, instanceSize)                                        \
-    oop_field(HotSpotTypeResolved, componentType, "Lcom/sun/cri/ri/RiType;")            \
-  end_class                                                                             \
-  start_class(HotSpotType)                                                              \
-    oop_field(HotSpotType, name, "Ljava/lang/String;")                                  \
-  end_class                                                                             \
-  start_class(HotSpotField)                                                             \
-    oop_field(HotSpotField, constant, "Lcom/sun/cri/ci/CiConstant;")                    \
-  end_class                                                                             \
-  start_class(HotSpotMethodResolved)                                                    \
-    long_field(HotSpotMethodResolved, vmId)                                             \
-  end_class                                                                             \
-  start_class(HotSpotProxy)                                                             \
-    static_oop_field(HotSpotProxy, DUMMY_CONSTANT_OBJ, "Ljava/lang/Long;")              \
-  end_class                                                                             \
-  start_class(HotSpotTargetMethod)                                                      \
-    oop_field(HotSpotTargetMethod, targetMethod, "Lcom/sun/cri/ci/CiTargetMethod;")     \
-    oop_field(HotSpotTargetMethod, method, "Lcom/oracle/max/graal/runtime/HotSpotMethodResolved;") \
-    oop_field(HotSpotTargetMethod, name, "Ljava/lang/String;")                          \
-    oop_field(HotSpotTargetMethod, sites, "[Lcom/sun/cri/ci/CiTargetMethod$Site;")      \
-    oop_field(HotSpotTargetMethod, exceptionHandlers, "[Lcom/sun/cri/ci/CiTargetMethod$ExceptionHandler;") \
-  end_class                                                                             \
-  start_class(HotSpotExceptionHandler)                                                  \
-    int_field(HotSpotExceptionHandler, startBci)                                        \
-    int_field(HotSpotExceptionHandler, endBci)                                          \
-    int_field(HotSpotExceptionHandler, handlerBci)                                      \
-    int_field(HotSpotExceptionHandler, catchClassIndex)                                 \
-    oop_field(HotSpotExceptionHandler, catchClass, "Lcom/sun/cri/ri/RiType;")           \
-  end_class                                                                             \
-  start_class(CiTargetMethod)                                                           \
-    int_field(CiTargetMethod, frameSize)                                                \
-    int_field(CiTargetMethod, customStackAreaOffset)                                    \
-    oop_field(CiTargetMethod, targetCode, "[B")                                         \
-    oop_field(CiTargetMethod, assumptions, "Lcom/sun/cri/ci/CiAssumptions;")            \
-    int_field(CiTargetMethod, targetCodeSize)                                           \
-  end_class                                                                             \
-  start_class(CiAssumptions)                                                            \
-    oop_field(CiAssumptions, list, "[Lcom/sun/cri/ci/CiAssumptions$Assumption;")        \
-  end_class                                                                             \
-  start_class(CiAssumptions_ConcreteSubtype)                                            \
-    oop_field(CiAssumptions_ConcreteSubtype, context, "Lcom/sun/cri/ri/RiType;")        \
-    oop_field(CiAssumptions_ConcreteSubtype, subtype, "Lcom/sun/cri/ri/RiType;")        \
-  end_class                                                                             \
-  start_class(CiAssumptions_ConcreteMethod)                                             \
-    oop_field(CiAssumptions_ConcreteMethod, context, "Lcom/sun/cri/ri/RiMethod;")       \
-    oop_field(CiAssumptions_ConcreteMethod, method, "Lcom/sun/cri/ri/RiMethod;")        \
-  end_class                                                                             \
-  start_class(CiTargetMethod_Site)                                                      \
-    int_field(CiTargetMethod_Site, pcOffset)                                            \
-  end_class                                                                             \
-  start_class(CiTargetMethod_Call)                                                      \
-    oop_field(CiTargetMethod_Call, runtimeCall, "Lcom/sun/cri/ci/CiRuntimeCall;")       \
-    oop_field(CiTargetMethod_Call, method, "Lcom/sun/cri/ri/RiMethod;")                 \
-    oop_field(CiTargetMethod_Call, symbol, "Ljava/lang/String;")                        \
-    oop_field(CiTargetMethod_Call, globalStubID, "Ljava/lang/Object;")                  \
-    oop_field(CiTargetMethod_Call, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;")           \
-  end_class                                                                             \
-  start_class(CiTargetMethod_DataPatch)                                                 \
-    oop_field(CiTargetMethod_DataPatch, constant, "Lcom/sun/cri/ci/CiConstant;")        \
-  end_class                                                                             \
-  start_class(CiTargetMethod_Safepoint)                                                 \
-    oop_field(CiTargetMethod_Safepoint, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;")      \
-  end_class                                                                             \
-  start_class(CiTargetMethod_ExceptionHandler)                                          \
-    int_field(CiTargetMethod_ExceptionHandler, handlerPos)                              \
-    int_field(CiTargetMethod_ExceptionHandler, handlerBci)                              \
-    int_field(CiTargetMethod_ExceptionHandler, bci)                                     \
-    int_field(CiTargetMethod_ExceptionHandler, scopeLevel)                              \
-    oop_field(CiTargetMethod_ExceptionHandler, exceptionType, "Lcom/sun/cri/ri/RiType;")\
-  end_class                                                                             \
-  start_class(CiTargetMethod_Mark)                                                      \
-    oop_field(CiTargetMethod_Mark, id, "Ljava/lang/Object;")                            \
-    oop_field(CiTargetMethod_Mark, references, "[Lcom/sun/cri/ci/CiTargetMethod$Mark;") \
-  end_class                                                                             \
-  start_class(CiDebugInfo)                                                              \
-    oop_field(CiDebugInfo, codePos, "Lcom/sun/cri/ci/CiCodePos;")                       \
-    oop_field(CiDebugInfo, registerRefMap, "Lcom/sun/cri/ci/CiBitMap;")                 \
-    oop_field(CiDebugInfo, frameRefMap, "Lcom/sun/cri/ci/CiBitMap;")                    \
-  end_class                                                                             \
-  start_class(CiBitMap)                                                                 \
-    int_field(CiBitMap, size)                                                           \
-    long_field(CiBitMap, low)                                                           \
-    oop_field(CiBitMap, extra, "[J")                                                    \
-  end_class                                                                             \
-  start_class(CiFrame)                                                                  \
-    oop_field(CiFrame, values, "[Lcom/sun/cri/ci/CiValue;")                             \
-    int_field(CiFrame, numLocals)                                                       \
-    int_field(CiFrame, numStack)                                                        \
-    int_field(CiFrame, numLocks)                                                        \
-  end_class                                                                             \
-  start_class(CiCodePos)                                                                \
-    oop_field(CiCodePos, caller, "Lcom/sun/cri/ci/CiCodePos;")                          \
-    oop_field(CiCodePos, method, "Lcom/sun/cri/ri/RiMethod;")                           \
-    int_field(CiCodePos, bci)                                                           \
-  end_class                                                                             \
-  start_class(CiConstant)                                                               \
-    oop_field(CiConstant, kind, "Lcom/sun/cri/ci/CiKind;")                              \
-    oop_field(CiConstant, object, "Ljava/lang/Object;")                                 \
-    long_field(CiConstant, primitive)                                                   \
-  end_class                                                                             \
-  start_class(CiKind)                                                                   \
-    char_field(CiKind, typeChar)                                                        \
-    static_oop_field(CiKind, Boolean, "Lcom/sun/cri/ci/CiKind;");                       \
-    static_oop_field(CiKind, Byte, "Lcom/sun/cri/ci/CiKind;");                          \
-    static_oop_field(CiKind, Char, "Lcom/sun/cri/ci/CiKind;");                          \
-    static_oop_field(CiKind, Short, "Lcom/sun/cri/ci/CiKind;");                         \
-    static_oop_field(CiKind, Int, "Lcom/sun/cri/ci/CiKind;");                           \
-    static_oop_field(CiKind, Long, "Lcom/sun/cri/ci/CiKind;");                          \
-  end_class                                                                             \
-  start_class(CiRuntimeCall)                                                            \
-    static_oop_field(CiRuntimeCall, UnwindException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, RegisterFinalizer, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, HandleException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, OSRMigrationEnd, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, JavaTimeMillis, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, JavaTimeNanos, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, Debug, "Lcom/sun/cri/ci/CiRuntimeCall;");           \
-    static_oop_field(CiRuntimeCall, ArithmethicLrem, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, ArithmeticLdiv, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticFrem, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticDrem, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticCos, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticTan, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticLog, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticLog10, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, ArithmeticSin, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, Deoptimize, "Lcom/sun/cri/ci/CiRuntimeCall;");      \
-  end_class                                                                             \
-  start_class(RiMethod)                                                                 \
-  end_class                                                                             \
-  start_class(CiValue)                                                                  \
-    oop_field(CiValue, kind, "Lcom/sun/cri/ci/CiKind;")                                 \
-    static_oop_field(CiValue, IllegalValue, "Lcom/sun/cri/ci/CiValue;");                \
-  end_class                                                                             \
-  start_class(CiRegisterValue)                                                          \
-    oop_field(CiRegisterValue, reg, "Lcom/sun/cri/ci/CiRegister;")                      \
-  end_class                                                                             \
-  start_class(CiRegister)                                                               \
-    int_field(CiRegister, number)                                                       \
-  end_class                                                                             \
-  start_class(CiStackSlot)                                                              \
-    int_field(CiStackSlot, index)                                                       \
-  end_class                                                                             \
-  /* end*/
-
-
-
-
-#define START_CLASS(name)                       \
-  class name : AllStatic {                      \
-  private:                                      \
-    friend class C1XCompiler;                   \
-    static void check(oop obj) { assert(obj != NULL, "NULL field access of class " #name); assert(obj->is_a(SystemDictionary::name##_klass()), "wrong class, " #name " expected"); } \
-    static void compute_offsets();              \
-  public:                                       \
-    static klassOop klass() { return SystemDictionary::name##_klass(); }
-
-#define END_CLASS };
-
-#define FIELD(name, type, accessor)             \
-    static int _##name##_offset;                \
-    static type name(oop obj)                   { check(obj); return obj->accessor(_##name##_offset); } \
-    static type name(Handle obj)                { check(obj()); return obj->accessor(_##name##_offset); } \
-    static type name(jobject obj)               { check(JNIHandles::resolve(obj)); return JNIHandles::resolve(obj)->accessor(_##name##_offset); } \
-    static void set_##name(oop obj, type x)     { check(obj); obj->accessor##_put(_##name##_offset, x); } \
-    static void set_##name(Handle obj, type x)  { check(obj()); obj->accessor##_put(_##name##_offset, x); } \
-    static void set_##name(jobject obj, type x) { check(JNIHandles::resolve(obj)); JNIHandles::resolve(obj)->accessor##_put(_##name##_offset, x); }
-
-#define CHAR_FIELD(klass, name) FIELD(name, jchar, char_field)
-#define INT_FIELD(klass, name) FIELD(name, jint, int_field)
-#define BOOLEAN_FIELD(klass, name) FIELD(name, jboolean, bool_field)
-#define LONG_FIELD(klass, name) FIELD(name, jlong, long_field)
-#define OOP_FIELD(klass, name, signature) FIELD(name, oop, obj_field)
-#define STATIC_OOP_FIELD(klassName, name, signature)                \
-    static int _##name##_offset;                                    \
-    static oop name() {                                             \
-      instanceKlass* ik = instanceKlass::cast(klassName::klass());  \
-      address addr = ik->static_field_addr(_##name##_offset - instanceMirrorKlass::offset_of_static_fields());       \
-      if (UseCompressedOops) {                                      \
-        return oopDesc::load_decode_heap_oop((narrowOop *)addr);    \
-      } else {                                                      \
-        return oopDesc::load_decode_heap_oop((oop*)addr);           \
-      }                                                             \
-    }                                                               \
-    static void set_##name(oop x) {                                 \
-      instanceKlass* ik = instanceKlass::cast(klassName::klass());  \
-      address addr = ik->static_field_addr(_##name##_offset - instanceMirrorKlass::offset_of_static_fields());       \
-      if (UseCompressedOops) {                                      \
-        oopDesc::encode_store_heap_oop((narrowOop *)addr, x);       \
-      } else {                                                      \
-        oopDesc::encode_store_heap_oop((oop*)addr, x);              \
-      }                                                             \
-    }
-COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, OOP_FIELD, STATIC_OOP_FIELD)
-#undef START_CLASS
-#undef END_CLASS
-#undef FIELD
-#undef CHAR_FIELD
-#undef INT_FIELD
-#undef BOOLEAN_FIELD
-#undef LONG_FIELD
-#undef OOP_FIELD
-#undef STATIC_OOP_FIELD
-
-
--- a/src/share/vm/c1x/c1x_VMEntries.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,710 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "c1x/c1x_VMEntries.hpp"
-#include "c1x/c1x_Compiler.hpp"
-#include "c1x/c1x_JavaAccess.hpp"
-#include "c1x/c1x_CodeInstaller.hpp"
-#include "c1x/c1x_VMExits.hpp"
-#include "c1x/c1x_VmIds.hpp"
-#include "c1/c1_Runtime1.hpp"
-#include "memory/oopFactory.hpp"
-
-// public byte[] RiMethod_code(long vmId);
-JNIEXPORT jbyteArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1code(JNIEnv *env, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_code");
-  methodHandle method = VmIds::get<methodOop>(vmId);
-  int code_size = method->code_size();
-  jbyteArray result = env->NewByteArray(code_size);
-  env->SetByteArrayRegion(result, 0, code_size, (const jbyte *) method->code_base());
-  return result;
-}
-
-// public int RiMethod_maxStackSize(long vmId);
-JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxStackSize(JNIEnv *, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_maxStackSize");
-  return VmIds::get<methodOop>(vmId)->max_stack();
-}
-
-// public int RiMethod_maxLocals(long vmId);
-JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxLocals(JNIEnv *, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_maxLocals");
-  return VmIds::get<methodOop>(vmId)->max_locals();
-}
-
-// public RiType RiMethod_holder(long vmId);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1holder(JNIEnv *, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_holder");
-  VM_ENTRY_MARK
-  KlassHandle klass = VmIds::get<methodOop>(vmId)->method_holder();
-  Handle name = VmIds::toString<Handle>(klass->name(), CHECK_NULL);
-  oop holder = C1XCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL);
-  return JNIHandles::make_local(THREAD, holder);
-}
-
-// public String RiMethod_signature(long vmId);
-JNIEXPORT jstring JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1signature(JNIEnv *env, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_signature");
-  VM_ENTRY_MARK
-  methodOop method = VmIds::get<methodOop>(vmId);
-  return VmIds::toString<jstring>(method->signature(), THREAD);
-}
-
-// public int RiMethod_accessFlags(long vmId);
-JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1accessFlags(JNIEnv *, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_accessFlags");
-  return VmIds::get<methodOop>(vmId)->access_flags().as_int();
-}
-
-// public RiExceptionHandler[] RiMethod_exceptionHandlers(long vmId);
-JNIEXPORT jobjectArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1exceptionHandlers(JNIEnv *, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_exceptionHandlers");
-  VM_ENTRY_MARK
-  methodHandle method = VmIds::get<methodOop>(vmId);
-  typeArrayHandle handlers = method->exception_table();
-  int handler_count = handlers.is_null() ? 0 : handlers->length() / 4;
-
-  instanceKlass::cast(HotSpotExceptionHandler::klass())->initialize(CHECK_NULL);
-  objArrayHandle array = oopFactory::new_objArray(SystemDictionary::RiExceptionHandler_klass(), handler_count, CHECK_NULL);
-
-  for (int i = 0; i < handler_count; i++) {
-    // exception handlers are stored as four integers: start bci, end bci, handler bci, catch class constant pool index
-    int base = i * 4;
-    Handle entry = instanceKlass::cast(HotSpotExceptionHandler::klass())->allocate_instance(CHECK_NULL);
-    HotSpotExceptionHandler::set_startBci(entry, handlers->int_at(base + 0));
-    HotSpotExceptionHandler::set_endBci(entry, handlers->int_at(base + 1));
-    HotSpotExceptionHandler::set_handlerBci(entry, handlers->int_at(base + 2));
-    int catch_class_index = handlers->int_at(base + 3);
-    HotSpotExceptionHandler::set_catchClassIndex(entry, catch_class_index);
-
-    if (catch_class_index == 0) {
-      HotSpotExceptionHandler::set_catchClass(entry, NULL);
-    } else {
-      constantPoolOop cp = instanceKlass::cast(method->method_holder())->constants();
-      ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(method->method_holder());
-      bool is_accessible = false;
-      ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, catch_class_index, is_accessible, loading_klass);
-      oop catch_class = C1XCompiler::get_RiType(klass, method->method_holder(), CHECK_NULL);
-
-      HotSpotExceptionHandler::set_catchClass(entry, catch_class);
-    }
-    array->obj_at_put(i, entry());
-  }
-
-  return (jobjectArray) JNIHandles::make_local(array());
-}
-
-// public boolean RiMethod_hasBalancedMonitors(long vmId);
-JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1hasBalancedMonitors(JNIEnv *, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_hasBalancedMonitors");
-  ciMethod* cimethod;
-  {
-    VM_ENTRY_MARK;
-    cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId));
-  }
-  return cimethod->has_balanced_monitors();
-}
-
-// public boolean RiMethod_uniqueConcreteMethod(long vmId);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1uniqueConcreteMethod(JNIEnv *, jobject, jlong vmId) {
-  TRACE_C1X_3("VMEntries::RiMethod_uniqueConcreteMethod");
-  VM_ENTRY_MARK;
-  ciMethod* cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId));
-  if (cimethod->holder()->is_interface()) {
-    // Cannot trust interfaces. Because of:
-    // interface I { void foo(); }
-    // class A { public void foo() {} }
-    // class B extends A implements I { }
-    // class C extends B { public void foo() { } }
-    // class D extends B { }
-    // Would lead to identify C.foo() as the unique concrete method for I.foo() without seeing A.foo().
-    return false;
-  }
-  klassOop klass = (klassOop)cimethod->holder()->get_oop();
-  methodHandle method((methodOop)cimethod->get_oop());
-  methodHandle unique_concrete;
-  {
-    ResourceMark rm;
-    MutexLocker locker(Compile_lock);
-    unique_concrete = methodHandle(Dependencies::find_unique_concrete_method(klass, method()));
-  }
-  if (unique_concrete.is_null()) {
-    return NULL;
-  }
-
-  Handle name = VmIds::toString<Handle>(unique_concrete->name(), CHECK_NULL);
-  oop method_resolved = VMExits::createRiMethodResolved(VmIds::add<methodOop>(unique_concrete()), name, CHECK_NULL);
-  return JNIHandles::make_local(THREAD, method_resolved);
-}
-
-// public RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiSignature_1lookupType(JNIEnv *env, jobject, jstring jname, jobject accessingClass) {
-  TRACE_C1X_3("VMEntries::RiSignature_lookupType");
-  VM_ENTRY_MARK;
-
-  Symbol* nameSymbol = VmIds::toSymbol(jname);
-  Handle name = JNIHandles::resolve(jname);
-
-  oop result;
-  if (nameSymbol == vmSymbols::int_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_INT, THREAD);
-  } else if (nameSymbol == vmSymbols::long_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_LONG, THREAD);
-  } else if (nameSymbol == vmSymbols::bool_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_BOOLEAN, THREAD);
-  } else if (nameSymbol == vmSymbols::char_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_CHAR, THREAD);
-  } else if (nameSymbol == vmSymbols::short_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_SHORT, THREAD);
-  } else if (nameSymbol == vmSymbols::byte_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_BYTE, THREAD);
-  } else if (nameSymbol == vmSymbols::double_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_DOUBLE, THREAD);
-  } else if (nameSymbol == vmSymbols::float_signature()) {
-    result = VMExits::createRiTypePrimitive((int) T_FLOAT, THREAD);
-  } else {
-    klassOop resolved_type = NULL;
-    // if the name isn't in the symbol table then the class isn't loaded anyway...
-    if (nameSymbol != NULL) {
-      Handle classloader;
-      Handle protectionDomain;
-      if (JNIHandles::resolve(accessingClass) != NULL) {
-        classloader = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->class_loader();
-        protectionDomain = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->protection_domain();
-      }
-      resolved_type = SystemDictionary::resolve_or_null(nameSymbol, classloader, protectionDomain, THREAD);
-      if (HAS_PENDING_EXCEPTION) {
-        CLEAR_PENDING_EXCEPTION;
-        resolved_type = NULL;
-      }
-    }
-    if (resolved_type != NULL) {
-      result = C1XCompiler::createHotSpotTypeResolved(resolved_type, name, CHECK_NULL);
-    } else {
-      result = VMExits::createRiTypeUnresolved(name, THREAD);
-    }
-  }
-
-  return JNIHandles::make_local(THREAD, result);
-}
-
-// public Object RiConstantPool_lookupConstant(long vmId, int cpi);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupConstant(JNIEnv *env, jobject, jlong vmId, jint index) {
-  TRACE_C1X_3("VMEntries::RiConstantPool_lookupConstant");
-  VM_ENTRY_MARK;
-
-  constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
-
-  oop result = NULL;
-  constantTag tag = cp->tag_at(index);
-  if (tag.is_int()) {
-    result = VMExits::createCiConstant(CiKind::Int(), cp->int_at(index), CHECK_0);
-  } else if (tag.is_long()) {
-    result = VMExits::createCiConstant(CiKind::Long(), cp->long_at(index), CHECK_0);
-  } else if (tag.is_float()) {
-    result = VMExits::createCiConstantFloat(cp->float_at(index), CHECK_0);
-  } else if (tag.is_double()) {
-    result = VMExits::createCiConstantDouble(cp->double_at(index), CHECK_0);
-  } else if (tag.is_string() || tag.is_unresolved_string()) {
-    oop string = NULL;
-    if (cp->is_pseudo_string_at(index)) {
-      string = cp->pseudo_string_at(index);
-    } else {
-      string = cp->string_at(index, THREAD);
-      if (HAS_PENDING_EXCEPTION) {
-        CLEAR_PENDING_EXCEPTION;
-        // TODO: Gracefully exit compilation.
-        fatal("out of memory during compilation!");
-        return NULL;
-      }
-    }
-    result = VMExits::createCiConstantObject(string, CHECK_0);
-  } else if (tag.is_klass() || tag.is_unresolved_klass()) {
-    bool ignore;
-    ciInstanceKlass* accessor = (ciInstanceKlass*) ciEnv::current()->get_object(cp->pool_holder());
-    ciKlass* klass = ciEnv::current()->get_klass_by_index(cp, index, ignore, accessor);
-    result = C1XCompiler::get_RiType(klass, cp->pool_holder(), CHECK_NULL);
-  } else if (tag.is_object()) {
-    oop obj = cp->object_at(index);
-    assert(obj->is_instance(), "must be an instance");
-    result = VMExits::createCiConstantObject(obj, CHECK_NULL);
-  } else {
-    ShouldNotReachHere();
-  }
-
-  return JNIHandles::make_local(THREAD, result);
-}
-
-// public RiMethod RiConstantPool_lookupMethod(long vmId, int cpi, byte byteCode);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) {
-  TRACE_C1X_3("VMEntries::RiConstantPool_lookupMethod");
-  VM_ENTRY_MARK;
-
-  index = C1XCompiler::to_cp_index_u2(index);
-  constantPoolHandle cp = VmIds::get<constantPoolOop>(vmId);
-
-  Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF);
-  ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
-  ciMethod *cimethod = CURRENT_ENV->get_method_by_index(cp, index, bc, loading_klass);
-  if (cimethod->is_loaded()) {
-    methodOop method = (methodOop) cimethod->get_oop();
-    Handle name = VmIds::toString<Handle>(method->name(), CHECK_NULL);
-    return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), name, THREAD));
-  } else {
-    Handle name = VmIds::toString<Handle>(cimethod->name()->get_symbol(), CHECK_NULL);
-    Handle signature = VmIds::toString<Handle>(cimethod->signature()->as_symbol()->get_symbol(), CHECK_NULL);
-    Handle holder = C1XCompiler::get_RiType(cimethod->holder(), cp->klass(), THREAD);
-    return JNIHandles::make_local(THREAD, VMExits::createRiMethodUnresolved(name, signature, holder, THREAD));
-  }
-}
-
-// public RiSignature RiConstantPool_lookupSignature(long vmId, int cpi);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupSignature(JNIEnv *env, jobject, jlong vmId, jint index) {
-  fatal("currently unsupported");
-  return NULL;
-}
-
-// public RiType RiConstantPool_lookupType(long vmId, int cpi);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupType(JNIEnv *env, jobject, jlong vmId, jint index) {
-  TRACE_C1X_3("VMEntries::RiConstantPool_lookupType");
-  VM_ENTRY_MARK;
-
-  constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
-
-  ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
-  bool is_accessible = false;
-  ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, index, is_accessible, loading_klass);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass, cp->klass(), THREAD));
-}
-
-// public RiField RiConstantPool_lookupField(long vmId, int cpi);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupField(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) {
-  TRACE_C1X_3("VMEntries::RiConstantPool_lookupField");
-  VM_ENTRY_MARK;
-
-  index = C1XCompiler::to_cp_index_u2(index);
-  constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
-
-  ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
-  ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index);
-  
-  Bytecodes::Code code = (Bytecodes::Code)(((int) byteCode) & 0xFF);
-  Handle field_handle = C1XCompiler::get_RiField(field, loading_klass, cp->pool_holder(), code, THREAD);
-  bool is_constant = field->is_constant();
-  if (is_constant && field->is_static()) {
-    ciConstant constant = field->constant_value();
-    oop constant_object = NULL;
-    switch (constant.basic_type()) {
-      case T_OBJECT:
-      case T_ARRAY:
-        {
-          ciObject* obj = constant.as_object();
-          if (obj->is_null_object()) {
-            constant_object = VMExits::createCiConstantObject(NULL, CHECK_0);
-          } else if (obj->can_be_constant()) {
-            constant_object = VMExits::createCiConstantObject(constant.as_object()->get_oop(), CHECK_0);
-          }
-        }
-        break;
-      case T_DOUBLE:
-        constant_object = VMExits::createCiConstantDouble(constant.as_double(), CHECK_0);
-        break;
-      case T_FLOAT:
-        constant_object = VMExits::createCiConstantFloat(constant.as_float(), CHECK_0);
-        break;
-      case T_LONG:
-        constant_object = VMExits::createCiConstant(CiKind::Long(), constant.as_long(), CHECK_0);
-        break;
-      case T_INT:
-        constant_object = VMExits::createCiConstant(CiKind::Int(), constant.as_int(), CHECK_0);
-        break;
-      case T_SHORT:
-        constant_object = VMExits::createCiConstant(CiKind::Short(), constant.as_int(), CHECK_0);
-        break;
-      case T_CHAR:
-        constant_object = VMExits::createCiConstant(CiKind::Char(), constant.as_int(), CHECK_0);
-        break;
-      case T_BYTE:
-        constant_object = VMExits::createCiConstant(CiKind::Byte(), constant.as_int(), CHECK_0);
-        break;
-      case T_BOOLEAN:
-        constant_object = VMExits::createCiConstant(CiKind::Boolean(), constant.as_int(), CHECK_0);
-        break;
-      default:
-        constant.print();
-        fatal("Unhandled constant");
-    }
-    if (constant_object != NULL) {
-      HotSpotField::set_constant(field_handle, constant_object);
-    }
-  }
-  return JNIHandles::make_local(THREAD, field_handle());
-}
-
-// public RiConstantPool RiType_constantPool(HotSpotTypeResolved klass);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1constantPool(JNIEnv *, jobject, jobject klass) {
-  TRACE_C1X_3("VMEntries::RiType_constantPool");
-  VM_ENTRY_MARK;
-
-  assert(JNIHandles::resolve(klass) != NULL, "");
-  constantPoolOop constantPool = ((instanceKlass*)java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))->klass_part())->constants();
-  return JNIHandles::make_local(VMExits::createRiConstantPool(VmIds::add<constantPoolOop>(constantPool), THREAD));
-}
-
-// public RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_3resolveMethodImpl(JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature) {
-  TRACE_C1X_3("VMEntries::RiType_resolveMethodImpl");
-  VM_ENTRY_MARK;
-
-  assert(JNIHandles::resolve(resolved_type) != NULL, "");
-  klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(resolved_type));
-  Symbol* name_symbol = VmIds::toSymbol(name);
-  Symbol* signature_symbol = VmIds::toSymbol(signature);
-  methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol);
-  if (method == NULL) {
-    if (TraceC1X >= 3) {
-      ResourceMark rm;
-      tty->print_cr("Could not resolve method %s %s on klass %s", name_symbol->as_C_string(), signature_symbol->as_C_string(), klass->klass_part()->name()->as_C_string());
-    }
-    return NULL;
-  }
-  return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), Handle(JNIHandles::resolve(name)), THREAD));
-}
-
-// public boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
-JNIEXPORT jboolean JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_2isSubtypeOf(JNIEnv *, jobject, jobject klass, jobject jother) {
-  TRACE_C1X_3("VMEntries::RiType_isSubtypeOf");
-  oop other = JNIHandles::resolve(jother);
-  assert(other->is_a(HotSpotTypeResolved::klass()), "resolved hotspot type expected");
-  assert(JNIHandles::resolve(klass) != NULL, "");
-  klassOop thisKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass));
-  klassOop otherKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(other));
-  if (thisKlass->klass_part()->oop_is_instance_slow()) {
-    return instanceKlass::cast(thisKlass)->is_subtype_of(otherKlass);
-  } else if (thisKlass->klass_part()->oop_is_array()) {
-    return arrayKlass::cast(thisKlass)->is_subtype_of(otherKlass);
-  } else {
-    fatal("unexpected class type");
-    return false;
-  }
-}
-
-// public RiType RiType_componentType(HotSpotResolvedType klass);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1componentType(JNIEnv *, jobject, jobject klass) {
-  TRACE_C1X_3("VMEntries::RiType_componentType");
-  ciArrayKlass* array_klass;
-  {
-    VM_ENTRY_MARK;
-    assert(JNIHandles::resolve(klass) != NULL, "");
-    array_klass = (ciArrayKlass *) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
-  }
-  ciType* element_type = array_klass->element_type();
-
-  VM_ENTRY_MARK;
-  assert(JNIHandles::resolve(klass) != NULL, "");
-  return JNIHandles::make_local(C1XCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD));
-}
-
-// public RiType RiType_superType(HotSpotResolvedType klass);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1superType(JNIEnv *, jobject, jobject klass) {
-  TRACE_C1X_3("VMEntries::RiType_superType");
-  VM_ENTRY_MARK;
-  KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
-  ciInstanceKlass* k = NULL;
-
-  if (klass_handle->oop_is_array()) {
-    k = (ciInstanceKlass *) CURRENT_ENV->get_object(SystemDictionary::Object_klass());
-  } else {
-    guarantee(klass_handle->oop_is_instance(), "must be instance klass");  
-    k = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle());
-    k = k->super();
-  }
-
-  if (k != NULL) {
-    return JNIHandles::make_local(C1XCompiler::get_RiType(k, klass_handle, THREAD));
-  } else {
-    return NULL;
-  }
-}
-
-// public RiType RiType_uniqueConcreteSubtype(HotSpotResolvedType klass);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1uniqueConcreteSubtype(JNIEnv *, jobject, jobject klass) {
-  TRACE_C1X_3("VMEntries::RiType_uniqueConcreteSubtype");
-  Thread* THREAD = Thread::current();
-  KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
-  ciInstanceKlass* k = NULL;
-  {
-    VM_ENTRY_MARK;
-    k = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle());
-  }
-
-  if (k->is_abstract()) {
-    ciInstanceKlass* sub = k->unique_concrete_subklass();
-    if (sub != NULL && sub->is_leaf_type()) {
-      VM_ENTRY_MARK;
-      return JNIHandles::make_local(C1XCompiler::get_RiType(sub, klass_handle, THREAD));
-    }
-  } else if (k->is_leaf_type()) {
-    assert(!k->is_interface(), "");
-    return klass;
-  }
-
-  return NULL;
-}
-
-// public RiType RiType_arrayOf(HotSpotTypeResolved klass);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jobject klass) {
-  TRACE_C1X_3("VMEntries::RiType_arrayOf");
-  VM_ENTRY_MARK;
-
-  KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
-  KlassHandle array = klass_handle->array_klass(THREAD);
-  Handle name = VmIds::toString<Handle>(array->name(), CHECK_NULL);
-  return JNIHandles::make_local(THREAD, C1XCompiler::createHotSpotTypeResolved(array, name, THREAD));
-}
-
-// public RiType getPrimitiveArrayType(CiKind kind);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getPrimitiveArrayType(JNIEnv *env, jobject, jobject kind) {
-  TRACE_C1X_3("VMEntries::VMEntries_getPrimitiveArrayType");
-  VM_ENTRY_MARK;
-  BasicType type = C1XCompiler::kindToBasicType(CiKind::typeChar(kind));
-  assert(type != T_OBJECT, "primitive type expecteds");
-  ciKlass* klass = ciTypeArrayKlass::make(type);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass, KlassHandle(), THREAD));
-}
-
-// public RiType getType(Class<?> javaClass);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getType(JNIEnv *env, jobject, jobject javaClass) {
-  TRACE_C1X_3("VMEntries::VMEntries_getType");
-  VM_ENTRY_MARK;
-  oop javaClassOop = JNIHandles::resolve(javaClass);
-  if (javaClassOop == NULL) {
-    fatal("argument to VMEntries.getType must not be NULL");
-    return NULL;
-  } else if (java_lang_Class::is_primitive(javaClassOop)) {
-    BasicType basicType = java_lang_Class::primitive_type(javaClassOop);
-    return JNIHandles::make_local(THREAD, VMExits::createRiTypePrimitive((int) basicType, THREAD));
-  } else {
-    KlassHandle klass = java_lang_Class::as_klassOop(javaClassOop);
-    Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL);
-
-    oop type = C1XCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL);
-    return JNIHandles::make_local(THREAD, type);
-  }
-}
-
-
-// helpers used to set fields in the HotSpotVMConfig object
-jfieldID getFieldID(JNIEnv* env, jobject obj, const char* name, const char* sig) {
-  jfieldID id = env->GetFieldID(env->GetObjectClass(obj), name, sig);
-  if (id == NULL) {
-    TRACE_C1X_1("field not found: %s (%s)", name, sig);
-    fatal("field not found");
-  }
-  return id;
-}
-
-void set_boolean(JNIEnv* env, jobject obj, const char* name, bool value) { env->SetBooleanField(obj, getFieldID(env, obj, name, "Z"), value); }
-void set_int(JNIEnv* env, jobject obj, const char* name, int value) { env->SetIntField(obj, getFieldID(env, obj, name, "I"), value); }
-void set_long(JNIEnv* env, jobject obj, const char* name, jlong value) { env->SetLongField(obj, getFieldID(env, obj, name, "J"), value); }
-void set_object(JNIEnv* env, jobject obj, const char* name, jobject value) { env->SetObjectField(obj, getFieldID(env, obj, name, "Ljava/lang/Object;"), value); }
-void set_int_array(JNIEnv* env, jobject obj, const char* name, jarray value) { env->SetObjectField(obj, getFieldID(env, obj, name, "[I"), value); }
-
-jboolean get_boolean(JNIEnv* env, jobject obj, const char* name) { return env->GetBooleanField(obj, getFieldID(env, obj, name, "Z")); }
-jint get_int(JNIEnv* env, jobject obj, const char* name) { return env->GetIntField(obj, getFieldID(env, obj, name, "I")); }
-jlong get_long(JNIEnv* env, jobject obj, const char* name) { return env->GetLongField(obj, getFieldID(env, obj, name, "J")); }
-jobject get_object(JNIEnv* env, jobject obj, const char* name) { return env->GetObjectField(obj, getFieldID(env, obj, name, "Ljava/lang/Object;")); }
-jobject get_object(JNIEnv* env, jobject obj, const char* name, const char* sig) { return env->GetObjectField(obj, getFieldID(env, obj, name, sig)); }
-
-
-BasicType basicTypes[] = { T_BOOLEAN, T_BYTE, T_SHORT, T_CHAR, T_INT, T_FLOAT, T_LONG, T_DOUBLE, T_OBJECT };
-int basicTypeCount = sizeof(basicTypes) / sizeof(BasicType);
-
-// public HotSpotVMConfig getConfiguration();
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getConfiguration(JNIEnv *env, jobject) {
-  jclass klass = env->FindClass("com/oracle/max/graal/runtime/HotSpotVMConfig");
-  assert(klass != NULL, "HotSpot vm config class not found");
-  jobject config = env->AllocObject(klass);
-#ifdef _WIN64
-  set_boolean(env, config, "windowsOs", true);
-#else
-  set_boolean(env, config, "windowsOs", false);
-#endif
-  set_boolean(env, config, "verifyPointers", VerifyOops);
-  set_boolean(env, config, "useFastLocking", UseFastLocking);
-  set_boolean(env, config, "useFastNewObjectArray", UseFastNewObjectArray);
-  set_boolean(env, config, "useFastNewTypeArray", UseFastNewTypeArray);
-  set_int(env, config, "codeEntryAlignment", CodeEntryAlignment);
-  set_int(env, config, "vmPageSize", os::vm_page_size());
-  set_int(env, config, "stackShadowPages", StackShadowPages);
-  set_int(env, config, "hubOffset", oopDesc::klass_offset_in_bytes());
-  set_int(env, config, "arrayLengthOffset", arrayOopDesc::length_offset_in_bytes());
-  set_int(env, config, "klassStateOffset", instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc));
-  set_int(env, config, "klassStateFullyInitialized", (int)instanceKlass::fully_initialized);
-  set_int(env, config, "threadTlabTopOffset", in_bytes(JavaThread::tlab_top_offset()));
-  set_int(env, config, "threadTlabEndOffset", in_bytes(JavaThread::tlab_end_offset()));
-  set_int(env, config, "threadObjectOffset", in_bytes(JavaThread::threadObj_offset()));
-  set_int(env, config, "instanceHeaderPrototypeOffset", Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes());
-  set_int(env, config, "threadExceptionOopOffset", in_bytes(JavaThread::exception_oop_offset()));
-  set_int(env, config, "threadExceptionPcOffset", in_bytes(JavaThread::exception_pc_offset()));
-  set_int(env, config, "threadMultiNewArrayStorage", in_bytes(JavaThread::c1x_multinewarray_storage_offset()));
-  set_int(env, config, "classMirrorOffset", klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes());
-
-  set_long(env, config, "debugStub", VmIds::addStub((address)warning));
-  set_long(env, config, "instanceofStub", VmIds::addStub(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));
-  set_long(env, config, "verifyPointerStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_verify_pointer_id)));
-  set_long(env, config, "newInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::fast_new_instance_init_check_id)));
-  set_long(env, config, "unresolvedNewInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_instance_id)));
-  set_long(env, config, "newTypeArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_type_array_id)));
-  set_long(env, config, "newObjectArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_object_array_id)));
-  set_long(env, config, "newMultiArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_multi_array_id)));
-  set_long(env, config, "loadKlassStub", VmIds::addStub(Runtime1::entry_for(Runtime1::load_klass_patching_id)));
-  set_long(env, config, "accessFieldStub", VmIds::addStub(Runtime1::entry_for(Runtime1::access_field_patching_id)));
-  set_long(env, config, "resolveStaticCallStub", VmIds::addStub(SharedRuntime::get_resolve_static_call_stub()));
-  set_long(env, config, "inlineCacheMissStub", VmIds::addStub(SharedRuntime::get_ic_miss_stub()));
-  set_long(env, config, "unwindExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_unwind_exception_call_id)));
-  set_long(env, config, "handleExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id)));
-  set_long(env, config, "handleDeoptStub", VmIds::addStub(SharedRuntime::deopt_blob()->unpack()));
-  set_long(env, config, "monitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorenter_id)));
-  set_long(env, config, "monitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorexit_id)));
-  set_long(env, config, "fastMonitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorenter_id)));
-  set_long(env, config, "fastMonitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorexit_id)));
-  set_long(env, config, "safepointPollingAddress", (jlong)(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size())));
-
-  BarrierSet* bs = Universe::heap()->barrier_set();
-  switch (bs->kind()) {
-    case BarrierSet::CardTableModRef:
-    case BarrierSet::CardTableExtension: {
-      jlong base = (jlong)((CardTableModRefBS*)bs)->byte_map_base;
-      assert(base != 0, "unexpected byte_map_base");
-      set_long(env, config, "cardtableStartAddress", base);
-      set_int(env, config, "cardtableShift", CardTableModRefBS::card_shift);
-      break;
-    }
-    case BarrierSet::ModRef:
-    case BarrierSet::Other:
-      set_long(env, config, "cardtableStartAddress", 0);
-      set_int(env, config, "cardtableShift", 0);
-      // No post barriers
-      break;
-#ifndef SERIALGC
-    case BarrierSet::G1SATBCT:
-    case BarrierSet::G1SATBCTLogging:
-#endif // SERIALGC
-    default:
-      ShouldNotReachHere();
-    }
-
-  jintArray arrayOffsets = env->NewIntArray(basicTypeCount);
-  for (int i=0; i<basicTypeCount; i++) {
-    jint offset = arrayOopDesc::base_offset_in_bytes(basicTypes[i]);
-    env->SetIntArrayRegion(arrayOffsets, i, 1, &offset);
-  }
-  set_int_array(env, config, "arrayOffsets", arrayOffsets);
-  set_int(env, config, "arrayClassElementOffset", objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc));
-  return config;
-}
-
-// public void installMethod(HotSpotTargetMethod targetMethod);
-JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod) {
-  VM_ENTRY_MARK;
-  CodeInstaller installer(JNIHandles::resolve(targetMethod));
-}
-
-// public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name);
-JNIEXPORT jlong JNICALL Java_com_oracle_graal_runtime_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) {
-  VM_ENTRY_MARK;
-  jlong id;
-  CodeInstaller installer(JNIHandles::resolve(targetMethod), id);
-  return id;
-}
-
-// public void recordBailout(String reason);
-JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_recordBailout(JNIEnv *jniEnv, jobject, jobject message) {
-  if (C1XBailoutIsFatal) {
-    Handle msg = JNIHandles::resolve(message);
-    if (!msg.is_null()) {
-      java_lang_String::print(msg, tty);
-    }
-    vm_abort(false);
-  }
-}
-
-
-
-
-#define CC (char*)  /*cast a literal from (const char*)*/
-#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
-
-#define PROXY           "J"
-#define TYPE            "Lcom/sun/cri/ri/RiType;"
-#define RESOLVED_TYPE   "Lcom/oracle/max/graal/runtime/HotSpotTypeResolved;"
-#define METHOD          "Lcom/sun/cri/ri/RiMethod;"
-#define SIGNATURE       "Lcom/sun/cri/ri/RiSignature;"
-#define FIELD           "Lcom/sun/cri/ri/RiField;"
-#define CONSTANT_POOL   "Lcom/sun/cri/ri/RiConstantPool;"
-#define EXCEPTION_HANDLERS "[Lcom/sun/cri/ri/RiExceptionHandler;"
-#define TARGET_METHOD   "Lcom/oracle/max/graal/runtime/HotSpotTargetMethod;"
-#define CONFIG          "Lcom/oracle/max/graal/runtime/HotSpotVMConfig;"
-#define HS_METHOD       "Lcom/oracle/max/graal/runtime/HotSpotMethod;"
-#define CI_CONSTANT     "Lcom/sun/cri/ci/CiConstant;"
-#define CI_KIND         "Lcom/sun/cri/ci/CiKind;"
-#define STRING          "Ljava/lang/String;"
-#define OBJECT          "Ljava/lang/Object;"
-#define CLASS           "Ljava/lang/Class;"
-
-JNINativeMethod VMEntries_methods[] = {
-  {CC"RiMethod_code",                   CC"("PROXY")[B",                            FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1code)},
-  {CC"RiMethod_maxStackSize",           CC"("PROXY")I",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxStackSize)},
-  {CC"RiMethod_maxLocals",              CC"("PROXY")I",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxLocals)},
-  {CC"RiMethod_holder",                 CC"("PROXY")"TYPE,                          FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1holder)},
-  {CC"RiMethod_signature",              CC"("PROXY")"STRING,                        FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1signature)},
-  {CC"RiMethod_accessFlags",            CC"("PROXY")I",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1accessFlags)},
-  {CC"RiMethod_exceptionHandlers",      CC"("PROXY")"EXCEPTION_HANDLERS,            FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1exceptionHandlers)},
-  {CC"RiMethod_hasBalancedMonitors",    CC"("PROXY")Z",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1hasBalancedMonitors)},
-  {CC"RiMethod_uniqueConcreteMethod",   CC"("PROXY")"METHOD,                        FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1uniqueConcreteMethod)},
-  {CC"RiSignature_lookupType",          CC"("STRING RESOLVED_TYPE")"TYPE,           FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiSignature_1lookupType)},
-  {CC"RiConstantPool_lookupConstant",   CC"("PROXY"I)"OBJECT,                       FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupConstant)},
-  {CC"RiConstantPool_lookupMethod",     CC"("PROXY"IB)"METHOD,                      FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod)},
-  {CC"RiConstantPool_lookupSignature",  CC"("PROXY"I)"SIGNATURE,                    FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupSignature)},
-  {CC"RiConstantPool_lookupType",       CC"("PROXY"I)"TYPE,                         FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupType)},
-  {CC"RiConstantPool_lookupField",      CC"("PROXY"IB)"FIELD,                       FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupField)},
-  {CC"RiType_constantPool",             CC"("RESOLVED_TYPE")"CONSTANT_POOL,         FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1constantPool)},
-  {CC"RiType_resolveMethodImpl",        CC"("RESOLVED_TYPE STRING STRING")"METHOD,  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_3resolveMethodImpl)},
-  {CC"RiType_isSubtypeOf",              CC"("RESOLVED_TYPE TYPE")Z",                FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_2isSubtypeOf)},
-  {CC"RiType_componentType",            CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1componentType)},
-  {CC"RiType_uniqueConcreteSubtype",    CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1uniqueConcreteSubtype)},
-  {CC"RiType_superType",                CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1superType)},
-  {CC"RiType_arrayOf",                  CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1arrayOf)},
-  {CC"getPrimitiveArrayType",           CC"("CI_KIND")"TYPE,                        FN_PTR(Java_com_oracle_graal_runtime_VMEntries_getPrimitiveArrayType)},
-  {CC"getType",                         CC"("CLASS")"TYPE,                          FN_PTR(Java_com_oracle_graal_runtime_VMEntries_getType)},
-  {CC"getConfiguration",                CC"()"CONFIG,                               FN_PTR(Java_com_oracle_graal_runtime_VMEntries_getConfiguration)},
-  {CC"installMethod",                   CC"("TARGET_METHOD")V",                     FN_PTR(Java_com_oracle_graal_runtime_VMEntries_installMethod)},
-  {CC"installStub",                     CC"("TARGET_METHOD")"PROXY,                 FN_PTR(Java_com_oracle_graal_runtime_VMEntries_installStub)},
-  {CC"recordBailout",                   CC"("STRING")V",                            FN_PTR(Java_com_oracle_graal_runtime_VMEntries_recordBailout)}
-};
-
-int VMEntries_methods_count() {
-  return sizeof(VMEntries_methods) / sizeof(JNINativeMethod);
-}
--- a/src/share/vm/c1x/c1x_VMEntries.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "prims/jni.h"
-
-extern JNINativeMethod VMEntries_methods[];
-int VMEntries_methods_count();
-
-// nothing here - no need to define the jni method implementations in a header file
-
-
--- a/src/share/vm/c1x/c1x_VMExits.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "c1x/c1x_VMExits.hpp"
-
-// this is a *global* handle
-jobject VMExits::_compilerPermObject;
-jobject VMExits::_vmExitsPermObject;
-jobject VMExits::_vmExitsPermKlass;
-
-KlassHandle VMExits::vmExitsKlass() {
-  if (JNIHandles::resolve(_vmExitsPermKlass) == NULL) {
-    klassOop result = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_VMExits(), SystemDictionary::java_system_loader(), NULL, Thread::current());
-    check_not_null(result, "Couldn't find class com.sun.hotspot.c1x.VMExits");
-    _vmExitsPermKlass = JNIHandles::make_global(result);
-  }
-  return KlassHandle((klassOop)JNIHandles::resolve_non_null(_vmExitsPermKlass));
-}
-
-Handle VMExits::compilerInstance() {
-  if (JNIHandles::resolve(_compilerPermObject) == NULL) {
-    KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current());
-    check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.c1x.CompilerImpl");
-
-    JavaValue result(T_OBJECT);
-    JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::getInstance_name(), vmSymbols::getInstance_signature(), Thread::current());
-    check_pending_exception("Couldn't get Compiler");
-    _compilerPermObject = JNIHandles::make_global((oop) result.get_jobject());
-  }
-  return Handle(JNIHandles::resolve_non_null(_compilerPermObject));
-}
-
-Handle VMExits::instance() {
-  if (JNIHandles::resolve(_vmExitsPermObject) == NULL) {
-    KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current());
-    check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.c1x.Compiler");
-
-    JavaValue result(T_OBJECT);
-    JavaCallArguments args;
-    args.set_receiver(compilerInstance());
-    JavaCalls::call_interface(&result, compilerKlass, vmSymbols::getVMExits_name(), vmSymbols::getVMExits_signature(), &args, Thread::current());
-    check_pending_exception("Couldn't get VMExits");
-    _vmExitsPermObject = JNIHandles::make_global((oop) result.get_jobject());
-  }
-  return Handle(JNIHandles::resolve_non_null(_vmExitsPermObject));
-}
-
-void VMExits::initializeCompiler() {
-  KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current());
-  check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.c1x.CompilerImpl");
-
-  JavaValue result(T_VOID);
-  JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::initialize_name(), vmSymbols::void_method_signature(), Thread::current());
-  check_pending_exception("Couldn't initialize compiler");
-}
-
-jboolean VMExits::setOption(Handle option) {
-  assert(!option.is_null(), "");
-  KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current());
-  check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.c1x.HotSpotOptions");
-
-  Thread* THREAD = Thread::current();
-  JavaValue result(T_BOOLEAN);
-  JavaCalls::call_static(&result, compilerKlass, vmSymbols::setOption_name(), vmSymbols::setOption_signature(), option, THREAD);
-  check_pending_exception("Error while calling setOption");
-  return result.get_jboolean();
-}
-
-void VMExits::setDefaultOptions() {
-  KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current());
-  check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.c1x.HotSpotOptions");
-
-  Thread* THREAD = Thread::current();
-  JavaValue result(T_VOID);
-  JavaCalls::call_static(&result, compilerKlass, vmSymbols::setDefaultOptions_name(), vmSymbols::void_method_signature(), THREAD);
-  check_pending_exception("Error while calling setDefaultOptions");
-}
-
-void VMExits::compileMethod(jlong methodVmId, Handle name, int entry_bci) {
-  assert(!name.is_null(), "just checking");
-  Thread* THREAD = Thread::current();
-  JavaValue result(T_VOID);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_long(methodVmId);
-  args.push_oop(name);
-  args.push_int(entry_bci);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, THREAD);
-  check_pending_exception("Error while calling compileMethod");
-}
-
-oop VMExits::createRiMethodResolved(jlong vmId, Handle name, TRAPS) {
-  assert(!name.is_null(), "just checking");
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_long(vmId);
-  args.push_oop(name);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodResolved_name(), vmSymbols::createRiMethodResolved_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiMethodResolved");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createRiMethodUnresolved(Handle name, Handle signature, Handle holder, TRAPS) {
-  assert(!name.is_null(), "just checking");
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_oop(name);
-  args.push_oop(signature);
-  args.push_oop(holder);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodUnresolved_name(), vmSymbols::createRiMethodUnresolved_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiMethodUnresolved");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createRiField(Handle holder, Handle name, Handle type, int index, int flags, TRAPS) {
-  assert(!holder.is_null(), "just checking");
-  assert(!name.is_null(), "just checking");
-  assert(!type.is_null(), "just checking");
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_oop(holder);
-  args.push_oop(name);
-  args.push_oop(type);
-  args.push_int(index);
-  args.push_int(flags);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiField");
-  assert(result.get_type() == T_OBJECT, "just checking");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createRiType(jlong vmId, Handle name, TRAPS) {
-  assert(!name.is_null(), "just checking");
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_long(vmId);
-  args.push_oop(name);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiType");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createRiTypePrimitive(int basic_type, TRAPS) {
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_int(basic_type);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiTypePrimitive");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createRiTypeUnresolved(Handle name, TRAPS) {
-  assert(!name.is_null(), "just checking");
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_oop(name);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiTypeUnresolved");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createRiConstantPool(jlong vmId, TRAPS) {
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_long(vmId);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiConstantPool");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createRiSignature(Handle name, TRAPS) {
-  assert(!name.is_null(), "just checking");
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_oop(name);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createRiSignature");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createCiConstant(Handle kind, jlong value, TRAPS) {
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_oop(kind());
-  args.push_long(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstant_name(), vmSymbols::createCiConstant_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createCiConstantFloat");
-  return (oop) result.get_jobject();
-
-}
-
-oop VMExits::createCiConstantFloat(jfloat value, TRAPS) {
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_float(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createCiConstantFloat");
-  return (oop) result.get_jobject();
-
-}
-
-oop VMExits::createCiConstantDouble(jdouble value, TRAPS) {
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  args.push_oop(instance());
-  args.push_double(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createCiConstantDouble");
-  return (oop) result.get_jobject();
-}
-
-oop VMExits::createCiConstantObject(Handle object, TRAPS) {
-  JavaValue result(T_OBJECT);
-  JavaCallArguments args;
-  /*
-  args.push_oop(instance());
-  args.push_oop(object);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantObject_signature(), &args, THREAD);
-  check_pending_exception("Error while calling createCiConstantObject");
-  */
-
-
-  KlassHandle klass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_cri_ci_CiConstant(), SystemDictionary::java_system_loader(), NULL, Thread::current());
-  JavaCalls::call_static(&result, klass(), vmSymbols::forObject_name(), vmSymbols::createCiConstantObject_signature(), object, THREAD);
-  check_pending_exception("Error while calling CiConstant.forObject");
-  return (oop) result.get_jobject();
-}
--- a/src/share/vm/c1x/c1x_VMExits.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "memory/allocation.hpp"
-#include "oops/oop.hpp"
-#include "runtime/handles.hpp"
-#include "runtime/thread.hpp"
-#include "classfile/javaClasses.hpp"
-#include "runtime/jniHandles.hpp"
-#include "runtime/javaCalls.hpp"
-
-class VMExits : public AllStatic {
-
-private:
-  static jobject _compilerPermObject;
-  static jobject _vmExitsPermObject;
-  static jobject _vmExitsPermKlass;
-
-  static KlassHandle vmExitsKlass();
-  static Handle instance();
-
-public:
-  static void initializeCompiler();
-
-  static Handle compilerInstance();
-
-  // public static boolean HotSpotOptions.setOption(String option);
-  static jboolean setOption(Handle option);
-
-  // public static void HotSpotOptions.setDefaultOptions();
-  static void setDefaultOptions();
-
-  // public abstract void compileMethod(long vmId, String name, int entry_bci);
-  static void compileMethod(jlong vmId, Handle name, int entry_bci);
-
-  // public abstract RiMethod createRiMethodResolved(long vmId, String name);
-  static oop createRiMethodResolved(jlong vmId, Handle name, TRAPS);
-
-  // public abstract RiMethod createRiMethodUnresolved(String name, String signature, RiType holder);
-  static oop createRiMethodUnresolved(Handle name, Handle signature, Handle holder, TRAPS);
-
-  // public abstract RiField createRiField(RiType holder, String name, RiType type, int flags, int offset);
-  static oop createRiField(Handle holder, Handle name, Handle type, int index, int flags, TRAPS);
-
-  // public abstract RiType createRiType(long vmId, String name);
-  static oop createRiType(jlong vmId, Handle name, TRAPS);
-
-  // public abstract RiType createRiTypeUnresolved(String name);
-  static oop createRiTypeUnresolved(Handle name, TRAPS);
-
-  // public abstract RiConstantPool createRiConstantPool(long vmId);
-  static oop createRiConstantPool(jlong vmId, TRAPS);
-
-  // public abstract RiType createRiTypePrimitive(int basicType);
-  static oop createRiTypePrimitive(int basicType, TRAPS);
-
-  // public abstract RiSignature createRiSignature(String signature);
-  static oop createRiSignature(Handle name, TRAPS);
-
-  // public abstract CiConstant createCiConstant(CiKind kind, long value);
-  static oop createCiConstant(Handle kind, jlong value, TRAPS);
-
-  // public abstract CiConstant createCiConstantFloat(float value);
-  static oop createCiConstantFloat(jfloat value, TRAPS);
-
-  // public abstract CiConstant createCiConstantDouble(double value);
-  static oop createCiConstantDouble(jdouble value, TRAPS);
-
-  // public abstract CiConstant createCiConstantObject(long vmId);
-  static oop createCiConstantObject(Handle object, TRAPS);
-};
-
-inline void check_pending_exception(const char* message, bool dump_core = false) {
-  Thread* THREAD = Thread::current();
-  if (THREAD->has_pending_exception()) {
-    Handle exception = PENDING_EXCEPTION;
-    CLEAR_PENDING_EXCEPTION;
-    tty->print_cr("%s", message);
-    java_lang_Throwable::print(exception, tty);
-    tty->cr();
-    java_lang_Throwable::print_stack_trace(exception(), tty);
-    vm_abort(dump_core);
-  }
-}
-
-inline void check_not_null(void* value, const char* message, bool dump_core = false) {
-  if (value == NULL) {
-    tty->print_cr("%s", message);
-    vm_abort(dump_core);
-  }
-}
--- a/src/share/vm/c1x/c1x_VmIds.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "c1x/c1x_VmIds.hpp"
-#include "ci/ciUtilities.hpp"
-
-// VmIds implementation
-
-GrowableArray<address>* VmIds::_stubs = NULL;
-GrowableArray<jobject>* VmIds::_localHandles = NULL;
-
-
-void VmIds::initializeObjects() {
-  if (_stubs == NULL) {
-    assert(_localHandles == NULL, "inconsistent state");
-    _stubs = new (ResourceObj::C_HEAP) GrowableArray<address> (64, true);
-    _localHandles = new (ResourceObj::C_HEAP) GrowableArray<jobject> (64, true);
-  }
-  assert(_localHandles->length() == 0, "invalid state");
-}
-
-void VmIds::cleanupLocalObjects() {
-  for (int i = 0; i < _localHandles->length(); i++) {
-    JNIHandles::destroy_global(_localHandles->at(i));
-  }
-  _localHandles->clear();
-}
-
-jlong VmIds::addStub(address stub) {
-  assert(!_stubs->contains(stub), "duplicate stub");
-  return _stubs->append(stub) | STUB;
-}
-
-jlong VmIds::add(Handle obj, jlong type) {
-  assert(!obj.is_null(), "cannot add NULL handle");
-  int idx = -1;
-  for (int i = 0; i < _localHandles->length(); i++)
-    if (JNIHandles::resolve_non_null(_localHandles->at(i)) == obj()) {
-      idx = i;
-      break;
-    }
-  if (idx == -1) {
-    if (JavaThread::current()->thread_state() == _thread_in_vm) {
-      idx = _localHandles->append(JNIHandles::make_global(obj));
-    } else {
-      VM_ENTRY_MARK;
-      idx = _localHandles->append(JNIHandles::make_global(obj));
-    }
-  }
-  return idx | type;
-}
-
-address VmIds::getStub(jlong id) {
-  assert((id & TYPE_MASK) == STUB, "wrong id type, STUB expected");
-  assert((id & ~TYPE_MASK) >= 0 && (id & ~TYPE_MASK) < _stubs->length(), "STUB index out of bounds");
-  return _stubs->at(id & ~TYPE_MASK);
-}
-
-oop VmIds::getObject(jlong id) {
-  assert((id & TYPE_MASK) != STUB, "wrong id type");
-  assert((id & ~TYPE_MASK) >= 0 && (id & ~TYPE_MASK) < _localHandles->length(), "index out of bounds");
-  return JNIHandles::resolve_non_null(_localHandles->at(id & ~TYPE_MASK));
-}
-
--- a/src/share/vm/c1x/c1x_VmIds.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "memory/allocation.hpp"
-#include "utilities/growableArray.hpp"
-#include "oops/oop.hpp"
-#include "runtime/handles.hpp"
-#include "runtime/thread.hpp"
-#include "classfile/javaClasses.hpp"
-#include "runtime/jniHandles.hpp"
-
-class VmIds : public AllStatic {
-
-private:
-  static GrowableArray<address>* _stubs;
-  static GrowableArray<jobject>* _localHandles;
-
-  static oop getObject(jlong id);
-
-public:
-  // these constants needs to have the same values as the one in HotSpotProxy.java
-  static const jlong STUB           = 0x100000000000000LL;        // address
-  static const jlong METHOD         = 0x200000000000000LL;        // methodOop
-  static const jlong CLASS          = 0x300000000000000LL;        // klassOop
-  static const jlong CONSTANT_POOL  = 0x500000000000000LL;        // constantPoolOop
-  static const jlong CONSTANT       = 0x600000000000000LL;        // oop
-  static const jlong TYPE_MASK      = 0xf00000000000000LL;
-  static const jlong DUMMY_CONSTANT = 0x6ffffffffffffffLL;
-
-  // Initializes the VmIds for a compilation, by creating the arrays
-  static void initializeObjects();
-  // Cleans up after a compilation, by deallocating the arrays
-  static void cleanupLocalObjects();
-
-  // Adds a stub address, and returns the corresponding vmId (which is of type STUB)
-  static jlong addStub(address stub);
-
-  // Adds an object, and returns the corresponding vmId (with the given type)
-  static jlong add(Handle obj, jlong type);
-
-  // Adds an object, and returns the corresponding vmId (the type of which is determined by the template parameter)
-  template <typename T> static jlong add(T obj);
-
-
-  // Returns the stub address with the given vmId
-  static address getStub(jlong id);
-  // Returns the stub address with the given vmId taken from a java.lang.Long
-  static address getStub(oop id);
-
-  // Returns the object with the given id, the return type is defined by the template parameter (which must correspond to the actual type of the vmId)
-  template <typename T> static T get(jlong id);
-
-
-  // Helper function to convert a symbol to a java.lang.String object
-  template <typename T> static T toString(Symbol* symbol, TRAPS);
-
-  // Helper function to convert a java.lang.String object to a symbol (this will return NULL if the symbol doesn't exist in the system)
-  static Symbol* toSymbol(jstring string);
-
-  // Helper function to get the contents of a java.lang.Long
-  static jlong getBoxedLong(oop obj);
-};
-
-
-template <> inline jlong VmIds::add<methodOop>(methodOop obj){
-  assert(obj != NULL, "trying to add NULL<methodOop>");
-  assert(obj->is_method(), "trying to add mistyped object");
-  return add(Handle(obj), METHOD);
-}
-template <> inline jlong VmIds::add<klassOop>(klassOop obj) {
-  assert(obj != NULL, "trying to add NULL<klassOop>");
-  assert(obj->is_klass(), "trying to add mistyped object");
-  return add(Handle(obj), CLASS);
-}
-template <> inline jlong VmIds::add<constantPoolOop>(constantPoolOop obj) {
-  assert(obj != NULL, "trying to add NULL<constantPoolOop>");
-  assert(obj->is_constantPool(), "trying to add mistyped object");
-  return add(Handle(obj), CONSTANT_POOL);
-}
-template <> inline jlong VmIds::add<oop>(oop obj) {
-  assert(obj != NULL, "trying to add NULL<oop>");
-  assert(obj->is_oop(), "trying to add mistyped object");
-  return add(Handle(obj), CONSTANT);
-}
-
-
-template <> inline methodOop VmIds::get<methodOop>(jlong id){
-  assert((id & TYPE_MASK) == METHOD, "METHOD expected");
-  assert(getObject(id)->is_method(), "methodOop expected");
-  return (methodOop)getObject(id);
-}
-template <> inline klassOop VmIds::get<klassOop>(jlong id) {
-  assert((id & TYPE_MASK) == CLASS, "CLASS expected");
-  assert(getObject(id)->is_klass(), "klassOop expected");
-  return (klassOop)getObject(id);
-}
-template <> inline constantPoolOop VmIds::get<constantPoolOop>(jlong id) {
-  assert((id & TYPE_MASK) == CONSTANT_POOL, "CONSTANT_POOL expected");
-  assert(getObject(id)->is_constantPool(), "constantPoolOop expected");
-  return (constantPoolOop)getObject(id);
-}
-template <> inline oop VmIds::get<oop>(jlong id) {
-  assert((id & TYPE_MASK) == CONSTANT, "CONSTANT expected");
-  assert(getObject(id)->is_oop(true), "oop expected");
-  return (oop)getObject(id);
-}
-
-inline address VmIds::getStub(oop obj) {
-  return getStub(getBoxedLong(obj));
-}
-
-template <> inline Handle VmIds::toString<Handle>(Symbol* symbol, TRAPS) {
-  return java_lang_String::create_from_symbol(symbol, THREAD);
-}
-template <> inline oop VmIds::toString<oop>(Symbol* symbol, TRAPS) {
-  return toString<Handle>(symbol, THREAD)();
-}
-template <> inline jstring VmIds::toString<jstring>(Symbol* symbol, TRAPS) {
-  return (jstring)JNIHandles::make_local(toString<oop>(symbol, THREAD));
-}
-template <> inline jobject VmIds::toString<jobject>(Symbol* symbol, TRAPS) {
-  return JNIHandles::make_local(toString<oop>(symbol, THREAD));
-}
-
-inline Symbol* VmIds::toSymbol(jstring string) {
-  return java_lang_String::as_symbol_or_null(JNIHandles::resolve(string));
-}
-
-inline jlong VmIds::getBoxedLong(oop obj) {
-  assert(obj->is_oop(true), "cannot unbox null or non-oop");
-  return obj->long_field(java_lang_boxing_object::value_offset_in_bytes(T_LONG));
-}
--- a/src/share/vm/ci/ciInstanceKlass.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/ci/ciInstanceKlass.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -64,7 +64,7 @@
   }
 
   Thread *thread = Thread::current();
-  if (ciObjectFactory::is_initialized() && !UseC1X) {
+  if (ciObjectFactory::is_initialized() && !UseGraal) {
     _loader = JNIHandles::make_local(thread, ik->class_loader());
     _protection_domain = JNIHandles::make_local(thread, ik->protection_domain());
     _is_shared = false;
--- a/src/share/vm/ci/ciObject.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/ci/ciObject.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -52,7 +52,7 @@
 ciObject::ciObject(oop o) {
   ASSERT_IN_VM;
   if (ciObjectFactory::is_initialized()) {
-    if (UseC1X) {
+    if (UseGraal) {
       _handle = JNIHandles::make_global(o);
       _temp_global = true;
     } else {
@@ -73,7 +73,7 @@
 ciObject::ciObject(Handle h) {
   ASSERT_IN_VM;
   if (ciObjectFactory::is_initialized()) {
-    if (UseC1X) {
+    if (UseGraal) {
       _handle = JNIHandles::make_global(h);
       _temp_global = true;
     } else {
--- a/src/share/vm/classfile/systemDictionary.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/classfile/systemDictionary.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -182,14 +182,14 @@
   template(Integer_klass,                java_lang_Integer,              Pre) \
   template(Long_klass,                   java_lang_Long,                 Pre) \
                                                                               \
-  template(C1XOptions_klass,             com_sun_c1x_C1XOptions,                                    Opt) \
-  template(HotSpotTypeResolved_klass,    com_sun_hotspot_c1x_HotSpotTypeResolved,                   Opt) \
-  template(HotSpotType_klass,            com_sun_hotspot_c1x_HotSpotType,                           Opt) \
-  template(HotSpotField_klass,           com_sun_hotspot_c1x_HotSpotField,                          Opt) \
-  template(HotSpotMethodResolved_klass,  com_sun_hotspot_c1x_HotSpotMethodResolved,                 Opt) \
-  template(HotSpotTargetMethod_klass,    com_sun_hotspot_c1x_HotSpotTargetMethod,                   Opt) \
-  template(HotSpotExceptionHandler_klass,com_sun_hotspot_c1x_HotSpotExceptionHandler,               Opt) \
-  template(HotSpotProxy_klass,           com_sun_hotspot_c1x_HotSpotProxy,                          Opt) \
+  template(graalOptions_klass,             com_sun_graal_graalOptions,                                    Opt) \
+  template(HotSpotTypeResolved_klass,    com_sun_hotspot_graal_HotSpotTypeResolved,                   Opt) \
+  template(HotSpotType_klass,            com_sun_hotspot_graal_HotSpotType,                           Opt) \
+  template(HotSpotField_klass,           com_sun_hotspot_graal_HotSpotField,                          Opt) \
+  template(HotSpotMethodResolved_klass,  com_sun_hotspot_graal_HotSpotMethodResolved,                 Opt) \
+  template(HotSpotTargetMethod_klass,    com_sun_hotspot_graal_HotSpotTargetMethod,                   Opt) \
+  template(HotSpotExceptionHandler_klass,com_sun_hotspot_graal_HotSpotExceptionHandler,               Opt) \
+  template(HotSpotProxy_klass,           com_sun_hotspot_graal_HotSpotProxy,                          Opt) \
   template(CiAssumptions_klass,          com_sun_cri_ci_CiAssumptions,                              Opt) \
   template(CiAssumptions_ConcreteSubtype_klass, com_sun_cri_ci_CiAssumptions_ConcreteSubtype,       Opt) \
   template(CiAssumptions_ConcreteMethod_klass,  com_sun_cri_ci_CiAssumptions_ConcreteMethod,        Opt) \
--- a/src/share/vm/classfile/vmSymbols.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -257,19 +257,19 @@
   NOT_LP64(  do_alias(machine_word_signature,         int_signature)  )                           \
   LP64_ONLY( do_alias(machine_word_signature,         long_signature) )                           \
                                                                                                                         \
-  /* support for C1X */                                                                                                 \
-  template(com_sun_hotspot_c1x_VMExits,               "com/oracle/max/graal/runtime/VMExits")                               \
-  template(com_sun_hotspot_c1x_HotSpotMethodResolved, "com/oracle/max/graal/runtime/HotSpotMethodResolved")                 \
-  template(com_sun_hotspot_c1x_HotSpotTargetMethod,   "com/oracle/max/graal/runtime/HotSpotTargetMethod")                   \
-  template(com_sun_hotspot_c1x_HotSpotField,          "com/oracle/max/graal/runtime/HotSpotField")                          \
-  template(com_sun_c1x_C1XOptions,                    "com/sun/c1x/C1XOptions")                                         \
-  template(com_sun_hotspot_c1x_HotSpotOptions,        "com/oracle/max/graal/runtime/HotSpotOptions")                        \
-  template(com_sun_hotspot_c1x_HotSpotTypeResolved,   "com/oracle/max/graal/runtime/HotSpotTypeResolvedImpl")               \
-  template(com_sun_hotspot_c1x_HotSpotType,           "com/oracle/max/graal/runtime/HotSpotType")                           \
-  template(com_sun_hotspot_c1x_HotSpotExceptionHandler,"com/oracle/max/graal/runtime/HotSpotExceptionHandler")              \
-  template(com_sun_hotspot_c1x_HotSpotProxy,          "com/oracle/max/graal/runtime/HotSpotProxy")                          \
-  template(com_sun_hotspot_c1x_Compiler,              "com/oracle/max/graal/runtime/Compiler")                              \
-  template(com_sun_hotspot_c1x_CompilerImpl,          "com/oracle/max/graal/runtime/CompilerImpl")                          \
+  /* support for graal */                                                                                                 \
+  template(com_sun_hotspot_graal_VMExits,               "com/oracle/max/graal/runtime/VMExits")                               \
+  template(com_sun_hotspot_graal_HotSpotMethodResolved, "com/oracle/max/graal/runtime/HotSpotMethodResolved")                 \
+  template(com_sun_hotspot_graal_HotSpotTargetMethod,   "com/oracle/max/graal/runtime/HotSpotTargetMethod")                   \
+  template(com_sun_hotspot_graal_HotSpotField,          "com/oracle/max/graal/runtime/HotSpotField")                          \
+  template(com_sun_graal_graalOptions,                    "com/sun/graal/graalOptions")                                         \
+  template(com_sun_hotspot_graal_HotSpotOptions,        "com/oracle/max/graal/runtime/HotSpotOptions")                        \
+  template(com_sun_hotspot_graal_HotSpotTypeResolved,   "com/oracle/max/graal/runtime/HotSpotTypeResolvedImpl")               \
+  template(com_sun_hotspot_graal_HotSpotType,           "com/oracle/max/graal/runtime/HotSpotType")                           \
+  template(com_sun_hotspot_graal_HotSpotExceptionHandler,"com/oracle/max/graal/runtime/HotSpotExceptionHandler")              \
+  template(com_sun_hotspot_graal_HotSpotProxy,          "com/oracle/max/graal/runtime/HotSpotProxy")                          \
+  template(com_sun_hotspot_graal_Compiler,              "com/oracle/max/graal/runtime/Compiler")                              \
+  template(com_sun_hotspot_graal_CompilerImpl,          "com/oracle/max/graal/runtime/CompilerImpl")                          \
   template(com_sun_cri_ri_RiMethod,                   "com/sun/cri/ri/RiMethod")                                        \
   template(com_sun_cri_ri_RiField,                    "com/sun/cri/ri/RiField")                                         \
   template(com_sun_cri_ri_RiType,                     "com/sun/cri/ri/RiType")                                          \
--- a/src/share/vm/code/codeBlob.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/code/codeBlob.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -352,7 +352,7 @@
 
   int _unpack_with_exception_in_tls;
 
-  // (tw) Offset when C1X calls uncommon_trap.
+  // (tw) Offset when graal calls uncommon_trap.
   int _uncommon_trap_offset;
   int _jmp_uncommon_trap_offset;
 
@@ -413,7 +413,7 @@
   }
   address unpack_with_exception_in_tls() const   { return code_begin() + _unpack_with_exception_in_tls; }
 
-  // (tw) Offset when C1X calls uncommon_trap.
+  // (tw) Offset when graal calls uncommon_trap.
   void set_uncommon_trap_offset(int offset) {
     _uncommon_trap_offset = offset;
     assert(contains(code_begin() + _uncommon_trap_offset), "must be PC inside codeblob");
--- a/src/share/vm/code/compiledIC.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/code/compiledIC.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -529,7 +529,7 @@
   NativeJump*        jump          = nativeJump_at(method_holder->next_instruction_address());
 
   assert(method_holder->data()    == 0           || method_holder->data()    == (intptr_t)callee(), "a) MT-unsafe modification of inline cache");
-  assert(UseC1X || jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, "b) MT-unsafe modification of inline cache");
+  assert(UseGraal || jump->jump_destination() == (address)-1 || jump->jump_destination() == entry, "b) MT-unsafe modification of inline cache");
 
   // Update stub
   method_holder->set_data((intptr_t)callee());
--- a/src/share/vm/code/nmethod.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/code/nmethod.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -818,8 +818,8 @@
     // Exception handler and deopt handler are in the stub section
     assert(offsets->value(CodeOffsets::Exceptions) != -1, "must be set");
     assert(offsets->value(CodeOffsets::Deopt     ) != -1, "must be set");
-    if (UseC1X) {
-      // c1x produces no (!) stub section
+    if (UseGraal) {
+      // graal produces no (!) stub section
       _exception_offset        = code_offset()          + offsets->value(CodeOffsets::Exceptions);
       _deoptimize_offset       = code_offset()          + offsets->value(CodeOffsets::Deopt);
       if (offsets->value(CodeOffsets::DeoptMH) != -1) {
@@ -2301,7 +2301,7 @@
         // information in a table.
         break;
     }
-    assert(UseC1X || stub == NULL || stub_contains(stub), "static call stub outside stub section");
+    assert(UseGraal || stub == NULL || stub_contains(stub), "static call stub outside stub section");
   }
 }
 
--- a/src/share/vm/code/nmethod.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/code/nmethod.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -591,9 +591,9 @@
   // Return true is the PC is one would expect if the frame is being deopted.
   bool is_deopt_pc      (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); }
 
-  // (tw) When using C1X, the address might be off by 5 (because this is the size of the call instruction.
+  // (tw) When using graal, the address might be off by 5 (because this is the size of the call instruction.
   // (tw) TODO: Replace this by a more general mechanism.
-  bool is_deopt_entry   (address pc) { return pc == deopt_handler_begin() || (UseC1X && pc == deopt_handler_begin() + 5); }
+  bool is_deopt_entry   (address pc) { return pc == deopt_handler_begin() || (UseGraal && pc == deopt_handler_begin() + 5); }
   bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); }
   // Accessor/mutator for the original pc of a frame before a frame was deopted.
   address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }
--- a/src/share/vm/compiler/compileBroker.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/compiler/compileBroker.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -44,7 +44,7 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/sweeper.hpp"
 #include "utilities/dtrace.hpp"
-#include "c1x/c1x_Compiler.hpp"
+#include "graal/graalCompiler.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Compiler.hpp"
 #endif
@@ -627,14 +627,14 @@
   }
 }
 
-// Bootstrap the C1X compiler. Compiles all methods until compile queue is empty and no compilation is active.
-void CompileBroker::bootstrap_c1x() {
+// Bootstrap the graal compiler. Compiles all methods until compile queue is empty and no compilation is active.
+void CompileBroker::bootstrap_graal() {
   HandleMark hm;
   Thread* THREAD = Thread::current();
-  tty->print_cr("Bootstrapping C1X....");
+  tty->print_cr("Bootstrapping graal....");
 
-  C1XCompiler* compiler = C1XCompiler::instance();
-  if (compiler == NULL) fatal("must use flag -XX:+UseC1X");
+  GraalCompiler* compiler = GraalCompiler::instance();
+  if (compiler == NULL) fatal("must use flag -XX:+UseGraal");
 
   jlong start = os::javaTimeMillis();
 
@@ -660,7 +660,7 @@
           if (current->is_Compiler_thread()) {
             CompilerThread* comp_thread = current->as_CompilerThread();
             if (comp_thread->is_compiling()) {
-              if (TraceC1X >= 4) {
+              if (Tracegraal >= 4) {
                 tty->print_cr("Compile queue empty, but following thread is still compiling:");
                 comp_thread->print();
               }
@@ -673,7 +673,7 @@
           break;
         }
       }
-      if (TraceC1X >= 5) {
+      if (Tracegraal >= 5) {
         _c1_method_queue->print();
       }
     }
@@ -707,8 +707,8 @@
   int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple);
   int c2_count = CompilationPolicy::policy()->compiler_count(CompLevel_full_optimization);
 #ifdef COMPILER1
-  if (UseC1X) {
-	  _compilers[0] = new C1XCompiler();
+  if (UseGraal) {
+	  _compilers[0] = new GraalCompiler();
   } else if (c1_count > 0) {
 	  _compilers[0] = new Compiler();
   }
@@ -1064,7 +1064,7 @@
 
     if (Thread::current()->is_Compiler_thread() && CompilerThread::current()->is_compiling() && !BackgroundCompilation) {
 
-      TRACE_C1X_1("Recursive compile %s!", method->name_and_sig_as_C_string());
+      TRACE_graal_1("Recursive compile %s!", method->name_and_sig_as_C_string());
       method->set_not_compilable();
       return;
     }
--- a/src/share/vm/compiler/compileBroker.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/compiler/compileBroker.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -402,7 +402,7 @@
 
   static void print_compiler_threads_on(outputStream* st);
 
-  static void bootstrap_c1x();
+  static void bootstrap_graal();
 };
 
 #endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,740 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "precompiled.hpp"
+#include "graal/graalCompiler.hpp"
+#include "graal/graalCodeInstaller.hpp"
+#include "graal/graalJavaAccess.hpp"
+#include "graal/graalVmIds.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "classfile/vmSymbols.hpp"
+#include "vmreg_x86.inline.hpp"
+
+
+// TODO this should be handled in a more robust way - not hard coded...
+Register CPU_REGS[] = { rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15 };
+bool OOP_ALLOWED[] = {true, true, true, true, false, false, true, true, true, true, false, true, true, true, true, true};
+const static int NUM_CPU_REGS = sizeof(CPU_REGS) / sizeof(Register);
+XMMRegister XMM_REGS[] = { xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 };
+const static int NUM_XMM_REGS = sizeof(XMM_REGS) / sizeof(XMMRegister);
+const static int NUM_REGS = NUM_CPU_REGS + NUM_XMM_REGS;
+const static jlong NO_REF_MAP = 0x8000000000000000L;
+
+// convert graal register indices (as used in oop maps) to hotspot registers
+VMReg get_hotspot_reg(jint graal_reg) {
+
+  assert(graal_reg >= 0 && graal_reg < NUM_REGS, "invalid register number");
+  if (graal_reg < NUM_CPU_REGS) {
+    return CPU_REGS[graal_reg]->as_VMReg();
+  } else {
+    return XMM_REGS[graal_reg - NUM_CPU_REGS]->as_VMReg();
+  }
+}
+
+static bool is_bit_set(oop bit_map, int i) {
+  const int MapWordBits = 64;
+  if (i < MapWordBits) {
+    jlong low = CiBitMap::low(bit_map);
+    return (low & (1LL << i)) != 0;
+  } else {
+    jint extra_idx = (i - MapWordBits) / MapWordBits;
+    arrayOop extra = (arrayOop) CiBitMap::extra(bit_map);
+    assert(extra_idx >= 0 && extra_idx < extra->length(), "unexpected index");
+    jlong word = ((jlong*) extra->base(T_LONG))[extra_idx];
+    return (word & (1LL << (i % MapWordBits))) != 0;
+  }
+}
+
+// creates a hotspot oop map out of the byte arrays provided by CiDebugInfo
+static OopMap* create_oop_map(jint frame_size, jint parameter_count, oop debug_info) {
+  OopMap* map = new OopMap(frame_size, parameter_count);
+  oop register_map = (oop) CiDebugInfo::registerRefMap(debug_info);
+  oop frame_map = (oop) CiDebugInfo::frameRefMap(debug_info);
+
+  if (register_map != NULL) {
+    assert(CiBitMap::size(register_map) == (unsigned) NUM_CPU_REGS, "unexpected register_map length");
+    for (jint i = 0; i < NUM_CPU_REGS; i++) {
+      bool is_oop = is_bit_set(register_map, i);
+      VMReg reg = get_hotspot_reg(i);
+      if (is_oop) {
+        assert(OOP_ALLOWED[i], "this register may never be an oop, register map misaligned?");
+        map->set_oop(reg);
+      } else {
+        map->set_value(reg);
+      }
+    }
+  }
+
+  if (frame_size > 0) {
+    assert(CiBitMap::size(frame_map) == frame_size / HeapWordSize, "unexpected frame_map length");
+
+    for (jint i = 0; i < frame_size / HeapWordSize; i++) {
+      bool is_oop = is_bit_set(frame_map, i);
+      // hotspot stack slots are 4 bytes
+      VMReg reg = VMRegImpl::stack2reg(i * 2);
+      if (is_oop) {
+        map->set_oop(reg);
+      } else {
+        map->set_value(reg);
+      }
+    }
+  } else {
+    assert(frame_map == NULL || CiBitMap::size(frame_map) == 0, "cannot have frame_map for frames with size 0");
+  }
+
+  return map;
+}
+
+// TODO: finish this - graal doesn't provide any scope values at the moment
+static ScopeValue* get_hotspot_value(oop value, int frame_size) {
+  if (value == CiValue::IllegalValue()) {
+    return new LocationValue(Location::new_stk_loc(Location::invalid, 0));
+  }
+
+  BasicType type = GraalCompiler::kindToBasicType(CiKind::typeChar(CiValue::kind(value)));
+  Location::Type locationType = Location::normal;
+  if (type == T_OBJECT || type == T_ARRAY) locationType = Location::oop;
+  if (value->is_a(CiRegisterValue::klass())) {
+    jint number = CiRegister::number(CiRegisterValue::reg(value));
+    if (number < 16) {
+      return new LocationValue(Location::new_reg_loc(locationType, as_Register(number)->as_VMReg()));
+    } else {
+      return new LocationValue(Location::new_reg_loc(locationType, as_XMMRegister(number - 16)->as_VMReg()));
+    }
+  } else if (value->is_a(CiStackSlot::klass())) {
+    jint index = CiStackSlot::index(value);
+    if (index >= 0) {
+      return new LocationValue(Location::new_stk_loc(locationType, index * HeapWordSize));
+    } else {
+      int frame_size_bytes = frame_size + 2 * HeapWordSize;
+      return new LocationValue(Location::new_stk_loc(locationType, -(index * HeapWordSize) + frame_size_bytes));
+    }
+  } else if (value->is_a(CiConstant::klass())){
+    oop obj = CiConstant::object(value);
+    jlong prim = CiConstant::primitive(value);
+    if (type == T_INT || type == T_FLOAT || type == T_SHORT || type == T_CHAR || type == T_BOOLEAN || type == T_BYTE) {
+      return new ConstantIntValue(*(jint*)&prim);
+    } else if (type == T_LONG || type == T_DOUBLE) {
+      return new ConstantLongValue(prim);
+    } else if (type == T_OBJECT) {
+      oop obj = CiConstant::object(value);
+      if (obj == NULL) {
+        return new ConstantOopWriteValue(NULL);
+      } else {
+        return new ConstantOopWriteValue(JNIHandles::make_global(obj));
+      }
+    } else if (type == T_ADDRESS) {
+      return new ConstantLongValue(prim);
+    }
+    tty->print("%i", type);
+  } else {
+    value->klass()->print();
+    value->print();
+  }
+  ShouldNotReachHere();
+  return NULL;
+}
+
+// constructor used to create a method
+CodeInstaller::CodeInstaller(Handle target_method) {
+  ciMethod *ciMethodObject = NULL;
+  {
+    No_Safepoint_Verifier no_safepoint;
+    _env = CURRENT_ENV;
+
+    initialize_fields(target_method);
+    assert(_hotspot_method != NULL && _name == NULL, "installMethod needs NON-NULL method and NULL name");
+    assert(_hotspot_method->is_a(HotSpotMethodResolved::klass()), "installMethod needs a HotSpotMethodResolved");
+
+    methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(_hotspot_method));
+    ciMethodObject = (ciMethod *) _env->get_object(method);
+    _parameter_count = method->size_of_parameters();
+  }
+
+  // (very) conservative estimate: each site needs a relocation
+  //CodeBuffer buffer("temp graal method", _total_size, _sites->length() * relocInfo::length_limit);
+  CodeBuffer buffer(CompilerThread::current()->get_buffer_blob());
+  initialize_buffer(buffer);
+  process_exception_handlers();
+
+  int stack_slots = (_frame_size / HeapWordSize) + 2; // conversion to words, need to add two slots for ret address and frame pointer
+  ThreadToNativeFromVM t((JavaThread*) Thread::current());
+  _env->register_method(ciMethodObject, -1, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
+      &_implicit_exception_table, GraalCompiler::instance(), _env->comp_level(), false, false);
+
+}
+
+// constructor used to create a stub
+CodeInstaller::CodeInstaller(Handle target_method, jlong& id) {
+  No_Safepoint_Verifier no_safepoint;
+  _env = CURRENT_ENV;
+
+  initialize_fields(target_method);
+  assert(_hotspot_method == NULL && _name != NULL, "installMethod needs NON-NULL name and NULL method");
+
+  // (very) conservative estimate: each site needs a relocation
+  CodeBuffer buffer(CompilerThread::current()->get_buffer_blob());
+  initialize_buffer(buffer);
+
+  const char* cname = java_lang_String::as_utf8_string(_name);
+  BufferBlob* blob = BufferBlob::create(strdup(cname), &buffer); // this is leaking strings... but only a limited number of stubs will be created
+  IF_TRACE_graal_3 Disassembler::decode((CodeBlob*) blob);
+  id = VmIds::addStub(blob->code_begin());
+}
+
+void CodeInstaller::initialize_fields(Handle target_method) {
+  _citarget_method = HotSpotTargetMethod::targetMethod(target_method);
+  _hotspot_method = HotSpotTargetMethod::method(target_method);
+  _name = HotSpotTargetMethod::name(target_method);
+  _sites = (arrayOop) HotSpotTargetMethod::sites(target_method);
+  oop assumptions = CiTargetMethod::assumptions(_citarget_method);
+  if (assumptions != NULL) {
+    _assumptions = (arrayOop) CiAssumptions::list(assumptions);
+  } else {
+    _assumptions = NULL;
+  }
+  _exception_handlers = (arrayOop) HotSpotTargetMethod::exceptionHandlers(target_method);
+
+  _code = (arrayOop) CiTargetMethod::targetCode(_citarget_method);
+  _code_size = CiTargetMethod::targetCodeSize(_citarget_method);
+  _frame_size = CiTargetMethod::frameSize(_citarget_method);
+  _custom_stack_area_offset = CiTargetMethod::customStackAreaOffset(_citarget_method);
+
+
+  // (very) conservative estimate: each site needs a constant section entry
+  _constants_size = _sites->length() * (BytesPerLong*2);
+  _total_size = align_size_up(_code_size, HeapWordSize) + _constants_size;
+
+  _next_call_type = MARK_INVOKE_INVALID;
+}
+
+// perform data and call relocation on the CodeBuffer
+void CodeInstaller::initialize_buffer(CodeBuffer& buffer) {
+  int locs_buffer_size = _sites->length() * (relocInfo::length_limit + sizeof(relocInfo));
+  char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size);
+  buffer.insts()->initialize_shared_locs((relocInfo*)locs_buffer, locs_buffer_size / sizeof(relocInfo));
+  buffer.initialize_stubs_size(256);
+  buffer.initialize_consts_size(_constants_size);
+
+  _oop_recorder = new OopRecorder(_env->arena());
+  _env->set_oop_recorder(_oop_recorder);
+  _debug_recorder = new DebugInformationRecorder(_env->oop_recorder());
+  _debug_recorder->set_oopmaps(new OopMapSet());
+  _dependencies = new Dependencies(_env);
+
+  _env->set_oop_recorder(_oop_recorder);
+  _env->set_debug_info(_debug_recorder);
+  _env->set_dependencies(_dependencies);
+  buffer.initialize_oop_recorder(_oop_recorder);
+
+  _instructions = buffer.insts();
+  _constants = buffer.consts();
+
+  // copy the code into the newly created CodeBuffer
+  memcpy(_instructions->start(), _code->base(T_BYTE), _code_size);
+  _instructions->set_end(_instructions->start() + _code_size);
+
+  oop* sites = (oop*) _sites->base(T_OBJECT);
+  for (int i = 0; i < _sites->length(); i++) {
+    oop site = sites[i];
+    jint pc_offset = CiTargetMethod_Site::pcOffset(site);
+
+    if (site->is_a(CiTargetMethod_Safepoint::klass())) {
+      TRACE_graal_4("safepoint at %i", pc_offset);
+      site_Safepoint(buffer, pc_offset, site);
+    } else if (site->is_a(CiTargetMethod_Call::klass())) {
+      TRACE_graal_4("call at %i", pc_offset);
+      site_Call(buffer, pc_offset, site);
+    } else if (site->is_a(CiTargetMethod_DataPatch::klass())) {
+      TRACE_graal_4("datapatch at %i", pc_offset);
+      site_DataPatch(buffer, pc_offset, site);
+    } else if (site->is_a(CiTargetMethod_Mark::klass())) {
+      TRACE_graal_4("mark at %i", pc_offset);
+      site_Mark(buffer, pc_offset, site);
+    } else {
+      fatal("unexpected Site subclass");
+    }
+  }
+
+
+  if (_assumptions != NULL) {
+    oop* assumptions = (oop*) _assumptions->base(T_OBJECT);
+    for (int i = 0; i < _assumptions->length(); ++i) {
+      oop assumption = assumptions[i];
+      if (assumption != NULL) {
+        if (assumption->is_a(CiAssumptions_ConcreteSubtype::klass())) {
+          assumption_ConcreteSubtype(assumption);
+        } else if (assumption->is_a(CiAssumptions_ConcreteMethod::klass())) {
+          assumption_ConcreteMethod(assumption);
+        } else {
+          fatal("unexpected Assumption subclass");
+        }
+      }
+    }
+  }
+}
+
+void CodeInstaller::assumption_ConcreteSubtype(oop assumption) {
+  oop context_oop = CiAssumptions_ConcreteSubtype::context(assumption);
+  oop type_oop = CiAssumptions_ConcreteSubtype::subtype(assumption);
+
+  ciKlass* context = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(context_oop)));
+  ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type_oop)));
+
+  _dependencies->assert_leaf_type(type);
+  if (context != type) {
+    assert(context->is_abstract(), "");
+    ThreadToNativeFromVM trans(JavaThread::current());
+    _dependencies->assert_abstract_with_unique_concrete_subtype(context, type);
+  }
+}
+
+void CodeInstaller::assumption_ConcreteMethod(oop assumption) {
+  oop context_oop = CiAssumptions_ConcreteMethod::context(assumption);
+  oop method_oop = CiAssumptions_ConcreteMethod::method(assumption);
+  jlong context_oop_id = HotSpotMethodResolved::vmId(context_oop);
+  jlong method_oop_id = HotSpotMethodResolved::vmId(method_oop);
+  methodOop method = VmIds::get<methodOop>(method_oop_id);
+  methodOop context = VmIds::get<methodOop>(context_oop_id);
+
+  ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method);
+  ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context);
+  ciKlass* context_klass = c->holder();
+  {
+    ThreadToNativeFromVM trans(JavaThread::current());
+    _dependencies->assert_unique_concrete_method(context_klass, m);
+  }
+}
+
+void CodeInstaller::process_exception_handlers() {
+  // allocate some arrays for use by the collection code.
+  const int num_handlers = 5;
+  GrowableArray<intptr_t>* bcis = new GrowableArray<intptr_t> (num_handlers);
+  GrowableArray<intptr_t>* scope_depths = new GrowableArray<intptr_t> (num_handlers);
+  GrowableArray<intptr_t>* pcos = new GrowableArray<intptr_t> (num_handlers);
+
+  if (_exception_handlers != NULL) {
+    oop* exception_handlers = (oop*) _exception_handlers->base(T_OBJECT);
+    for (int i = 0; i < _exception_handlers->length(); i++) {
+      jint pc_offset = CiTargetMethod_Site::pcOffset(exception_handlers[i]);
+      int start = i;
+      while ((i + 1) < _exception_handlers->length() && CiTargetMethod_Site::pcOffset(exception_handlers[i + 1]) == pc_offset)
+        i++;
+
+      // empty the arrays
+      bcis->trunc_to(0);
+      scope_depths->trunc_to(0);
+      pcos->trunc_to(0);
+
+      for (int j = start; j <= i; j++) {
+        oop exc = exception_handlers[j];
+        jint handler_offset = CiTargetMethod_ExceptionHandler::handlerPos(exc);
+        jint handler_bci = CiTargetMethod_ExceptionHandler::handlerBci(exc);
+        jint bci = CiTargetMethod_ExceptionHandler::bci(exc);
+        jint scope_level = CiTargetMethod_ExceptionHandler::scopeLevel(exc);
+        Handle handler_type = CiTargetMethod_ExceptionHandler::exceptionType(exc);
+
+        assert(handler_offset != -1, "must have been generated");
+
+        int e = bcis->find(handler_bci);
+        if (e >= 0 && scope_depths->at(e) == scope_level) {
+          // two different handlers are declared to dispatch to the same
+          // catch bci.  During parsing we created edges for each
+          // handler but we really only need one.  The exception handler
+          // table will also get unhappy if we try to declare both since
+          // it's nonsensical.  Just skip this handler.
+          continue;
+        }
+
+        bcis->append(handler_bci);
+        if (handler_bci == -1) {
+          // insert a wildcard handler at scope depth 0 so that the
+          // exception lookup logic with find it.
+          scope_depths->append(0);
+        } else {
+          scope_depths->append(scope_level);
+        }
+        pcos->append(handler_offset);
+
+        // stop processing once we hit a catch any
+        //        if (handler->is_catch_all()) {
+        //          assert(i == handlers->length() - 1, "catch all must be last handler");
+        //        }
+
+      }
+      _exception_handler_table.add_subtable(pc_offset, bcis, scope_depths, pcos);
+    }
+  }
+
+}
+
+void CodeInstaller::record_scope(jint pc_offset, oop code_pos) {
+  oop caller_pos = CiCodePos::caller(code_pos);
+  if (caller_pos != NULL) {
+    record_scope(pc_offset, caller_pos);
+  }
+  oop frame = NULL;
+  if (code_pos->klass()->klass_part()->name() == vmSymbols::com_sun_cri_ci_CiFrame()) {
+    frame = code_pos;
+  }
+
+  oop hotspot_method = CiCodePos::method(code_pos);
+  assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotMethodResolved::klass()), "unexpected hotspot method");
+  methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method));
+  ciMethod *cimethod = (ciMethod *) _env->get_object(method);
+  jint bci = CiCodePos::bci(code_pos);
+  bool reexecute;
+  if (bci == -1) {
+     reexecute = false;
+  } else {
+    Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci));
+    reexecute = Interpreter::bytecode_should_reexecute(code);
+  }
+
+  if (Tracegraal >= 2) {
+    tty->print_cr("Recording scope pc_offset=%d bci=%d frame=%d", pc_offset, bci, frame);
+  }
+
+  if (frame != NULL) {
+    jint local_count = CiFrame::numLocals(frame);
+    jint expression_count = CiFrame::numStack(frame);
+    jint monitor_count = CiFrame::numLocks(frame);
+    arrayOop values = (arrayOop) CiFrame::values(frame);
+
+    assert(local_count + expression_count + monitor_count == values->length(), "unexpected values length");
+
+    GrowableArray<ScopeValue*>* locals = new GrowableArray<ScopeValue*> ();
+    GrowableArray<ScopeValue*>* expressions = new GrowableArray<ScopeValue*> ();
+    GrowableArray<MonitorValue*>* monitors = new GrowableArray<MonitorValue*> ();
+
+    if (Tracegraal >= 2) {
+      tty->print_cr("Scope at bci %d with %d values", bci, values->length());
+      tty->print_cr("%d locals %d expressions, %d monitors", local_count, expression_count, monitor_count);
+    }
+
+    for (jint i = 0; i < values->length(); i++) {
+      ScopeValue* value = get_hotspot_value(((oop*) values->base(T_OBJECT))[i], _frame_size);
+
+      if (i < local_count) {
+        locals->append(value);
+      } else if (i < local_count + expression_count) {
+        expressions->append(value);
+      } else {
+        assert(value->is_location(), "invalid monitor location");
+        LocationValue* loc = (LocationValue*)value;
+        int monitor_offset = loc->location().stack_offset();
+        LocationValue* obj = new LocationValue(Location::new_stk_loc(Location::oop, monitor_offset + BasicObjectLock::obj_offset_in_bytes()));
+        monitors->append(new MonitorValue(obj, Location::new_stk_loc(Location::normal, monitor_offset  + BasicObjectLock::lock_offset_in_bytes())));
+      }
+    }
+    DebugToken* locals_token = _debug_recorder->create_scope_values(locals);
+    DebugToken* expressions_token = _debug_recorder->create_scope_values(expressions);
+    DebugToken* monitors_token = _debug_recorder->create_monitor_values(monitors);
+
+    _debug_recorder->describe_scope(pc_offset, cimethod, bci, reexecute, false, false, locals_token, expressions_token, monitors_token);
+  } else {
+    _debug_recorder->describe_scope(pc_offset, cimethod, bci, reexecute, false, false, NULL, NULL, NULL);
+  }
+}
+
+void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site) {
+  oop debug_info = CiTargetMethod_Safepoint::debugInfo(site);
+  assert(debug_info != NULL, "debug info expected");
+
+  // address instruction = _instructions->start() + pc_offset;
+  // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
+  _debug_recorder->add_safepoint(pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info));
+
+  oop code_pos = CiDebugInfo::codePos(debug_info);
+  record_scope(pc_offset, code_pos);
+
+  _debug_recorder->end_safepoint(pc_offset);
+}
+
+void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) {
+  oop runtime_call = CiTargetMethod_Call::runtimeCall(site);
+  oop hotspot_method = CiTargetMethod_Call::method(site);
+  oop symbol = CiTargetMethod_Call::symbol(site);
+  oop global_stub = CiTargetMethod_Call::globalStubID(site);
+
+  oop debug_info = CiTargetMethod_Call::debugInfo(site);
+
+  assert((runtime_call ? 1 : 0) + (hotspot_method ? 1 : 0) + (symbol ? 1 : 0) + (global_stub ? 1 : 0) == 1, "Call site needs exactly one type");
+
+  assert(NativeCall::instruction_size == (int)NativeJump::instruction_size, "unexpected size)");
+  jint next_pc_offset = pc_offset + NativeCall::instruction_size;
+
+  if (debug_info != NULL) {
+    _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info));
+    oop code_pos = CiDebugInfo::codePos(debug_info);
+    record_scope(next_pc_offset, code_pos);
+  }
+
+  if (runtime_call != NULL) {
+    NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
+    if (runtime_call == CiRuntimeCall::Debug()) {
+      TRACE_graal_3("CiRuntimeCall::Debug()");
+    } else if (runtime_call == CiRuntimeCall::UnwindException()) {
+      call->set_destination(Runtime1::entry_for(Runtime1::graal_unwind_exception_call_id));
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+      TRACE_graal_3("CiRuntimeCall::UnwindException()");
+    } else if (runtime_call == CiRuntimeCall::HandleException()) {
+      call->set_destination(Runtime1::entry_for(Runtime1::graal_handle_exception_id));
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+      TRACE_graal_3("CiRuntimeCall::HandleException()");
+    } else if (runtime_call == CiRuntimeCall::JavaTimeMillis()) {
+      call->set_destination((address)os::javaTimeMillis);
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+      TRACE_graal_3("CiRuntimeCall::JavaTimeMillis()");
+    } else if (runtime_call == CiRuntimeCall::JavaTimeNanos()) {
+      call->set_destination((address)os::javaTimeNanos);
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+      TRACE_graal_3("CiRuntimeCall::JavaTimeNanos()");
+    } else if (runtime_call == CiRuntimeCall::ArithmeticFrem()) {
+      call->set_destination(Runtime1::entry_for(Runtime1::graal_arithmetic_frem_id));
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+      TRACE_graal_3("CiRuntimeCall::ArithmeticFrem()");
+    } else if (runtime_call == CiRuntimeCall::ArithmeticDrem()) {
+      call->set_destination(Runtime1::entry_for(Runtime1::graal_arithmetic_drem_id));
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+      TRACE_graal_3("CiRuntimeCall::ArithmeticDrem()");
+    } else if (runtime_call == CiRuntimeCall::RegisterFinalizer()) {
+      call->set_destination(Runtime1::entry_for(Runtime1::register_finalizer_id));
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+    } else if (runtime_call == CiRuntimeCall::Deoptimize()) {
+      call->set_destination(SharedRuntime::deopt_blob()->uncommon_trap());
+      _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
+    } else {
+      runtime_call->print();
+      fatal("runtime_call not implemented");
+    }
+  } else if (global_stub != NULL) {
+    NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset);
+    assert(java_lang_boxing_object::is_instance(global_stub, T_LONG), "global_stub needs to be of type Long");
+
+    if (inst->is_call()) {
+      nativeCall_at((address)inst)->set_destination(VmIds::getStub(global_stub));
+    } else {
+      nativeJump_at((address)inst)->set_jump_destination(VmIds::getStub(global_stub));
+    }
+    _instructions->relocate((address)inst, runtime_call_Relocation::spec(), Assembler::call32_operand);
+    TRACE_graal_3("relocating (stub)  at %016x", inst);
+  } else if (symbol != NULL) {
+    fatal("symbol");
+  } else { // method != NULL
+    NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
+    assert(hotspot_method != NULL, "unexpected RiMethod");
+    assert(debug_info != NULL, "debug info expected");
+
+    methodOop method = NULL;
+    if (hotspot_method->is_a(HotSpotMethodResolved::klass())) method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method));
+
+    assert(debug_info != NULL, "debug info expected");
+
+    TRACE_graal_3("method call");
+    switch (_next_call_type) {
+      case MARK_INVOKEVIRTUAL:
+      case MARK_INVOKEINTERFACE: {
+        assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface");
+
+        call->set_destination(SharedRuntime::get_resolve_virtual_call_stub());
+        _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc), Assembler::call32_operand);
+        break;
+      }
+      case MARK_INVOKESTATIC: {
+        assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic");
+        call->set_destination(SharedRuntime::get_resolve_static_call_stub());
+        _instructions->relocate(call->instruction_address(), relocInfo::static_call_type, Assembler::call32_operand);
+        break;
+      }
+      case MARK_INVOKESPECIAL: {
+        assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial");
+
+        call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub());
+        _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type, Assembler::call32_operand);
+        break;
+      }
+      case MARK_INVOKE_INVALID:
+      default:
+        fatal("invalid _next_call_type value");
+        break;
+    }
+  }
+  _next_call_type = MARK_INVOKE_INVALID;
+  if (debug_info != NULL) {
+    _debug_recorder->end_safepoint(next_pc_offset);
+  }
+}
+
+void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) {
+  oop constant = CiTargetMethod_DataPatch::constant(site);
+  oop kind = CiConstant::kind(constant);
+
+  address instruction = _instructions->start() + pc_offset;
+
+  char typeChar = CiKind::typeChar(kind);
+  switch (typeChar) {
+    case 'z':
+    case 'b':
+    case 's':
+    case 'c':
+    case 'i':
+      fatal("int-sized values not expected in DataPatch")
+      ;
+      break;
+    case 'f':
+    case 'l':
+    case 'd': {
+      address operand = Assembler::locate_operand(instruction, Assembler::disp32_operand);
+      address next_instruction = Assembler::locate_next_instruction(instruction);
+      // we don't care if this is a long/double/etc., the primitive field contains the right bits
+      int size = _constants->size();
+      if (typeChar == 'd' || typeChar == 'l') {
+        size = _constants->align_at_start(size);
+      }
+      address dest = _constants->start() + size;
+      _constants->set_end(dest + BytesPerLong);
+      *(jlong*) dest = CiConstant::primitive(constant);
+
+      long disp = dest - next_instruction;
+      assert(disp == (jint) disp, "disp doesn't fit in 32 bits");
+      *((jint*) operand) = (jint) disp;
+
+      _instructions->relocate(instruction, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS), Assembler::disp32_operand);
+      TRACE_graal_3("relocating (%c) at %016x/%016x with destination at %016x (%d)", typeChar, instruction, operand, dest, size);
+      break;
+    }
+    case 'a': {
+      address operand = Assembler::locate_operand(instruction, Assembler::imm_operand);
+      Handle obj = CiConstant::object(constant);
+
+      if (obj->is_a(HotSpotTypeResolved::klass())) {
+        assert(!obj.is_null(), "");
+        *((jobject*) operand) = JNIHandles::make_local(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(obj)));
+        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
+        TRACE_graal_3("relocating (HotSpotType) at %016x/%016x", instruction, operand);
+      } else {
+        jobject value;
+        if (obj() == HotSpotProxy::DUMMY_CONSTANT_OBJ()) {
+          value = (jobject) Universe::non_oop_word();
+        } else {
+          value = JNIHandles::make_local(obj());
+        }
+        *((jobject*) operand) = value;
+        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
+        TRACE_graal_3("relocating (oop constant) at %016x/%016x", instruction, operand);
+      }
+      break;
+    }
+    default:
+      fatal("unexpected CiKind in DataPatch");
+      break;
+  }
+}
+
+void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, oop site) {
+  oop id_obj = CiTargetMethod_Mark::id(site);
+  arrayOop references = (arrayOop) CiTargetMethod_Mark::references(site);
+
+  if (id_obj != NULL) {
+    assert(java_lang_boxing_object::is_instance(id_obj, T_INT), "Integer id expected");
+    jint id = id_obj->int_field(java_lang_boxing_object::value_offset_in_bytes(T_INT));
+
+    address instruction = _instructions->start() + pc_offset;
+
+    switch (id) {
+      case MARK_UNVERIFIED_ENTRY:
+        _offsets.set_value(CodeOffsets::Entry, pc_offset);
+        break;
+      case MARK_VERIFIED_ENTRY:
+        _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset);
+        break;
+      case MARK_OSR_ENTRY:
+        _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset);
+        break;
+      case MARK_UNWIND_ENTRY:
+        _offsets.set_value(CodeOffsets::UnwindHandler, pc_offset);
+        break;
+      case MARK_EXCEPTION_HANDLER_ENTRY:
+        _offsets.set_value(CodeOffsets::Exceptions, pc_offset);
+        break;
+      case MARK_DEOPT_HANDLER_ENTRY:
+        _offsets.set_value(CodeOffsets::Deopt, pc_offset);
+        break;
+      case MARK_STATIC_CALL_STUB: {
+        assert(references->length() == 1, "static call stub needs one reference");
+        oop ref = ((oop*) references->base(T_OBJECT))[0];
+        address call_pc = _instructions->start() + CiTargetMethod_Site::pcOffset(ref);
+        _instructions->relocate(instruction, static_stub_Relocation::spec(call_pc));
+        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
+        break;
+      }
+      case MARK_INVOKE_INVALID:
+      case MARK_INVOKEINTERFACE:
+      case MARK_INVOKESTATIC:
+      case MARK_INVOKESPECIAL:
+      case MARK_INVOKEVIRTUAL:
+        _next_call_type = (MarkId) id;
+        _invoke_mark_pc = instruction;
+        break;
+      case MARK_IMPLICIT_NULL:
+        _implicit_exception_table.append(pc_offset, pc_offset);
+        break;
+      case MARK_KLASS_PATCHING:
+      case MARK_ACCESS_FIELD_PATCHING: {
+        unsigned char* byte_count = (unsigned char*) (instruction - 1);
+        unsigned char* byte_skip = (unsigned char*) (instruction - 2);
+        unsigned char* being_initialized_entry_offset = (unsigned char*) (instruction - 3);
+
+        assert(*byte_skip == 5, "unexpected byte_skip");
+
+        assert(references->length() == 2, "MARK_KLASS_PATCHING/MARK_ACCESS_FIELD_PATCHING needs 2 references");
+        oop ref1 = ((oop*) references->base(T_OBJECT))[0];
+        oop ref2 = ((oop*) references->base(T_OBJECT))[1];
+        int i_byte_count = CiTargetMethod_Site::pcOffset(ref2) - CiTargetMethod_Site::pcOffset(ref1);
+        assert(i_byte_count == (unsigned char)i_byte_count, "invalid offset");
+        *byte_count = i_byte_count;
+        *being_initialized_entry_offset = *byte_count + *byte_skip;
+
+        // we need to correct the offset of a field access - it's created with MAX_INT to ensure the correct size, and hotspot expects 0
+        if (id == MARK_ACCESS_FIELD_PATCHING) {
+          NativeMovRegMem* inst = nativeMovRegMem_at(_instructions->start() + CiTargetMethod_Site::pcOffset(ref1));
+          assert(inst->offset() == max_jint, "unexpected offset value");
+          inst->set_offset(0);
+        }
+        break;
+      }
+      case MARK_DUMMY_OOP_RELOCATION: {
+        _instructions->relocate(instruction, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
+
+        RelocIterator iter(_instructions, (address) instruction, (address) (instruction + 1));
+        relocInfo::change_reloc_info_for_address(&iter, (address) instruction, relocInfo::oop_type, relocInfo::none);
+        break;
+      }
+      default:
+        ShouldNotReachHere();
+        break;
+    }
+  }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalCodeInstaller.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This class handles the conversion from a CiTargetMethod to a CodeBlob or an nmethod.
+ */
+class CodeInstaller {
+private:
+  // these need to correspond to HotSpotXirGenerator.java
+  enum MarkId {
+    MARK_VERIFIED_ENTRY             = 0x0001,
+    MARK_UNVERIFIED_ENTRY           = 0x0002,
+    MARK_OSR_ENTRY                  = 0x0003,
+    MARK_UNWIND_ENTRY               = 0x0004,
+    MARK_EXCEPTION_HANDLER_ENTRY    = 0x0005,
+    MARK_DEOPT_HANDLER_ENTRY        = 0x0006,
+    MARK_STATIC_CALL_STUB           = 0x1000,
+    MARK_INVOKE_INVALID             = 0x2000,
+    MARK_INVOKEINTERFACE            = 0x2001,
+    MARK_INVOKESTATIC               = 0x2002,
+    MARK_INVOKESPECIAL              = 0x2003,
+    MARK_INVOKEVIRTUAL              = 0x2004,
+    MARK_IMPLICIT_NULL              = 0x3000,
+    MARK_KLASS_PATCHING             = 0x4000,
+    MARK_DUMMY_OOP_RELOCATION       = 0x4001,
+    MARK_ACCESS_FIELD_PATCHING      = 0x4002
+  };
+
+  ciEnv*        _env;
+
+  oop           _citarget_method;
+  oop           _hotspot_method;
+  oop           _name;
+  arrayOop      _sites;
+  arrayOop      _assumptions;
+  arrayOop      _exception_handlers;
+  CodeOffsets   _offsets;
+
+  arrayOop      _code;
+  jint          _code_size;
+  jint          _frame_size;
+  jint          _custom_stack_area_offset;
+  jint          _parameter_count;
+  jint          _constants_size;
+  jint          _total_size;
+
+  MarkId        _next_call_type;
+  address       _invoke_mark_pc;
+
+  CodeSection*  _instructions;
+  CodeSection*  _constants;
+
+  OopRecorder*              _oop_recorder;
+  DebugInformationRecorder* _debug_recorder;
+  Dependencies*             _dependencies;
+  ExceptionHandlerTable     _exception_handler_table;
+  ImplicitExceptionTable    _implicit_exception_table;
+
+public:
+
+  // constructor used to create a method
+  CodeInstaller(Handle target_method);
+
+  // constructor used to create a stub
+  CodeInstaller(Handle target_method, jlong& id);
+
+private:
+  // extract the fields of the CiTargetMethod
+  void initialize_fields(Handle target_method);
+
+  // perform data and call relocation on the CodeBuffer
+  void initialize_buffer(CodeBuffer& buffer);
+
+  void assumption_ConcreteSubtype(oop assumption);
+  void assumption_ConcreteMethod(oop assumption);
+
+  void site_Safepoint(CodeBuffer& buffer, jint pc_offset, oop site);
+  void site_Call(CodeBuffer& buffer, jint pc_offset, oop site);
+  void site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site);
+  void site_Mark(CodeBuffer& buffer, jint pc_offset, oop site);
+
+  void record_scope(jint pc_offset, oop code_pos);
+
+  void process_exception_handlers();
+
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalCompiler.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "precompiled.hpp"
+#include "graal/graalCompiler.hpp"
+#include "graal/graalJavaAccess.hpp"
+#include "graal/graalVMExits.hpp"
+#include "graal/graalVMEntries.hpp"
+#include "graal/graalVmIds.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "runtime/arguments.hpp"
+
+GraalCompiler* GraalCompiler::_instance = NULL;
+
+GraalCompiler::GraalCompiler() {
+  _initialized = false;
+  assert(_instance == NULL, "only one instance allowed");
+  _instance = this;
+}
+
+// Initialization
+void GraalCompiler::initialize() {
+  if (_initialized) return;
+  CompilerThread* THREAD = CompilerThread::current();
+  _initialized = true;
+  TRACE_graal_1("GraalCompiler::initialize");
+
+  VmIds::initializeObjects();
+
+  initialize_buffer_blob();
+  Runtime1::initialize(THREAD->get_buffer_blob());
+
+  JNIEnv *env = ((JavaThread *) Thread::current())->jni_environment();
+  jclass klass = env->FindClass("com/oracle/max/graal/runtime/VMEntriesNative");
+  if (klass == NULL) {
+    tty->print_cr("graal VMEntries class not found");
+    vm_abort(false);
+  }
+  env->RegisterNatives(klass, VMEntries_methods, VMEntries_methods_count());
+
+  {
+    VM_ENTRY_MARK;
+    check_pending_exception("Could not register natives");
+  }
+
+  graal_compute_offsets();
+
+  {
+    VM_ENTRY_MARK;
+    HandleMark hm;
+    VMExits::setDefaultOptions();
+    for (int i = 0; i < Arguments::num_graal_args(); ++i) {
+      const char* arg = Arguments::graal_args_array()[i];
+      Handle option = java_lang_String::create_from_str(arg, THREAD);
+      jboolean result = VMExits::setOption(option);
+      if (!result) {
+        tty->print_cr("Invalid option for graal!");
+        vm_abort(false);
+      }
+    }
+
+    VMExits::initializeCompiler();
+  }
+}
+
+void GraalCompiler::initialize_buffer_blob() {
+
+  CompilerThread* THREAD = CompilerThread::current();
+  if (THREAD->get_buffer_blob() == NULL) {
+    // setup CodeBuffer.  Preallocate a BufferBlob of size
+    // NMethodSizeLimit plus some extra space for constants.
+    int code_buffer_size = Compilation::desired_max_code_buffer_size() +
+      Compilation::desired_max_constant_size();
+    BufferBlob* blob = BufferBlob::create("graal temporary CodeBuffer",
+                                          code_buffer_size);
+    guarantee(blob != NULL, "must create code buffer");
+    THREAD->set_buffer_blob(blob);
+  }
+}
+
+// Compilation entry point for methods
+void GraalCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
+  initialize();
+  VM_ENTRY_MARK;
+  ResourceMark rm;
+  HandleMark hm;
+
+  initialize_buffer_blob();
+  VmIds::initializeObjects();
+
+  TRACE_graal_2("GraalCompiler::compile_method");
+
+  CompilerThread::current()->set_compiling(true);
+  methodOop method = (methodOop) target->get_oop();
+  VMExits::compileMethod(VmIds::add<methodOop>(method), VmIds::toString<Handle>(method->name(), THREAD), entry_bci);
+  CompilerThread::current()->set_compiling(false);
+
+  VmIds::cleanupLocalObjects();
+  TRACE_graal_2("GraalCompiler::compile_method exit");
+}
+
+// Print compilation timers and statistics
+void GraalCompiler::print_timers() {
+  TRACE_graal_1("GraalCompiler::print_timers");
+}
+
+oop GraalCompiler::get_RiType(ciType *type, KlassHandle accessor, TRAPS) {
+  if (type->is_loaded()) {
+    if (type->is_primitive_type()) {
+      return VMExits::createRiTypePrimitive((int) type->basic_type(), THREAD);
+    }
+    KlassHandle klass = (klassOop) type->get_oop();
+    Handle name = VmIds::toString<Handle>(klass->name(), THREAD);
+    return createHotSpotTypeResolved(klass, name, CHECK_NULL);
+  } else {
+    Symbol* name = ((ciKlass *) type)->name()->get_symbol();
+    return VMExits::createRiTypeUnresolved(VmIds::toString<Handle>(name, THREAD), THREAD);
+  }
+}
+
+oop GraalCompiler::get_RiField(ciField *field, ciInstanceKlass* accessor_klass, KlassHandle accessor, Bytecodes::Code byteCode, TRAPS) {
+  bool will_link = field->will_link_from_vm(accessor_klass, byteCode);
+  int offset = (field->holder()->is_loaded() && will_link) ? field->offset() : -1;
+  Handle field_name = VmIds::toString<Handle>(field->name()->get_symbol(), CHECK_0);
+  Handle field_holder = get_RiType(field->holder(), accessor, CHECK_0);
+  Handle field_type = get_RiType(field->type(), accessor, CHECK_0);
+  int flags = field->flags().as_int();
+  return VMExits::createRiField(field_holder, field_name, field_type, offset, flags, THREAD);
+}
+
+oop GraalCompiler::createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS) {
+  if (klass->graal_mirror() != NULL) {
+    return klass->graal_mirror();
+  }
+
+  instanceKlass::cast(HotSpotTypeResolved::klass())->initialize(CHECK_NULL);
+  Handle obj = instanceKlass::cast(HotSpotTypeResolved::klass())->allocate_instance(CHECK_NULL);
+  assert(obj() != NULL, "must succeed in allocating instance");
+
+  HotSpotTypeResolved::set_compiler(obj, VMExits::compilerInstance()());
+
+  if (klass->oop_is_instance()) {
+    instanceKlass* ik = (instanceKlass*)klass()->klass_part();
+    Handle full_name = java_lang_String::create_from_str(ik->signature_name(), CHECK_NULL);
+    HotSpotType::set_name(obj, full_name());
+  } else {
+    HotSpotType::set_name(obj, name());
+  }
+
+  HotSpotTypeResolved::set_javaMirror(obj, klass->java_mirror());
+  HotSpotTypeResolved::set_simpleName(obj, name());
+  HotSpotTypeResolved::set_accessFlags(obj, klass->access_flags().as_int());
+  HotSpotTypeResolved::set_isInterface(obj, klass->is_interface());
+  HotSpotTypeResolved::set_isInstanceClass(obj, klass->oop_is_instance());
+
+  if (klass->oop_is_javaArray()) {
+    HotSpotTypeResolved::set_isArrayClass(obj, true);
+    HotSpotTypeResolved::set_componentType(obj, NULL);
+  } else {
+    HotSpotTypeResolved::set_isArrayClass(obj, false);
+    HotSpotTypeResolved::set_componentType(obj, NULL);
+    HotSpotTypeResolved::set_isInitialized(obj, instanceKlass::cast(klass())->is_initialized());
+    HotSpotTypeResolved::set_instanceSize(obj, instanceKlass::cast(klass())->size_helper() * HeapWordSize);
+    HotSpotTypeResolved::set_hasFinalizer(obj, klass->has_finalizer());
+  }
+
+  // TODO replace these with correct values
+  HotSpotTypeResolved::set_hasSubclass(obj, false);
+  HotSpotTypeResolved::set_hasFinalizableSubclass(obj, false);
+
+  klass->set_graal_mirror(obj());
+
+  return obj();
+}
+
+BasicType GraalCompiler::kindToBasicType(jchar ch) {
+  switch(ch) {
+    case 'z': return T_BOOLEAN;
+    case 'b': return T_BYTE;
+    case 's': return T_SHORT;
+    case 'c': return T_CHAR;
+    case 'i': return T_INT;
+    case 'f': return T_FLOAT;
+    case 'l': return T_LONG;
+    case 'd': return T_DOUBLE;
+    case 'a': return T_OBJECT;
+    case 'r': return T_ADDRESS;
+    case '-': return T_ILLEGAL;
+    default:
+      fatal(err_msg("unexpected CiKind: %c", ch));
+      break;
+  }
+  return T_ILLEGAL;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalCompiler.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "compiler/abstractCompiler.hpp"
+
+class GraalCompiler : public AbstractCompiler {
+
+private:
+
+  bool                  _initialized;
+
+  static GraalCompiler*   _instance;
+
+public:
+
+  GraalCompiler();
+
+  static GraalCompiler* instance() { return _instance; }
+
+
+  virtual const char* name() { return "G"; }
+
+  // Native / OSR not supported
+  virtual bool supports_native()                 { return false; }
+  virtual bool supports_osr   ()                 { return false; }
+
+  // Pretend to be C1
+  bool is_c1   ()                                { return true; }
+  bool is_c2   ()                                { return false; }
+
+  // Initialization
+  virtual void initialize();
+
+  // Compilation entry point for methods
+  virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
+
+  // Print compilation timers and statistics
+  virtual void print_timers();
+
+  static oop get_RiType(ciType *klass, KlassHandle accessor, TRAPS);
+  static oop get_RiField(ciField *ciField, ciInstanceKlass* accessor_klass, KlassHandle accessor, Bytecodes::Code byteCode, TRAPS);
+
+  static oop createHotSpotTypeResolved(KlassHandle klass, Handle name, TRAPS);
+
+  static BasicType kindToBasicType(jchar ch);
+
+  static int to_cp_index_u2(int index) {
+    // Swap.
+    index = ((index & 0xFF) << 8) | (index >> 8);
+    // Tag.
+    index = index + constantPoolOopDesc::CPCACHE_INDEX_TAG;
+    return index;
+  }
+
+private:
+
+  void initialize_buffer_blob();
+};
+
+// Tracing macros
+
+#define IF_TRACE_graal_1 if (!(Tracegraal >= 1)) ; else
+#define IF_TRACE_graal_2 if (!(Tracegraal >= 2)) ; else
+#define IF_TRACE_graal_3 if (!(Tracegraal >= 3)) ; else
+#define IF_TRACE_graal_4 if (!(Tracegraal >= 4)) ; else
+#define IF_TRACE_graal_5 if (!(Tracegraal >= 5)) ; else
+
+// using commas and else to keep one-instruction semantics
+
+#define TRACE_graal_1 if (!(Tracegraal >= 1 && (tty->print("Tracegraal-1: "), true))) ; else tty->print_cr
+#define TRACE_graal_2 if (!(Tracegraal >= 2 && (tty->print("   Tracegraal-2: "), true))) ; else tty->print_cr
+#define TRACE_graal_3 if (!(Tracegraal >= 3 && (tty->print("      Tracegraal-3: "), true))) ; else tty->print_cr
+#define TRACE_graal_4 if (!(Tracegraal >= 4 && (tty->print("         Tracegraal-4: "), true))) ; else tty->print_cr
+#define TRACE_graal_5 if (!(Tracegraal >= 5 && (tty->print("            Tracegraal-5: "), true))) ; else tty->print_cr
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalJavaAccess.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "precompiled.hpp"
+#include "graal/graalJavaAccess.hpp"
+#include "runtime/jniHandles.hpp"
+#include "classfile/symbolTable.hpp"
+// This function is similar to javaClasses.cpp, it computes the field offset of a (static or instance) field.
+// It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded.
+
+static void compute_offset(int &dest_offset, klassOop klass_oop, const char* name, const char* signature, bool static_field) {
+  Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name));
+  Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature));
+#ifdef DEBUG
+  if (name_symbol == NULL) {
+    tty->print_cr("symbol with name %s was not found in symbol table (klass=%s)", name, klass_oop->klass_part()->name()->as_C_string());
+  }
+#endif
+  assert(name_symbol != NULL, "symbol not found - class layout changed?");
+  assert(signature_symbol != NULL, "symbol not found - class layout changed?");
+
+  instanceKlass* ik = instanceKlass::cast(klass_oop);
+  fieldDescriptor fd;
+  if (!ik->find_field(name_symbol, signature_symbol, &fd)) {
+    ResourceMark rm;
+    tty->print_cr("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name());
+    fatal("Invalid layout of preloaded class");
+  }
+  assert(fd.is_static() == static_field, "static/instance mismatch");
+  dest_offset = fd.offset();
+}
+
+// This piece of macro magic creates the contents of the graal_compute_offsets method that initializes the field indices of all the access classes.
+
+#define START_CLASS(name) { klassOop k = SystemDictionary::name##_klass(); assert(k != NULL, "Could not find class " #name "");
+
+#define END_CLASS }
+
+#define FIELD(klass, name, signature, static_field) compute_offset(klass::_##name##_offset, k, #name, signature, static_field);
+#define CHAR_FIELD(klass, name) FIELD(klass, name, "C", false)
+#define INT_FIELD(klass, name) FIELD(klass, name, "I", false)
+#define BOOLEAN_FIELD(klass, name) FIELD(klass, name, "Z", false)
+#define LONG_FIELD(klass, name) FIELD(klass, name, "J", false)
+#define OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, false)
+#define STATIC_OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, true)
+
+
+void graal_compute_offsets() {
+  COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, OOP_FIELD, STATIC_OOP_FIELD)
+}
+
+#define EMPTY0
+#define EMPTY1(x)
+#define EMPTY2(x,y)
+#define FIELD2(klass, name) int klass::_##name##_offset = 0;
+#define FIELD3(klass, name, sig) FIELD2(klass, name)
+
+COMPILER_CLASSES_DO(EMPTY1, EMPTY0, FIELD2, FIELD2, FIELD2, FIELD2, FIELD3, FIELD3)
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+void graal_compute_offsets();
+
+#include "classfile/systemDictionary.hpp"
+#include "oops/instanceMirrorKlass.hpp"
+
+/* This macro defines the structure of the CiTargetMethod - classes.
+ * It will generate classes with accessors similar to javaClasses.hpp, but with specializations for oops, Handles and jni handles.
+ *
+ * The public interface of these classes will look like this:
+
+ * class CiStackSlot : AllStatic {
+ * public:
+ *   static klassOop klass();
+ *   static jint  index(oop obj);
+ *   static jint  index(Handle obj);
+ *   static jint  index(jobject obj);
+ *   static void set_index(oop obj, jint x);
+ *   static void set_index(Handle obj, jint x);
+ *   static void set_index(jobject obj, jint x);
+ * };
+ *
+ */
+
+#define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, oop_field, static_oop_field)   \
+  start_class(HotSpotTypeResolved)                                                      \
+    oop_field(HotSpotTypeResolved, compiler, "Lcom/oracle/max/graal/runtime/Compiler;") \
+    oop_field(HotSpotTypeResolved, javaMirror, "Ljava/lang/Class;")                     \
+    oop_field(HotSpotTypeResolved, simpleName, "Ljava/lang/String;")                    \
+    int_field(HotSpotTypeResolved, accessFlags)                                         \
+    boolean_field(HotSpotTypeResolved, hasFinalizer)                                    \
+    boolean_field(HotSpotTypeResolved, hasSubclass)                                     \
+    boolean_field(HotSpotTypeResolved, hasFinalizableSubclass)                          \
+    boolean_field(HotSpotTypeResolved, isInitialized)                                   \
+    boolean_field(HotSpotTypeResolved, isArrayClass)                                    \
+    boolean_field(HotSpotTypeResolved, isInstanceClass)                                 \
+    boolean_field(HotSpotTypeResolved, isInterface)                                     \
+    int_field(HotSpotTypeResolved, instanceSize)                                        \
+    oop_field(HotSpotTypeResolved, componentType, "Lcom/sun/cri/ri/RiType;")            \
+  end_class                                                                             \
+  start_class(HotSpotType)                                                              \
+    oop_field(HotSpotType, name, "Ljava/lang/String;")                                  \
+  end_class                                                                             \
+  start_class(HotSpotField)                                                             \
+    oop_field(HotSpotField, constant, "Lcom/sun/cri/ci/CiConstant;")                    \
+  end_class                                                                             \
+  start_class(HotSpotMethodResolved)                                                    \
+    long_field(HotSpotMethodResolved, vmId)                                             \
+  end_class                                                                             \
+  start_class(HotSpotProxy)                                                             \
+    static_oop_field(HotSpotProxy, DUMMY_CONSTANT_OBJ, "Ljava/lang/Long;")              \
+  end_class                                                                             \
+  start_class(HotSpotTargetMethod)                                                      \
+    oop_field(HotSpotTargetMethod, targetMethod, "Lcom/sun/cri/ci/CiTargetMethod;")     \
+    oop_field(HotSpotTargetMethod, method, "Lcom/oracle/max/graal/runtime/HotSpotMethodResolved;") \
+    oop_field(HotSpotTargetMethod, name, "Ljava/lang/String;")                          \
+    oop_field(HotSpotTargetMethod, sites, "[Lcom/sun/cri/ci/CiTargetMethod$Site;")      \
+    oop_field(HotSpotTargetMethod, exceptionHandlers, "[Lcom/sun/cri/ci/CiTargetMethod$ExceptionHandler;") \
+  end_class                                                                             \
+  start_class(HotSpotExceptionHandler)                                                  \
+    int_field(HotSpotExceptionHandler, startBci)                                        \
+    int_field(HotSpotExceptionHandler, endBci)                                          \
+    int_field(HotSpotExceptionHandler, handlerBci)                                      \
+    int_field(HotSpotExceptionHandler, catchClassIndex)                                 \
+    oop_field(HotSpotExceptionHandler, catchClass, "Lcom/sun/cri/ri/RiType;")           \
+  end_class                                                                             \
+  start_class(CiTargetMethod)                                                           \
+    int_field(CiTargetMethod, frameSize)                                                \
+    int_field(CiTargetMethod, customStackAreaOffset)                                    \
+    oop_field(CiTargetMethod, targetCode, "[B")                                         \
+    oop_field(CiTargetMethod, assumptions, "Lcom/sun/cri/ci/CiAssumptions;")            \
+    int_field(CiTargetMethod, targetCodeSize)                                           \
+  end_class                                                                             \
+  start_class(CiAssumptions)                                                            \
+    oop_field(CiAssumptions, list, "[Lcom/sun/cri/ci/CiAssumptions$Assumption;")        \
+  end_class                                                                             \
+  start_class(CiAssumptions_ConcreteSubtype)                                            \
+    oop_field(CiAssumptions_ConcreteSubtype, context, "Lcom/sun/cri/ri/RiType;")        \
+    oop_field(CiAssumptions_ConcreteSubtype, subtype, "Lcom/sun/cri/ri/RiType;")        \
+  end_class                                                                             \
+  start_class(CiAssumptions_ConcreteMethod)                                             \
+    oop_field(CiAssumptions_ConcreteMethod, context, "Lcom/sun/cri/ri/RiMethod;")       \
+    oop_field(CiAssumptions_ConcreteMethod, method, "Lcom/sun/cri/ri/RiMethod;")        \
+  end_class                                                                             \
+  start_class(CiTargetMethod_Site)                                                      \
+    int_field(CiTargetMethod_Site, pcOffset)                                            \
+  end_class                                                                             \
+  start_class(CiTargetMethod_Call)                                                      \
+    oop_field(CiTargetMethod_Call, runtimeCall, "Lcom/sun/cri/ci/CiRuntimeCall;")       \
+    oop_field(CiTargetMethod_Call, method, "Lcom/sun/cri/ri/RiMethod;")                 \
+    oop_field(CiTargetMethod_Call, symbol, "Ljava/lang/String;")                        \
+    oop_field(CiTargetMethod_Call, globalStubID, "Ljava/lang/Object;")                  \
+    oop_field(CiTargetMethod_Call, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;")           \
+  end_class                                                                             \
+  start_class(CiTargetMethod_DataPatch)                                                 \
+    oop_field(CiTargetMethod_DataPatch, constant, "Lcom/sun/cri/ci/CiConstant;")        \
+  end_class                                                                             \
+  start_class(CiTargetMethod_Safepoint)                                                 \
+    oop_field(CiTargetMethod_Safepoint, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;")      \
+  end_class                                                                             \
+  start_class(CiTargetMethod_ExceptionHandler)                                          \
+    int_field(CiTargetMethod_ExceptionHandler, handlerPos)                              \
+    int_field(CiTargetMethod_ExceptionHandler, handlerBci)                              \
+    int_field(CiTargetMethod_ExceptionHandler, bci)                                     \
+    int_field(CiTargetMethod_ExceptionHandler, scopeLevel)                              \
+    oop_field(CiTargetMethod_ExceptionHandler, exceptionType, "Lcom/sun/cri/ri/RiType;")\
+  end_class                                                                             \
+  start_class(CiTargetMethod_Mark)                                                      \
+    oop_field(CiTargetMethod_Mark, id, "Ljava/lang/Object;")                            \
+    oop_field(CiTargetMethod_Mark, references, "[Lcom/sun/cri/ci/CiTargetMethod$Mark;") \
+  end_class                                                                             \
+  start_class(CiDebugInfo)                                                              \
+    oop_field(CiDebugInfo, codePos, "Lcom/sun/cri/ci/CiCodePos;")                       \
+    oop_field(CiDebugInfo, registerRefMap, "Lcom/sun/cri/ci/CiBitMap;")                 \
+    oop_field(CiDebugInfo, frameRefMap, "Lcom/sun/cri/ci/CiBitMap;")                    \
+  end_class                                                                             \
+  start_class(CiBitMap)                                                                 \
+    int_field(CiBitMap, size)                                                           \
+    long_field(CiBitMap, low)                                                           \
+    oop_field(CiBitMap, extra, "[J")                                                    \
+  end_class                                                                             \
+  start_class(CiFrame)                                                                  \
+    oop_field(CiFrame, values, "[Lcom/sun/cri/ci/CiValue;")                             \
+    int_field(CiFrame, numLocals)                                                       \
+    int_field(CiFrame, numStack)                                                        \
+    int_field(CiFrame, numLocks)                                                        \
+  end_class                                                                             \
+  start_class(CiCodePos)                                                                \
+    oop_field(CiCodePos, caller, "Lcom/sun/cri/ci/CiCodePos;")                          \
+    oop_field(CiCodePos, method, "Lcom/sun/cri/ri/RiMethod;")                           \
+    int_field(CiCodePos, bci)                                                           \
+  end_class                                                                             \
+  start_class(CiConstant)                                                               \
+    oop_field(CiConstant, kind, "Lcom/sun/cri/ci/CiKind;")                              \
+    oop_field(CiConstant, object, "Ljava/lang/Object;")                                 \
+    long_field(CiConstant, primitive)                                                   \
+  end_class                                                                             \
+  start_class(CiKind)                                                                   \
+    char_field(CiKind, typeChar)                                                        \
+    static_oop_field(CiKind, Boolean, "Lcom/sun/cri/ci/CiKind;");                       \
+    static_oop_field(CiKind, Byte, "Lcom/sun/cri/ci/CiKind;");                          \
+    static_oop_field(CiKind, Char, "Lcom/sun/cri/ci/CiKind;");                          \
+    static_oop_field(CiKind, Short, "Lcom/sun/cri/ci/CiKind;");                         \
+    static_oop_field(CiKind, Int, "Lcom/sun/cri/ci/CiKind;");                           \
+    static_oop_field(CiKind, Long, "Lcom/sun/cri/ci/CiKind;");                          \
+  end_class                                                                             \
+  start_class(CiRuntimeCall)                                                            \
+    static_oop_field(CiRuntimeCall, UnwindException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, RegisterFinalizer, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, HandleException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, OSRMigrationEnd, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, JavaTimeMillis, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, JavaTimeNanos, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, Debug, "Lcom/sun/cri/ci/CiRuntimeCall;");           \
+    static_oop_field(CiRuntimeCall, ArithmethicLrem, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, ArithmeticLdiv, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticFrem, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticDrem, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticCos, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticTan, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticLog, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticLog10, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, ArithmeticSin, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, Deoptimize, "Lcom/sun/cri/ci/CiRuntimeCall;");      \
+  end_class                                                                             \
+  start_class(RiMethod)                                                                 \
+  end_class                                                                             \
+  start_class(CiValue)                                                                  \
+    oop_field(CiValue, kind, "Lcom/sun/cri/ci/CiKind;")                                 \
+    static_oop_field(CiValue, IllegalValue, "Lcom/sun/cri/ci/CiValue;");                \
+  end_class                                                                             \
+  start_class(CiRegisterValue)                                                          \
+    oop_field(CiRegisterValue, reg, "Lcom/sun/cri/ci/CiRegister;")                      \
+  end_class                                                                             \
+  start_class(CiRegister)                                                               \
+    int_field(CiRegister, number)                                                       \
+  end_class                                                                             \
+  start_class(CiStackSlot)                                                              \
+    int_field(CiStackSlot, index)                                                       \
+  end_class                                                                             \
+  /* end*/
+
+
+
+
+#define START_CLASS(name)                       \
+  class name : AllStatic {                      \
+  private:                                      \
+    friend class GraalCompiler;                   \
+    static void check(oop obj) { assert(obj != NULL, "NULL field access of class " #name); assert(obj->is_a(SystemDictionary::name##_klass()), "wrong class, " #name " expected"); } \
+    static void compute_offsets();              \
+  public:                                       \
+    static klassOop klass() { return SystemDictionary::name##_klass(); }
+
+#define END_CLASS };
+
+#define FIELD(name, type, accessor)             \
+    static int _##name##_offset;                \
+    static type name(oop obj)                   { check(obj); return obj->accessor(_##name##_offset); } \
+    static type name(Handle obj)                { check(obj()); return obj->accessor(_##name##_offset); } \
+    static type name(jobject obj)               { check(JNIHandles::resolve(obj)); return JNIHandles::resolve(obj)->accessor(_##name##_offset); } \
+    static void set_##name(oop obj, type x)     { check(obj); obj->accessor##_put(_##name##_offset, x); } \
+    static void set_##name(Handle obj, type x)  { check(obj()); obj->accessor##_put(_##name##_offset, x); } \
+    static void set_##name(jobject obj, type x) { check(JNIHandles::resolve(obj)); JNIHandles::resolve(obj)->accessor##_put(_##name##_offset, x); }
+
+#define CHAR_FIELD(klass, name) FIELD(name, jchar, char_field)
+#define INT_FIELD(klass, name) FIELD(name, jint, int_field)
+#define BOOLEAN_FIELD(klass, name) FIELD(name, jboolean, bool_field)
+#define LONG_FIELD(klass, name) FIELD(name, jlong, long_field)
+#define OOP_FIELD(klass, name, signature) FIELD(name, oop, obj_field)
+#define STATIC_OOP_FIELD(klassName, name, signature)                \
+    static int _##name##_offset;                                    \
+    static oop name() {                                             \
+      instanceKlass* ik = instanceKlass::cast(klassName::klass());  \
+      address addr = ik->static_field_addr(_##name##_offset - instanceMirrorKlass::offset_of_static_fields());       \
+      if (UseCompressedOops) {                                      \
+        return oopDesc::load_decode_heap_oop((narrowOop *)addr);    \
+      } else {                                                      \
+        return oopDesc::load_decode_heap_oop((oop*)addr);           \
+      }                                                             \
+    }                                                               \
+    static void set_##name(oop x) {                                 \
+      instanceKlass* ik = instanceKlass::cast(klassName::klass());  \
+      address addr = ik->static_field_addr(_##name##_offset - instanceMirrorKlass::offset_of_static_fields());       \
+      if (UseCompressedOops) {                                      \
+        oopDesc::encode_store_heap_oop((narrowOop *)addr, x);       \
+      } else {                                                      \
+        oopDesc::encode_store_heap_oop((oop*)addr, x);              \
+      }                                                             \
+    }
+COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, OOP_FIELD, STATIC_OOP_FIELD)
+#undef START_CLASS
+#undef END_CLASS
+#undef FIELD
+#undef CHAR_FIELD
+#undef INT_FIELD
+#undef BOOLEAN_FIELD
+#undef LONG_FIELD
+#undef OOP_FIELD
+#undef STATIC_OOP_FIELD
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalVMEntries.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,710 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "precompiled.hpp"
+#include "graal/graalVMEntries.hpp"
+#include "graal/graalCompiler.hpp"
+#include "graal/graalJavaAccess.hpp"
+#include "graal/graalCodeInstaller.hpp"
+#include "graal/graalVMExits.hpp"
+#include "graal/graalVmIds.hpp"
+#include "c1/c1_Runtime1.hpp"
+#include "memory/oopFactory.hpp"
+
+// public byte[] RiMethod_code(long vmId);
+JNIEXPORT jbyteArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1code(JNIEnv *env, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_code");
+  methodHandle method = VmIds::get<methodOop>(vmId);
+  int code_size = method->code_size();
+  jbyteArray result = env->NewByteArray(code_size);
+  env->SetByteArrayRegion(result, 0, code_size, (const jbyte *) method->code_base());
+  return result;
+}
+
+// public int RiMethod_maxStackSize(long vmId);
+JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxStackSize(JNIEnv *, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_maxStackSize");
+  return VmIds::get<methodOop>(vmId)->max_stack();
+}
+
+// public int RiMethod_maxLocals(long vmId);
+JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxLocals(JNIEnv *, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_maxLocals");
+  return VmIds::get<methodOop>(vmId)->max_locals();
+}
+
+// public RiType RiMethod_holder(long vmId);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1holder(JNIEnv *, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_holder");
+  VM_ENTRY_MARK
+  KlassHandle klass = VmIds::get<methodOop>(vmId)->method_holder();
+  Handle name = VmIds::toString<Handle>(klass->name(), CHECK_NULL);
+  oop holder = GraalCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL);
+  return JNIHandles::make_local(THREAD, holder);
+}
+
+// public String RiMethod_signature(long vmId);
+JNIEXPORT jstring JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1signature(JNIEnv *env, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_signature");
+  VM_ENTRY_MARK
+  methodOop method = VmIds::get<methodOop>(vmId);
+  return VmIds::toString<jstring>(method->signature(), THREAD);
+}
+
+// public int RiMethod_accessFlags(long vmId);
+JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1accessFlags(JNIEnv *, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_accessFlags");
+  return VmIds::get<methodOop>(vmId)->access_flags().as_int();
+}
+
+// public RiExceptionHandler[] RiMethod_exceptionHandlers(long vmId);
+JNIEXPORT jobjectArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1exceptionHandlers(JNIEnv *, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_exceptionHandlers");
+  VM_ENTRY_MARK
+  methodHandle method = VmIds::get<methodOop>(vmId);
+  typeArrayHandle handlers = method->exception_table();
+  int handler_count = handlers.is_null() ? 0 : handlers->length() / 4;
+
+  instanceKlass::cast(HotSpotExceptionHandler::klass())->initialize(CHECK_NULL);
+  objArrayHandle array = oopFactory::new_objArray(SystemDictionary::RiExceptionHandler_klass(), handler_count, CHECK_NULL);
+
+  for (int i = 0; i < handler_count; i++) {
+    // exception handlers are stored as four integers: start bci, end bci, handler bci, catch class constant pool index
+    int base = i * 4;
+    Handle entry = instanceKlass::cast(HotSpotExceptionHandler::klass())->allocate_instance(CHECK_NULL);
+    HotSpotExceptionHandler::set_startBci(entry, handlers->int_at(base + 0));
+    HotSpotExceptionHandler::set_endBci(entry, handlers->int_at(base + 1));
+    HotSpotExceptionHandler::set_handlerBci(entry, handlers->int_at(base + 2));
+    int catch_class_index = handlers->int_at(base + 3);
+    HotSpotExceptionHandler::set_catchClassIndex(entry, catch_class_index);
+
+    if (catch_class_index == 0) {
+      HotSpotExceptionHandler::set_catchClass(entry, NULL);
+    } else {
+      constantPoolOop cp = instanceKlass::cast(method->method_holder())->constants();
+      ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(method->method_holder());
+      bool is_accessible = false;
+      ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, catch_class_index, is_accessible, loading_klass);
+      oop catch_class = GraalCompiler::get_RiType(klass, method->method_holder(), CHECK_NULL);
+
+      HotSpotExceptionHandler::set_catchClass(entry, catch_class);
+    }
+    array->obj_at_put(i, entry());
+  }
+
+  return (jobjectArray) JNIHandles::make_local(array());
+}
+
+// public boolean RiMethod_hasBalancedMonitors(long vmId);
+JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1hasBalancedMonitors(JNIEnv *, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_hasBalancedMonitors");
+  ciMethod* cimethod;
+  {
+    VM_ENTRY_MARK;
+    cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId));
+  }
+  return cimethod->has_balanced_monitors();
+}
+
+// public boolean RiMethod_uniqueConcreteMethod(long vmId);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1uniqueConcreteMethod(JNIEnv *, jobject, jlong vmId) {
+  TRACE_graal_3("VMEntries::RiMethod_uniqueConcreteMethod");
+  VM_ENTRY_MARK;
+  ciMethod* cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId));
+  if (cimethod->holder()->is_interface()) {
+    // Cannot trust interfaces. Because of:
+    // interface I { void foo(); }
+    // class A { public void foo() {} }
+    // class B extends A implements I { }
+    // class C extends B { public void foo() { } }
+    // class D extends B { }
+    // Would lead to identify C.foo() as the unique concrete method for I.foo() without seeing A.foo().
+    return false;
+  }
+  klassOop klass = (klassOop)cimethod->holder()->get_oop();
+  methodHandle method((methodOop)cimethod->get_oop());
+  methodHandle unique_concrete;
+  {
+    ResourceMark rm;
+    MutexLocker locker(Compile_lock);
+    unique_concrete = methodHandle(Dependencies::find_unique_concrete_method(klass, method()));
+  }
+  if (unique_concrete.is_null()) {
+    return NULL;
+  }
+
+  Handle name = VmIds::toString<Handle>(unique_concrete->name(), CHECK_NULL);
+  oop method_resolved = VMExits::createRiMethodResolved(VmIds::add<methodOop>(unique_concrete()), name, CHECK_NULL);
+  return JNIHandles::make_local(THREAD, method_resolved);
+}
+
+// public RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiSignature_1lookupType(JNIEnv *env, jobject, jstring jname, jobject accessingClass) {
+  TRACE_graal_3("VMEntries::RiSignature_lookupType");
+  VM_ENTRY_MARK;
+
+  Symbol* nameSymbol = VmIds::toSymbol(jname);
+  Handle name = JNIHandles::resolve(jname);
+
+  oop result;
+  if (nameSymbol == vmSymbols::int_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_INT, THREAD);
+  } else if (nameSymbol == vmSymbols::long_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_LONG, THREAD);
+  } else if (nameSymbol == vmSymbols::bool_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_BOOLEAN, THREAD);
+  } else if (nameSymbol == vmSymbols::char_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_CHAR, THREAD);
+  } else if (nameSymbol == vmSymbols::short_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_SHORT, THREAD);
+  } else if (nameSymbol == vmSymbols::byte_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_BYTE, THREAD);
+  } else if (nameSymbol == vmSymbols::double_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_DOUBLE, THREAD);
+  } else if (nameSymbol == vmSymbols::float_signature()) {
+    result = VMExits::createRiTypePrimitive((int) T_FLOAT, THREAD);
+  } else {
+    klassOop resolved_type = NULL;
+    // if the name isn't in the symbol table then the class isn't loaded anyway...
+    if (nameSymbol != NULL) {
+      Handle classloader;
+      Handle protectionDomain;
+      if (JNIHandles::resolve(accessingClass) != NULL) {
+        classloader = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->class_loader();
+        protectionDomain = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->protection_domain();
+      }
+      resolved_type = SystemDictionary::resolve_or_null(nameSymbol, classloader, protectionDomain, THREAD);
+      if (HAS_PENDING_EXCEPTION) {
+        CLEAR_PENDING_EXCEPTION;
+        resolved_type = NULL;
+      }
+    }
+    if (resolved_type != NULL) {
+      result = GraalCompiler::createHotSpotTypeResolved(resolved_type, name, CHECK_NULL);
+    } else {
+      result = VMExits::createRiTypeUnresolved(name, THREAD);
+    }
+  }
+
+  return JNIHandles::make_local(THREAD, result);
+}
+
+// public Object RiConstantPool_lookupConstant(long vmId, int cpi);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupConstant(JNIEnv *env, jobject, jlong vmId, jint index) {
+  TRACE_graal_3("VMEntries::RiConstantPool_lookupConstant");
+  VM_ENTRY_MARK;
+
+  constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
+
+  oop result = NULL;
+  constantTag tag = cp->tag_at(index);
+  if (tag.is_int()) {
+    result = VMExits::createCiConstant(CiKind::Int(), cp->int_at(index), CHECK_0);
+  } else if (tag.is_long()) {
+    result = VMExits::createCiConstant(CiKind::Long(), cp->long_at(index), CHECK_0);
+  } else if (tag.is_float()) {
+    result = VMExits::createCiConstantFloat(cp->float_at(index), CHECK_0);
+  } else if (tag.is_double()) {
+    result = VMExits::createCiConstantDouble(cp->double_at(index), CHECK_0);
+  } else if (tag.is_string() || tag.is_unresolved_string()) {
+    oop string = NULL;
+    if (cp->is_pseudo_string_at(index)) {
+      string = cp->pseudo_string_at(index);
+    } else {
+      string = cp->string_at(index, THREAD);
+      if (HAS_PENDING_EXCEPTION) {
+        CLEAR_PENDING_EXCEPTION;
+        // TODO: Gracefully exit compilation.
+        fatal("out of memory during compilation!");
+        return NULL;
+      }
+    }
+    result = VMExits::createCiConstantObject(string, CHECK_0);
+  } else if (tag.is_klass() || tag.is_unresolved_klass()) {
+    bool ignore;
+    ciInstanceKlass* accessor = (ciInstanceKlass*) ciEnv::current()->get_object(cp->pool_holder());
+    ciKlass* klass = ciEnv::current()->get_klass_by_index(cp, index, ignore, accessor);
+    result = GraalCompiler::get_RiType(klass, cp->pool_holder(), CHECK_NULL);
+  } else if (tag.is_object()) {
+    oop obj = cp->object_at(index);
+    assert(obj->is_instance(), "must be an instance");
+    result = VMExits::createCiConstantObject(obj, CHECK_NULL);
+  } else {
+    ShouldNotReachHere();
+  }
+
+  return JNIHandles::make_local(THREAD, result);
+}
+
+// public RiMethod RiConstantPool_lookupMethod(long vmId, int cpi, byte byteCode);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) {
+  TRACE_graal_3("VMEntries::RiConstantPool_lookupMethod");
+  VM_ENTRY_MARK;
+
+  index = GraalCompiler::to_cp_index_u2(index);
+  constantPoolHandle cp = VmIds::get<constantPoolOop>(vmId);
+
+  Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF);
+  ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
+  ciMethod *cimethod = CURRENT_ENV->get_method_by_index(cp, index, bc, loading_klass);
+  if (cimethod->is_loaded()) {
+    methodOop method = (methodOop) cimethod->get_oop();
+    Handle name = VmIds::toString<Handle>(method->name(), CHECK_NULL);
+    return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), name, THREAD));
+  } else {
+    Handle name = VmIds::toString<Handle>(cimethod->name()->get_symbol(), CHECK_NULL);
+    Handle signature = VmIds::toString<Handle>(cimethod->signature()->as_symbol()->get_symbol(), CHECK_NULL);
+    Handle holder = GraalCompiler::get_RiType(cimethod->holder(), cp->klass(), THREAD);
+    return JNIHandles::make_local(THREAD, VMExits::createRiMethodUnresolved(name, signature, holder, THREAD));
+  }
+}
+
+// public RiSignature RiConstantPool_lookupSignature(long vmId, int cpi);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupSignature(JNIEnv *env, jobject, jlong vmId, jint index) {
+  fatal("currently unsupported");
+  return NULL;
+}
+
+// public RiType RiConstantPool_lookupType(long vmId, int cpi);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupType(JNIEnv *env, jobject, jlong vmId, jint index) {
+  TRACE_graal_3("VMEntries::RiConstantPool_lookupType");
+  VM_ENTRY_MARK;
+
+  constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
+
+  ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
+  bool is_accessible = false;
+  ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, index, is_accessible, loading_klass);
+  return JNIHandles::make_local(THREAD, GraalCompiler::get_RiType(klass, cp->klass(), THREAD));
+}
+
+// public RiField RiConstantPool_lookupField(long vmId, int cpi);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupField(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) {
+  TRACE_graal_3("VMEntries::RiConstantPool_lookupField");
+  VM_ENTRY_MARK;
+
+  index = GraalCompiler::to_cp_index_u2(index);
+  constantPoolOop cp = VmIds::get<constantPoolOop>(vmId);
+
+  ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());
+  ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index);
+  
+  Bytecodes::Code code = (Bytecodes::Code)(((int) byteCode) & 0xFF);
+  Handle field_handle = GraalCompiler::get_RiField(field, loading_klass, cp->pool_holder(), code, THREAD);
+  bool is_constant = field->is_constant();
+  if (is_constant && field->is_static()) {
+    ciConstant constant = field->constant_value();
+    oop constant_object = NULL;
+    switch (constant.basic_type()) {
+      case T_OBJECT:
+      case T_ARRAY:
+        {
+          ciObject* obj = constant.as_object();
+          if (obj->is_null_object()) {
+            constant_object = VMExits::createCiConstantObject(NULL, CHECK_0);
+          } else if (obj->can_be_constant()) {
+            constant_object = VMExits::createCiConstantObject(constant.as_object()->get_oop(), CHECK_0);
+          }
+        }
+        break;
+      case T_DOUBLE:
+        constant_object = VMExits::createCiConstantDouble(constant.as_double(), CHECK_0);
+        break;
+      case T_FLOAT:
+        constant_object = VMExits::createCiConstantFloat(constant.as_float(), CHECK_0);
+        break;
+      case T_LONG:
+        constant_object = VMExits::createCiConstant(CiKind::Long(), constant.as_long(), CHECK_0);
+        break;
+      case T_INT:
+        constant_object = VMExits::createCiConstant(CiKind::Int(), constant.as_int(), CHECK_0);
+        break;
+      case T_SHORT:
+        constant_object = VMExits::createCiConstant(CiKind::Short(), constant.as_int(), CHECK_0);
+        break;
+      case T_CHAR:
+        constant_object = VMExits::createCiConstant(CiKind::Char(), constant.as_int(), CHECK_0);
+        break;
+      case T_BYTE:
+        constant_object = VMExits::createCiConstant(CiKind::Byte(), constant.as_int(), CHECK_0);
+        break;
+      case T_BOOLEAN:
+        constant_object = VMExits::createCiConstant(CiKind::Boolean(), constant.as_int(), CHECK_0);
+        break;
+      default:
+        constant.print();
+        fatal("Unhandled constant");
+    }
+    if (constant_object != NULL) {
+      HotSpotField::set_constant(field_handle, constant_object);
+    }
+  }
+  return JNIHandles::make_local(THREAD, field_handle());
+}
+
+// public RiConstantPool RiType_constantPool(HotSpotTypeResolved klass);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1constantPool(JNIEnv *, jobject, jobject klass) {
+  TRACE_graal_3("VMEntries::RiType_constantPool");
+  VM_ENTRY_MARK;
+
+  assert(JNIHandles::resolve(klass) != NULL, "");
+  constantPoolOop constantPool = ((instanceKlass*)java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))->klass_part())->constants();
+  return JNIHandles::make_local(VMExits::createRiConstantPool(VmIds::add<constantPoolOop>(constantPool), THREAD));
+}
+
+// public RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_3resolveMethodImpl(JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature) {
+  TRACE_graal_3("VMEntries::RiType_resolveMethodImpl");
+  VM_ENTRY_MARK;
+
+  assert(JNIHandles::resolve(resolved_type) != NULL, "");
+  klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(resolved_type));
+  Symbol* name_symbol = VmIds::toSymbol(name);
+  Symbol* signature_symbol = VmIds::toSymbol(signature);
+  methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol);
+  if (method == NULL) {
+    if (Tracegraal >= 3) {
+      ResourceMark rm;
+      tty->print_cr("Could not resolve method %s %s on klass %s", name_symbol->as_C_string(), signature_symbol->as_C_string(), klass->klass_part()->name()->as_C_string());
+    }
+    return NULL;
+  }
+  return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), Handle(JNIHandles::resolve(name)), THREAD));
+}
+
+// public boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
+JNIEXPORT jboolean JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_2isSubtypeOf(JNIEnv *, jobject, jobject klass, jobject jother) {
+  TRACE_graal_3("VMEntries::RiType_isSubtypeOf");
+  oop other = JNIHandles::resolve(jother);
+  assert(other->is_a(HotSpotTypeResolved::klass()), "resolved hotspot type expected");
+  assert(JNIHandles::resolve(klass) != NULL, "");
+  klassOop thisKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass));
+  klassOop otherKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(other));
+  if (thisKlass->klass_part()->oop_is_instance_slow()) {
+    return instanceKlass::cast(thisKlass)->is_subtype_of(otherKlass);
+  } else if (thisKlass->klass_part()->oop_is_array()) {
+    return arrayKlass::cast(thisKlass)->is_subtype_of(otherKlass);
+  } else {
+    fatal("unexpected class type");
+    return false;
+  }
+}
+
+// public RiType RiType_componentType(HotSpotResolvedType klass);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1componentType(JNIEnv *, jobject, jobject klass) {
+  TRACE_graal_3("VMEntries::RiType_componentType");
+  ciArrayKlass* array_klass;
+  {
+    VM_ENTRY_MARK;
+    assert(JNIHandles::resolve(klass) != NULL, "");
+    array_klass = (ciArrayKlass *) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
+  }
+  ciType* element_type = array_klass->element_type();
+
+  VM_ENTRY_MARK;
+  assert(JNIHandles::resolve(klass) != NULL, "");
+  return JNIHandles::make_local(GraalCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD));
+}
+
+// public RiType RiType_superType(HotSpotResolvedType klass);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1superType(JNIEnv *, jobject, jobject klass) {
+  TRACE_graal_3("VMEntries::RiType_superType");
+  VM_ENTRY_MARK;
+  KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
+  ciInstanceKlass* k = NULL;
+
+  if (klass_handle->oop_is_array()) {
+    k = (ciInstanceKlass *) CURRENT_ENV->get_object(SystemDictionary::Object_klass());
+  } else {
+    guarantee(klass_handle->oop_is_instance(), "must be instance klass");  
+    k = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle());
+    k = k->super();
+  }
+
+  if (k != NULL) {
+    return JNIHandles::make_local(GraalCompiler::get_RiType(k, klass_handle, THREAD));
+  } else {
+    return NULL;
+  }
+}
+
+// public RiType RiType_uniqueConcreteSubtype(HotSpotResolvedType klass);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1uniqueConcreteSubtype(JNIEnv *, jobject, jobject klass) {
+  TRACE_graal_3("VMEntries::RiType_uniqueConcreteSubtype");
+  Thread* THREAD = Thread::current();
+  KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
+  ciInstanceKlass* k = NULL;
+  {
+    VM_ENTRY_MARK;
+    k = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle());
+  }
+
+  if (k->is_abstract()) {
+    ciInstanceKlass* sub = k->unique_concrete_subklass();
+    if (sub != NULL && sub->is_leaf_type()) {
+      VM_ENTRY_MARK;
+      return JNIHandles::make_local(GraalCompiler::get_RiType(sub, klass_handle, THREAD));
+    }
+  } else if (k->is_leaf_type()) {
+    assert(!k->is_interface(), "");
+    return klass;
+  }
+
+  return NULL;
+}
+
+// public RiType RiType_arrayOf(HotSpotTypeResolved klass);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jobject klass) {
+  TRACE_graal_3("VMEntries::RiType_arrayOf");
+  VM_ENTRY_MARK;
+
+  KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)));
+  KlassHandle array = klass_handle->array_klass(THREAD);
+  Handle name = VmIds::toString<Handle>(array->name(), CHECK_NULL);
+  return JNIHandles::make_local(THREAD, GraalCompiler::createHotSpotTypeResolved(array, name, THREAD));
+}
+
+// public RiType getPrimitiveArrayType(CiKind kind);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getPrimitiveArrayType(JNIEnv *env, jobject, jobject kind) {
+  TRACE_graal_3("VMEntries::VMEntries_getPrimitiveArrayType");
+  VM_ENTRY_MARK;
+  BasicType type = GraalCompiler::kindToBasicType(CiKind::typeChar(kind));
+  assert(type != T_OBJECT, "primitive type expecteds");
+  ciKlass* klass = ciTypeArrayKlass::make(type);
+  return JNIHandles::make_local(THREAD, GraalCompiler::get_RiType(klass, KlassHandle(), THREAD));
+}
+
+// public RiType getType(Class<?> javaClass);
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getType(JNIEnv *env, jobject, jobject javaClass) {
+  TRACE_graal_3("VMEntries::VMEntries_getType");
+  VM_ENTRY_MARK;
+  oop javaClassOop = JNIHandles::resolve(javaClass);
+  if (javaClassOop == NULL) {
+    fatal("argument to VMEntries.getType must not be NULL");
+    return NULL;
+  } else if (java_lang_Class::is_primitive(javaClassOop)) {
+    BasicType basicType = java_lang_Class::primitive_type(javaClassOop);
+    return JNIHandles::make_local(THREAD, VMExits::createRiTypePrimitive((int) basicType, THREAD));
+  } else {
+    KlassHandle klass = java_lang_Class::as_klassOop(javaClassOop);
+    Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL);
+
+    oop type = GraalCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL);
+    return JNIHandles::make_local(THREAD, type);
+  }
+}
+
+
+// helpers used to set fields in the HotSpotVMConfig object
+jfieldID getFieldID(JNIEnv* env, jobject obj, const char* name, const char* sig) {
+  jfieldID id = env->GetFieldID(env->GetObjectClass(obj), name, sig);
+  if (id == NULL) {
+    TRACE_graal_1("field not found: %s (%s)", name, sig);
+    fatal("field not found");
+  }
+  return id;
+}
+
+void set_boolean(JNIEnv* env, jobject obj, const char* name, bool value) { env->SetBooleanField(obj, getFieldID(env, obj, name, "Z"), value); }
+void set_int(JNIEnv* env, jobject obj, const char* name, int value) { env->SetIntField(obj, getFieldID(env, obj, name, "I"), value); }
+void set_long(JNIEnv* env, jobject obj, const char* name, jlong value) { env->SetLongField(obj, getFieldID(env, obj, name, "J"), value); }
+void set_object(JNIEnv* env, jobject obj, const char* name, jobject value) { env->SetObjectField(obj, getFieldID(env, obj, name, "Ljava/lang/Object;"), value); }
+void set_int_array(JNIEnv* env, jobject obj, const char* name, jarray value) { env->SetObjectField(obj, getFieldID(env, obj, name, "[I"), value); }
+
+jboolean get_boolean(JNIEnv* env, jobject obj, const char* name) { return env->GetBooleanField(obj, getFieldID(env, obj, name, "Z")); }
+jint get_int(JNIEnv* env, jobject obj, const char* name) { return env->GetIntField(obj, getFieldID(env, obj, name, "I")); }
+jlong get_long(JNIEnv* env, jobject obj, const char* name) { return env->GetLongField(obj, getFieldID(env, obj, name, "J")); }
+jobject get_object(JNIEnv* env, jobject obj, const char* name) { return env->GetObjectField(obj, getFieldID(env, obj, name, "Ljava/lang/Object;")); }
+jobject get_object(JNIEnv* env, jobject obj, const char* name, const char* sig) { return env->GetObjectField(obj, getFieldID(env, obj, name, sig)); }
+
+
+BasicType basicTypes[] = { T_BOOLEAN, T_BYTE, T_SHORT, T_CHAR, T_INT, T_FLOAT, T_LONG, T_DOUBLE, T_OBJECT };
+int basicTypeCount = sizeof(basicTypes) / sizeof(BasicType);
+
+// public HotSpotVMConfig getConfiguration();
+JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getConfiguration(JNIEnv *env, jobject) {
+  jclass klass = env->FindClass("com/oracle/max/graal/runtime/HotSpotVMConfig");
+  assert(klass != NULL, "HotSpot vm config class not found");
+  jobject config = env->AllocObject(klass);
+#ifdef _WIN64
+  set_boolean(env, config, "windowsOs", true);
+#else
+  set_boolean(env, config, "windowsOs", false);
+#endif
+  set_boolean(env, config, "verifyPointers", VerifyOops);
+  set_boolean(env, config, "useFastLocking", UseFastLocking);
+  set_boolean(env, config, "useFastNewObjectArray", UseFastNewObjectArray);
+  set_boolean(env, config, "useFastNewTypeArray", UseFastNewTypeArray);
+  set_int(env, config, "codeEntryAlignment", CodeEntryAlignment);
+  set_int(env, config, "vmPageSize", os::vm_page_size());
+  set_int(env, config, "stackShadowPages", StackShadowPages);
+  set_int(env, config, "hubOffset", oopDesc::klass_offset_in_bytes());
+  set_int(env, config, "arrayLengthOffset", arrayOopDesc::length_offset_in_bytes());
+  set_int(env, config, "klassStateOffset", instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc));
+  set_int(env, config, "klassStateFullyInitialized", (int)instanceKlass::fully_initialized);
+  set_int(env, config, "threadTlabTopOffset", in_bytes(JavaThread::tlab_top_offset()));
+  set_int(env, config, "threadTlabEndOffset", in_bytes(JavaThread::tlab_end_offset()));
+  set_int(env, config, "threadObjectOffset", in_bytes(JavaThread::threadObj_offset()));
+  set_int(env, config, "instanceHeaderPrototypeOffset", Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes());
+  set_int(env, config, "threadExceptionOopOffset", in_bytes(JavaThread::exception_oop_offset()));
+  set_int(env, config, "threadExceptionPcOffset", in_bytes(JavaThread::exception_pc_offset()));
+  set_int(env, config, "threadMultiNewArrayStorage", in_bytes(JavaThread::graal_multinewarray_storage_offset()));
+  set_int(env, config, "classMirrorOffset", klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes());
+
+  set_long(env, config, "debugStub", VmIds::addStub((address)warning));
+  set_long(env, config, "instanceofStub", VmIds::addStub(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));
+  set_long(env, config, "verifyPointerStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_verify_pointer_id)));
+  set_long(env, config, "newInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::fast_new_instance_init_check_id)));
+  set_long(env, config, "unresolvedNewInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_instance_id)));
+  set_long(env, config, "newTypeArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_type_array_id)));
+  set_long(env, config, "newObjectArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_object_array_id)));
+  set_long(env, config, "newMultiArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_multi_array_id)));
+  set_long(env, config, "loadKlassStub", VmIds::addStub(Runtime1::entry_for(Runtime1::load_klass_patching_id)));
+  set_long(env, config, "accessFieldStub", VmIds::addStub(Runtime1::entry_for(Runtime1::access_field_patching_id)));
+  set_long(env, config, "resolveStaticCallStub", VmIds::addStub(SharedRuntime::get_resolve_static_call_stub()));
+  set_long(env, config, "inlineCacheMissStub", VmIds::addStub(SharedRuntime::get_ic_miss_stub()));
+  set_long(env, config, "unwindExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_unwind_exception_call_id)));
+  set_long(env, config, "handleExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id)));
+  set_long(env, config, "handleDeoptStub", VmIds::addStub(SharedRuntime::deopt_blob()->unpack()));
+  set_long(env, config, "monitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorenter_id)));
+  set_long(env, config, "monitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorexit_id)));
+  set_long(env, config, "fastMonitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_monitorenter_id)));
+  set_long(env, config, "fastMonitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_monitorexit_id)));
+  set_long(env, config, "safepointPollingAddress", (jlong)(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size())));
+
+  BarrierSet* bs = Universe::heap()->barrier_set();
+  switch (bs->kind()) {
+    case BarrierSet::CardTableModRef:
+    case BarrierSet::CardTableExtension: {
+      jlong base = (jlong)((CardTableModRefBS*)bs)->byte_map_base;
+      assert(base != 0, "unexpected byte_map_base");
+      set_long(env, config, "cardtableStartAddress", base);
+      set_int(env, config, "cardtableShift", CardTableModRefBS::card_shift);
+      break;
+    }
+    case BarrierSet::ModRef:
+    case BarrierSet::Other:
+      set_long(env, config, "cardtableStartAddress", 0);
+      set_int(env, config, "cardtableShift", 0);
+      // No post barriers
+      break;
+#ifndef SERIALGC
+    case BarrierSet::G1SATBCT:
+    case BarrierSet::G1SATBCTLogging:
+#endif // SERIALGC
+    default:
+      ShouldNotReachHere();
+    }
+
+  jintArray arrayOffsets = env->NewIntArray(basicTypeCount);
+  for (int i=0; i<basicTypeCount; i++) {
+    jint offset = arrayOopDesc::base_offset_in_bytes(basicTypes[i]);
+    env->SetIntArrayRegion(arrayOffsets, i, 1, &offset);
+  }
+  set_int_array(env, config, "arrayOffsets", arrayOffsets);
+  set_int(env, config, "arrayClassElementOffset", objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc));
+  return config;
+}
+
+// public void installMethod(HotSpotTargetMethod targetMethod);
+JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod) {
+  VM_ENTRY_MARK;
+  CodeInstaller installer(JNIHandles::resolve(targetMethod));
+}
+
+// public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name);
+JNIEXPORT jlong JNICALL Java_com_oracle_graal_runtime_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) {
+  VM_ENTRY_MARK;
+  jlong id;
+  CodeInstaller installer(JNIHandles::resolve(targetMethod), id);
+  return id;
+}
+
+// public void recordBailout(String reason);
+JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_recordBailout(JNIEnv *jniEnv, jobject, jobject message) {
+  if (GraalBailoutIsFatal) {
+    Handle msg = JNIHandles::resolve(message);
+    if (!msg.is_null()) {
+      java_lang_String::print(msg, tty);
+    }
+    vm_abort(false);
+  }
+}
+
+
+
+
+#define CC (char*)  /*cast a literal from (const char*)*/
+#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
+
+#define PROXY           "J"
+#define TYPE            "Lcom/sun/cri/ri/RiType;"
+#define RESOLVED_TYPE   "Lcom/oracle/max/graal/runtime/HotSpotTypeResolved;"
+#define METHOD          "Lcom/sun/cri/ri/RiMethod;"
+#define SIGNATURE       "Lcom/sun/cri/ri/RiSignature;"
+#define FIELD           "Lcom/sun/cri/ri/RiField;"
+#define CONSTANT_POOL   "Lcom/sun/cri/ri/RiConstantPool;"
+#define EXCEPTION_HANDLERS "[Lcom/sun/cri/ri/RiExceptionHandler;"
+#define TARGET_METHOD   "Lcom/oracle/max/graal/runtime/HotSpotTargetMethod;"
+#define CONFIG          "Lcom/oracle/max/graal/runtime/HotSpotVMConfig;"
+#define HS_METHOD       "Lcom/oracle/max/graal/runtime/HotSpotMethod;"
+#define CI_CONSTANT     "Lcom/sun/cri/ci/CiConstant;"
+#define CI_KIND         "Lcom/sun/cri/ci/CiKind;"
+#define STRING          "Ljava/lang/String;"
+#define OBJECT          "Ljava/lang/Object;"
+#define CLASS           "Ljava/lang/Class;"
+
+JNINativeMethod VMEntries_methods[] = {
+  {CC"RiMethod_code",                   CC"("PROXY")[B",                            FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1code)},
+  {CC"RiMethod_maxStackSize",           CC"("PROXY")I",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxStackSize)},
+  {CC"RiMethod_maxLocals",              CC"("PROXY")I",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxLocals)},
+  {CC"RiMethod_holder",                 CC"("PROXY")"TYPE,                          FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1holder)},
+  {CC"RiMethod_signature",              CC"("PROXY")"STRING,                        FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1signature)},
+  {CC"RiMethod_accessFlags",            CC"("PROXY")I",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1accessFlags)},
+  {CC"RiMethod_exceptionHandlers",      CC"("PROXY")"EXCEPTION_HANDLERS,            FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1exceptionHandlers)},
+  {CC"RiMethod_hasBalancedMonitors",    CC"("PROXY")Z",                             FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1hasBalancedMonitors)},
+  {CC"RiMethod_uniqueConcreteMethod",   CC"("PROXY")"METHOD,                        FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiMethod_1uniqueConcreteMethod)},
+  {CC"RiSignature_lookupType",          CC"("STRING RESOLVED_TYPE")"TYPE,           FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiSignature_1lookupType)},
+  {CC"RiConstantPool_lookupConstant",   CC"("PROXY"I)"OBJECT,                       FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupConstant)},
+  {CC"RiConstantPool_lookupMethod",     CC"("PROXY"IB)"METHOD,                      FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod)},
+  {CC"RiConstantPool_lookupSignature",  CC"("PROXY"I)"SIGNATURE,                    FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupSignature)},
+  {CC"RiConstantPool_lookupType",       CC"("PROXY"I)"TYPE,                         FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupType)},
+  {CC"RiConstantPool_lookupField",      CC"("PROXY"IB)"FIELD,                       FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupField)},
+  {CC"RiType_constantPool",             CC"("RESOLVED_TYPE")"CONSTANT_POOL,         FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1constantPool)},
+  {CC"RiType_resolveMethodImpl",        CC"("RESOLVED_TYPE STRING STRING")"METHOD,  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_3resolveMethodImpl)},
+  {CC"RiType_isSubtypeOf",              CC"("RESOLVED_TYPE TYPE")Z",                FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_2isSubtypeOf)},
+  {CC"RiType_componentType",            CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1componentType)},
+  {CC"RiType_uniqueConcreteSubtype",    CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1uniqueConcreteSubtype)},
+  {CC"RiType_superType",                CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1superType)},
+  {CC"RiType_arrayOf",                  CC"("RESOLVED_TYPE")"TYPE,                  FN_PTR(Java_com_oracle_graal_runtime_VMEntries_RiType_1arrayOf)},
+  {CC"getPrimitiveArrayType",           CC"("CI_KIND")"TYPE,                        FN_PTR(Java_com_oracle_graal_runtime_VMEntries_getPrimitiveArrayType)},
+  {CC"getType",                         CC"("CLASS")"TYPE,                          FN_PTR(Java_com_oracle_graal_runtime_VMEntries_getType)},
+  {CC"getConfiguration",                CC"()"CONFIG,                               FN_PTR(Java_com_oracle_graal_runtime_VMEntries_getConfiguration)},
+  {CC"installMethod",                   CC"("TARGET_METHOD")V",                     FN_PTR(Java_com_oracle_graal_runtime_VMEntries_installMethod)},
+  {CC"installStub",                     CC"("TARGET_METHOD")"PROXY,                 FN_PTR(Java_com_oracle_graal_runtime_VMEntries_installStub)},
+  {CC"recordBailout",                   CC"("STRING")V",                            FN_PTR(Java_com_oracle_graal_runtime_VMEntries_recordBailout)}
+};
+
+int VMEntries_methods_count() {
+  return sizeof(VMEntries_methods) / sizeof(JNINativeMethod);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalVMEntries.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "prims/jni.h"
+
+extern JNINativeMethod VMEntries_methods[];
+int VMEntries_methods_count();
+
+// nothing here - no need to define the jni method implementations in a header file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalVMExits.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "precompiled.hpp"
+#include "graal/graalVMExits.hpp"
+
+// this is a *global* handle
+jobject VMExits::_compilerPermObject;
+jobject VMExits::_vmExitsPermObject;
+jobject VMExits::_vmExitsPermKlass;
+
+KlassHandle VMExits::vmExitsKlass() {
+  if (JNIHandles::resolve(_vmExitsPermKlass) == NULL) {
+    klassOop result = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_VMExits(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+    check_not_null(result, "Couldn't find class com.sun.hotspot.graal.VMExits");
+    _vmExitsPermKlass = JNIHandles::make_global(result);
+  }
+  return KlassHandle((klassOop)JNIHandles::resolve_non_null(_vmExitsPermKlass));
+}
+
+Handle VMExits::compilerInstance() {
+  if (JNIHandles::resolve(_compilerPermObject) == NULL) {
+    KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+    check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.graal.CompilerImpl");
+
+    JavaValue result(T_OBJECT);
+    JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::getInstance_name(), vmSymbols::getInstance_signature(), Thread::current());
+    check_pending_exception("Couldn't get Compiler");
+    _compilerPermObject = JNIHandles::make_global((oop) result.get_jobject());
+  }
+  return Handle(JNIHandles::resolve_non_null(_compilerPermObject));
+}
+
+Handle VMExits::instance() {
+  if (JNIHandles::resolve(_vmExitsPermObject) == NULL) {
+    KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+    check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.Compiler");
+
+    JavaValue result(T_OBJECT);
+    JavaCallArguments args;
+    args.set_receiver(compilerInstance());
+    JavaCalls::call_interface(&result, compilerKlass, vmSymbols::getVMExits_name(), vmSymbols::getVMExits_signature(), &args, Thread::current());
+    check_pending_exception("Couldn't get VMExits");
+    _vmExitsPermObject = JNIHandles::make_global((oop) result.get_jobject());
+  }
+  return Handle(JNIHandles::resolve_non_null(_vmExitsPermObject));
+}
+
+void VMExits::initializeCompiler() {
+  KlassHandle compilerImplKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_CompilerImpl(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+  check_not_null(compilerImplKlass(), "Couldn't find class com.sun.hotspot.graal.CompilerImpl");
+
+  JavaValue result(T_VOID);
+  JavaCalls::call_static(&result, compilerImplKlass, vmSymbols::initialize_name(), vmSymbols::void_method_signature(), Thread::current());
+  check_pending_exception("Couldn't initialize compiler");
+}
+
+jboolean VMExits::setOption(Handle option) {
+  assert(!option.is_null(), "");
+  KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+  check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.HotSpotOptions");
+
+  Thread* THREAD = Thread::current();
+  JavaValue result(T_BOOLEAN);
+  JavaCalls::call_static(&result, compilerKlass, vmSymbols::setOption_name(), vmSymbols::setOption_signature(), option, THREAD);
+  check_pending_exception("Error while calling setOption");
+  return result.get_jboolean();
+}
+
+void VMExits::setDefaultOptions() {
+  KlassHandle compilerKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_graal_HotSpotOptions(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+  check_not_null(compilerKlass(), "Couldn't find class com.sun.hotspot.graal.HotSpotOptions");
+
+  Thread* THREAD = Thread::current();
+  JavaValue result(T_VOID);
+  JavaCalls::call_static(&result, compilerKlass, vmSymbols::setDefaultOptions_name(), vmSymbols::void_method_signature(), THREAD);
+  check_pending_exception("Error while calling setDefaultOptions");
+}
+
+void VMExits::compileMethod(jlong methodVmId, Handle name, int entry_bci) {
+  assert(!name.is_null(), "just checking");
+  Thread* THREAD = Thread::current();
+  JavaValue result(T_VOID);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_long(methodVmId);
+  args.push_oop(name);
+  args.push_int(entry_bci);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, THREAD);
+  check_pending_exception("Error while calling compileMethod");
+}
+
+oop VMExits::createRiMethodResolved(jlong vmId, Handle name, TRAPS) {
+  assert(!name.is_null(), "just checking");
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_long(vmId);
+  args.push_oop(name);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodResolved_name(), vmSymbols::createRiMethodResolved_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiMethodResolved");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createRiMethodUnresolved(Handle name, Handle signature, Handle holder, TRAPS) {
+  assert(!name.is_null(), "just checking");
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_oop(name);
+  args.push_oop(signature);
+  args.push_oop(holder);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodUnresolved_name(), vmSymbols::createRiMethodUnresolved_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiMethodUnresolved");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createRiField(Handle holder, Handle name, Handle type, int index, int flags, TRAPS) {
+  assert(!holder.is_null(), "just checking");
+  assert(!name.is_null(), "just checking");
+  assert(!type.is_null(), "just checking");
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_oop(holder);
+  args.push_oop(name);
+  args.push_oop(type);
+  args.push_int(index);
+  args.push_int(flags);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiField");
+  assert(result.get_type() == T_OBJECT, "just checking");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createRiType(jlong vmId, Handle name, TRAPS) {
+  assert(!name.is_null(), "just checking");
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_long(vmId);
+  args.push_oop(name);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiType");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createRiTypePrimitive(int basic_type, TRAPS) {
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_int(basic_type);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiTypePrimitive");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createRiTypeUnresolved(Handle name, TRAPS) {
+  assert(!name.is_null(), "just checking");
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_oop(name);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiTypeUnresolved");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createRiConstantPool(jlong vmId, TRAPS) {
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_long(vmId);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiConstantPool");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createRiSignature(Handle name, TRAPS) {
+  assert(!name.is_null(), "just checking");
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_oop(name);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createRiSignature");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createCiConstant(Handle kind, jlong value, TRAPS) {
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_oop(kind());
+  args.push_long(value);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstant_name(), vmSymbols::createCiConstant_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createCiConstantFloat");
+  return (oop) result.get_jobject();
+
+}
+
+oop VMExits::createCiConstantFloat(jfloat value, TRAPS) {
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_float(value);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createCiConstantFloat");
+  return (oop) result.get_jobject();
+
+}
+
+oop VMExits::createCiConstantDouble(jdouble value, TRAPS) {
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  args.push_oop(instance());
+  args.push_double(value);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createCiConstantDouble");
+  return (oop) result.get_jobject();
+}
+
+oop VMExits::createCiConstantObject(Handle object, TRAPS) {
+  JavaValue result(T_OBJECT);
+  JavaCallArguments args;
+  /*
+  args.push_oop(instance());
+  args.push_oop(object);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantObject_signature(), &args, THREAD);
+  check_pending_exception("Error while calling createCiConstantObject");
+  */
+
+
+  KlassHandle klass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_cri_ci_CiConstant(), SystemDictionary::java_system_loader(), NULL, Thread::current());
+  JavaCalls::call_static(&result, klass(), vmSymbols::forObject_name(), vmSymbols::createCiConstantObject_signature(), object, THREAD);
+  check_pending_exception("Error while calling CiConstant.forObject");
+  return (oop) result.get_jobject();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalVMExits.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "memory/allocation.hpp"
+#include "oops/oop.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/thread.hpp"
+#include "classfile/javaClasses.hpp"
+#include "runtime/jniHandles.hpp"
+#include "runtime/javaCalls.hpp"
+
+class VMExits : public AllStatic {
+
+private:
+  static jobject _compilerPermObject;
+  static jobject _vmExitsPermObject;
+  static jobject _vmExitsPermKlass;
+
+  static KlassHandle vmExitsKlass();
+  static Handle instance();
+
+public:
+  static void initializeCompiler();
+
+  static Handle compilerInstance();
+
+  // public static boolean HotSpotOptions.setOption(String option);
+  static jboolean setOption(Handle option);
+
+  // public static void HotSpotOptions.setDefaultOptions();
+  static void setDefaultOptions();
+
+  // public abstract void compileMethod(long vmId, String name, int entry_bci);
+  static void compileMethod(jlong vmId, Handle name, int entry_bci);
+
+  // public abstract RiMethod createRiMethodResolved(long vmId, String name);
+  static oop createRiMethodResolved(jlong vmId, Handle name, TRAPS);
+
+  // public abstract RiMethod createRiMethodUnresolved(String name, String signature, RiType holder);
+  static oop createRiMethodUnresolved(Handle name, Handle signature, Handle holder, TRAPS);
+
+  // public abstract RiField createRiField(RiType holder, String name, RiType type, int flags, int offset);
+  static oop createRiField(Handle holder, Handle name, Handle type, int index, int flags, TRAPS);
+
+  // public abstract RiType createRiType(long vmId, String name);
+  static oop createRiType(jlong vmId, Handle name, TRAPS);
+
+  // public abstract RiType createRiTypeUnresolved(String name);
+  static oop createRiTypeUnresolved(Handle name, TRAPS);
+
+  // public abstract RiConstantPool createRiConstantPool(long vmId);
+  static oop createRiConstantPool(jlong vmId, TRAPS);
+
+  // public abstract RiType createRiTypePrimitive(int basicType);
+  static oop createRiTypePrimitive(int basicType, TRAPS);
+
+  // public abstract RiSignature createRiSignature(String signature);
+  static oop createRiSignature(Handle name, TRAPS);
+
+  // public abstract CiConstant createCiConstant(CiKind kind, long value);
+  static oop createCiConstant(Handle kind, jlong value, TRAPS);
+
+  // public abstract CiConstant createCiConstantFloat(float value);
+  static oop createCiConstantFloat(jfloat value, TRAPS);
+
+  // public abstract CiConstant createCiConstantDouble(double value);
+  static oop createCiConstantDouble(jdouble value, TRAPS);
+
+  // public abstract CiConstant createCiConstantObject(long vmId);
+  static oop createCiConstantObject(Handle object, TRAPS);
+};
+
+inline void check_pending_exception(const char* message, bool dump_core = false) {
+  Thread* THREAD = Thread::current();
+  if (THREAD->has_pending_exception()) {
+    Handle exception = PENDING_EXCEPTION;
+    CLEAR_PENDING_EXCEPTION;
+    tty->print_cr("%s", message);
+    java_lang_Throwable::print(exception, tty);
+    tty->cr();
+    java_lang_Throwable::print_stack_trace(exception(), tty);
+    vm_abort(dump_core);
+  }
+}
+
+inline void check_not_null(void* value, const char* message, bool dump_core = false) {
+  if (value == NULL) {
+    tty->print_cr("%s", message);
+    vm_abort(dump_core);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalVmIds.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "precompiled.hpp"
+#include "graal/graalVmIds.hpp"
+#include "ci/ciUtilities.hpp"
+
+// VmIds implementation
+
+GrowableArray<address>* VmIds::_stubs = NULL;
+GrowableArray<jobject>* VmIds::_localHandles = NULL;
+
+
+void VmIds::initializeObjects() {
+  if (_stubs == NULL) {
+    assert(_localHandles == NULL, "inconsistent state");
+    _stubs = new (ResourceObj::C_HEAP) GrowableArray<address> (64, true);
+    _localHandles = new (ResourceObj::C_HEAP) GrowableArray<jobject> (64, true);
+  }
+  assert(_localHandles->length() == 0, "invalid state");
+}
+
+void VmIds::cleanupLocalObjects() {
+  for (int i = 0; i < _localHandles->length(); i++) {
+    JNIHandles::destroy_global(_localHandles->at(i));
+  }
+  _localHandles->clear();
+}
+
+jlong VmIds::addStub(address stub) {
+  assert(!_stubs->contains(stub), "duplicate stub");
+  return _stubs->append(stub) | STUB;
+}
+
+jlong VmIds::add(Handle obj, jlong type) {
+  assert(!obj.is_null(), "cannot add NULL handle");
+  int idx = -1;
+  for (int i = 0; i < _localHandles->length(); i++)
+    if (JNIHandles::resolve_non_null(_localHandles->at(i)) == obj()) {
+      idx = i;
+      break;
+    }
+  if (idx == -1) {
+    if (JavaThread::current()->thread_state() == _thread_in_vm) {
+      idx = _localHandles->append(JNIHandles::make_global(obj));
+    } else {
+      VM_ENTRY_MARK;
+      idx = _localHandles->append(JNIHandles::make_global(obj));
+    }
+  }
+  return idx | type;
+}
+
+address VmIds::getStub(jlong id) {
+  assert((id & TYPE_MASK) == STUB, "wrong id type, STUB expected");
+  assert((id & ~TYPE_MASK) >= 0 && (id & ~TYPE_MASK) < _stubs->length(), "STUB index out of bounds");
+  return _stubs->at(id & ~TYPE_MASK);
+}
+
+oop VmIds::getObject(jlong id) {
+  assert((id & TYPE_MASK) != STUB, "wrong id type");
+  assert((id & ~TYPE_MASK) >= 0 && (id & ~TYPE_MASK) < _localHandles->length(), "index out of bounds");
+  return JNIHandles::resolve_non_null(_localHandles->at(id & ~TYPE_MASK));
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/graalVmIds.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "memory/allocation.hpp"
+#include "utilities/growableArray.hpp"
+#include "oops/oop.hpp"
+#include "runtime/handles.hpp"
+#include "runtime/thread.hpp"
+#include "classfile/javaClasses.hpp"
+#include "runtime/jniHandles.hpp"
+
+class VmIds : public AllStatic {
+
+private:
+  static GrowableArray<address>* _stubs;
+  static GrowableArray<jobject>* _localHandles;
+
+  static oop getObject(jlong id);
+
+public:
+  // these constants needs to have the same values as the one in HotSpotProxy.java
+  static const jlong STUB           = 0x100000000000000LL;        // address
+  static const jlong METHOD         = 0x200000000000000LL;        // methodOop
+  static const jlong CLASS          = 0x300000000000000LL;        // klassOop
+  static const jlong CONSTANT_POOL  = 0x500000000000000LL;        // constantPoolOop
+  static const jlong CONSTANT       = 0x600000000000000LL;        // oop
+  static const jlong TYPE_MASK      = 0xf00000000000000LL;
+  static const jlong DUMMY_CONSTANT = 0x6ffffffffffffffLL;
+
+  // Initializes the VmIds for a compilation, by creating the arrays
+  static void initializeObjects();
+  // Cleans up after a compilation, by deallocating the arrays
+  static void cleanupLocalObjects();
+
+  // Adds a stub address, and returns the corresponding vmId (which is of type STUB)
+  static jlong addStub(address stub);
+
+  // Adds an object, and returns the corresponding vmId (with the given type)
+  static jlong add(Handle obj, jlong type);
+
+  // Adds an object, and returns the corresponding vmId (the type of which is determined by the template parameter)
+  template <typename T> static jlong add(T obj);
+
+
+  // Returns the stub address with the given vmId
+  static address getStub(jlong id);
+  // Returns the stub address with the given vmId taken from a java.lang.Long
+  static address getStub(oop id);
+
+  // Returns the object with the given id, the return type is defined by the template parameter (which must correspond to the actual type of the vmId)
+  template <typename T> static T get(jlong id);
+
+
+  // Helper function to convert a symbol to a java.lang.String object
+  template <typename T> static T toString(Symbol* symbol, TRAPS);
+
+  // Helper function to convert a java.lang.String object to a symbol (this will return NULL if the symbol doesn't exist in the system)
+  static Symbol* toSymbol(jstring string);
+
+  // Helper function to get the contents of a java.lang.Long
+  static jlong getBoxedLong(oop obj);
+};
+
+
+template <> inline jlong VmIds::add<methodOop>(methodOop obj){
+  assert(obj != NULL, "trying to add NULL<methodOop>");
+  assert(obj->is_method(), "trying to add mistyped object");
+  return add(Handle(obj), METHOD);
+}
+template <> inline jlong VmIds::add<klassOop>(klassOop obj) {
+  assert(obj != NULL, "trying to add NULL<klassOop>");
+  assert(obj->is_klass(), "trying to add mistyped object");
+  return add(Handle(obj), CLASS);
+}
+template <> inline jlong VmIds::add<constantPoolOop>(constantPoolOop obj) {
+  assert(obj != NULL, "trying to add NULL<constantPoolOop>");
+  assert(obj->is_constantPool(), "trying to add mistyped object");
+  return add(Handle(obj), CONSTANT_POOL);
+}
+template <> inline jlong VmIds::add<oop>(oop obj) {
+  assert(obj != NULL, "trying to add NULL<oop>");
+  assert(obj->is_oop(), "trying to add mistyped object");
+  return add(Handle(obj), CONSTANT);
+}
+
+
+template <> inline methodOop VmIds::get<methodOop>(jlong id){
+  assert((id & TYPE_MASK) == METHOD, "METHOD expected");
+  assert(getObject(id)->is_method(), "methodOop expected");
+  return (methodOop)getObject(id);
+}
+template <> inline klassOop VmIds::get<klassOop>(jlong id) {
+  assert((id & TYPE_MASK) == CLASS, "CLASS expected");
+  assert(getObject(id)->is_klass(), "klassOop expected");
+  return (klassOop)getObject(id);
+}
+template <> inline constantPoolOop VmIds::get<constantPoolOop>(jlong id) {
+  assert((id & TYPE_MASK) == CONSTANT_POOL, "CONSTANT_POOL expected");
+  assert(getObject(id)->is_constantPool(), "constantPoolOop expected");
+  return (constantPoolOop)getObject(id);
+}
+template <> inline oop VmIds::get<oop>(jlong id) {
+  assert((id & TYPE_MASK) == CONSTANT, "CONSTANT expected");
+  assert(getObject(id)->is_oop(true), "oop expected");
+  return (oop)getObject(id);
+}
+
+inline address VmIds::getStub(oop obj) {
+  return getStub(getBoxedLong(obj));
+}
+
+template <> inline Handle VmIds::toString<Handle>(Symbol* symbol, TRAPS) {
+  return java_lang_String::create_from_symbol(symbol, THREAD);
+}
+template <> inline oop VmIds::toString<oop>(Symbol* symbol, TRAPS) {
+  return toString<Handle>(symbol, THREAD)();
+}
+template <> inline jstring VmIds::toString<jstring>(Symbol* symbol, TRAPS) {
+  return (jstring)JNIHandles::make_local(toString<oop>(symbol, THREAD));
+}
+template <> inline jobject VmIds::toString<jobject>(Symbol* symbol, TRAPS) {
+  return JNIHandles::make_local(toString<oop>(symbol, THREAD));
+}
+
+inline Symbol* VmIds::toSymbol(jstring string) {
+  return java_lang_String::as_symbol_or_null(JNIHandles::resolve(string));
+}
+
+inline jlong VmIds::getBoxedLong(oop obj) {
+  assert(obj->is_oop(true), "cannot unbox null or non-oop");
+  return obj->long_field(java_lang_boxing_object::value_offset_in_bytes(T_LONG));
+}
--- a/src/share/vm/interpreter/rewriter.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/interpreter/rewriter.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -109,7 +109,7 @@
   while (!bcs.is_last_bytecode()) {
     Bytecodes::Code opcode = bcs.raw_next();
     switch (opcode) {
-      case Bytecodes::_return: if (!UseC1X) { *bcs.bcp() = Bytecodes::_return_register_finalizer; } break;
+      case Bytecodes::_return: if (!UseGraal) { *bcs.bcp() = Bytecodes::_return_register_finalizer; } break;
 
       case Bytecodes::_istore:
       case Bytecodes::_lstore:
@@ -227,7 +227,7 @@
       switch (c) {
         case Bytecodes::_lookupswitch   : {
 #ifndef CC_INTERP
-          if (!UseC1X) {
+          if (!UseGraal) {
             Bytecode_lookupswitch bc(method, bcp);
             (*bcp) = (
               bc.number_of_pairs() < BinarySwitchThreshold
--- a/src/share/vm/oops/klass.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/oops/klass.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -148,7 +148,7 @@
   }
 
   kl->set_java_mirror(NULL);
-  kl->set_c1x_mirror(NULL);
+  kl->set_graal_mirror(NULL);
   kl->set_modifier_flags(0);
   kl->set_layout_helper(Klass::_lh_neutral_value);
   kl->set_name(NULL);
--- a/src/share/vm/oops/klass.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/oops/klass.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -238,7 +238,7 @@
   // java/lang/Class instance mirroring this class
   oop       _java_mirror;
   // com/oracle/max/graal/runtime/HotSpotTypeResolved mirroring this class
-  oop       _c1x_mirror;
+  oop       _graal_mirror;
   // Superclass
   klassOop  _super;
   // First subclass (NULL if none); _subklass->next_sibling() is next one
@@ -336,9 +336,9 @@
   oop java_mirror() const              { return _java_mirror; }
   void set_java_mirror(oop m)          { oop_store((oop*) &_java_mirror, m); }
 
-  // c1x mirror
-  oop c1x_mirror() const               { return _c1x_mirror; }
-  void set_c1x_mirror(oop m)           { oop_store((oop*) &_c1x_mirror, m); }
+  // graal mirror
+  oop graal_mirror() const               { return _graal_mirror; }
+  void set_graal_mirror(oop m)           { oop_store((oop*) &_graal_mirror, m); }
 
   // modifier flags
   jint modifier_flags() const          { return _modifier_flags; }
@@ -368,7 +368,7 @@
   oop* adr_secondary_super_cache() const { return (oop*)&_secondary_super_cache; }
   oop* adr_secondary_supers()const { return (oop*)&_secondary_supers;  }
   oop* adr_java_mirror()     const { return (oop*)&_java_mirror;       }
-  oop* adr_c1x_mirror()      const { return (oop*)&_c1x_mirror;        }
+  oop* adr_graal_mirror()      const { return (oop*)&_graal_mirror;        }
   oop* adr_subklass()        const { return (oop*)&_subklass;          }
   oop* adr_next_sibling()    const { return (oop*)&_next_sibling;      }
 
--- a/src/share/vm/oops/klassKlass.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/oops/klassKlass.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -73,7 +73,7 @@
   MarkSweep::mark_and_push(k->adr_secondary_super_cache());
   MarkSweep::mark_and_push(k->adr_secondary_supers());
   MarkSweep::mark_and_push(k->adr_java_mirror());
-  MarkSweep::mark_and_push(k->adr_c1x_mirror());
+  MarkSweep::mark_and_push(k->adr_graal_mirror());
   // We follow the subklass and sibling links at the end of the
   // marking phase, since otherwise following them will prevent
   // class unloading (all classes are transitively linked from
@@ -93,7 +93,7 @@
   PSParallelCompact::mark_and_push(cm, k->adr_secondary_super_cache());
   PSParallelCompact::mark_and_push(cm, k->adr_secondary_supers());
   PSParallelCompact::mark_and_push(cm, k->adr_java_mirror());
-  PSParallelCompact::mark_and_push(cm, k->adr_c1x_mirror());
+  PSParallelCompact::mark_and_push(cm, k->adr_graal_mirror());
   // We follow the subklass and sibling links at the end of the
   // marking phase, since otherwise following them will prevent
   // class unloading (all classes are transitively linked from
@@ -113,7 +113,7 @@
   blk->do_oop(k->adr_secondary_super_cache());
   blk->do_oop(k->adr_secondary_supers());
   blk->do_oop(k->adr_java_mirror());
-  blk->do_oop(k->adr_c1x_mirror());
+  blk->do_oop(k->adr_graal_mirror());
   // The following are in the perm gen and are treated
   // specially in a later phase of a perm gen collection; ...
   assert(oop(k)->is_perm(), "should be in perm");
@@ -147,7 +147,7 @@
   if (mr.contains(adr)) blk->do_oop(adr);
   adr = k->adr_java_mirror();
   if (mr.contains(adr)) blk->do_oop(adr);
-  adr = k->adr_c1x_mirror();
+  adr = k->adr_graal_mirror();
   if (mr.contains(adr)) blk->do_oop(adr);
   // The following are "weak links" in the perm gen and are
   // treated specially in a later phase of a perm gen collection.
@@ -177,7 +177,7 @@
   MarkSweep::adjust_pointer(k->adr_secondary_super_cache());
   MarkSweep::adjust_pointer(k->adr_secondary_supers());
   MarkSweep::adjust_pointer(k->adr_java_mirror());
-  MarkSweep::adjust_pointer(k->adr_c1x_mirror());
+  MarkSweep::adjust_pointer(k->adr_graal_mirror());
   MarkSweep::adjust_pointer(k->adr_subklass());
   MarkSweep::adjust_pointer(k->adr_next_sibling());
   return size;
--- a/src/share/vm/prims/jni.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/prims/jni.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -3345,8 +3345,8 @@
        JvmtiExport::post_thread_start(thread);
     }
 
-    if (BootstrapC1X) {
-      CompileBroker::bootstrap_c1x();
+    if (Bootstrapgraal) {
+      CompileBroker::bootstrap_graal();
     }
 
     // Check if we should compile all classes on bootclasspath
--- a/src/share/vm/runtime/arguments.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/runtime/arguments.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -67,8 +67,8 @@
 int     Arguments::_num_jvm_flags               = 0;
 char**  Arguments::_jvm_args_array              = NULL;
 int     Arguments::_num_jvm_args                = 0;
-char**  Arguments::_c1x_args_array              = NULL;
-int     Arguments::_num_c1x_args                = 0;
+char**  Arguments::_graal_args_array              = NULL;
+int     Arguments::_num_graal_args                = 0;
 char*  Arguments::_java_command                 = NULL;
 SystemProperty* Arguments::_system_properties   = NULL;
 const char*  Arguments::_gc_log_filename        = NULL;
@@ -749,8 +749,8 @@
   add_string(&_jvm_flags_array, &_num_jvm_flags, arg);
 }
 
-void Arguments::add_c1x_arg(const char* arg) {
-  add_string(&_c1x_args_array, &_num_c1x_args, arg);
+void Arguments::add_graal_arg(const char* arg) {
+  add_string(&_graal_args_array, &_num_graal_args, arg);
 }
 
 // utility function to return a string that concatenates all
@@ -2668,8 +2668,8 @@
       if (PrintVMOptions) {
         tty->print("Running Graal VM... ");
       }
-      UseC1X = true;
-      BootstrapC1X = true;
+      UseGraal = true;
+      Bootstrapgraal = true;
       const int BUFFER_SIZE = 1024;
       char maxine_dir[BUFFER_SIZE];
       char graal_dir[BUFFER_SIZE];
@@ -2699,12 +2699,12 @@
       sprintf(temp, "%s/graal/com.oracle.max.graal.graphviz/bin", graal_dir);
       scp_p->add_prefix(temp);
       *scp_assembly_required_p = true;
-    } else if (match_option(option, "-C1X:", &tail)) { // -C1X:xxxx
-      // Option for the C1X compiler.
+    } else if (match_option(option, "-G:", &tail)) { // -graal:xxxx
+      // Option for the graal compiler.
       if (PrintVMOptions) {
-        tty->print_cr("C1X option %s", tail);
+        tty->print_cr("graal option %s", tail);
       }
-      Arguments::add_c1x_arg(tail);
+      Arguments::add_graal_arg(tail);
 
     // Unknown option
     } else if (is_bad_option(option, args->ignoreUnrecognized)) {
--- a/src/share/vm/runtime/arguments.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/runtime/arguments.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -228,9 +228,9 @@
   // an array containing all jvm arguments specified in the command line
   static char** _jvm_args_array;
   static int    _num_jvm_args;
-  // an array containing all c1x arguments specified in the command line
-  static char** _c1x_args_array;
-  static int    _num_c1x_args;
+  // an array containing all graal arguments specified in the command line
+  static char** _graal_args_array;
+  static int    _num_graal_args;
   // string containing all java command (class/jarfile name and app args)
   static char* _java_command;
 
@@ -369,7 +369,7 @@
   // methods to build strings from individual args
   static void build_jvm_args(const char* arg);
   static void build_jvm_flags(const char* arg);
-  static void add_c1x_arg(const char* arg);
+  static void add_graal_arg(const char* arg);
   static void add_string(char*** bldarray, int* count, const char* arg);
   static const char* build_resource_string(char** args, int count);
 
@@ -425,9 +425,9 @@
   // return a char* array containing all options
   static char** jvm_flags_array()          { return _jvm_flags_array; }
   static char** jvm_args_array()           { return _jvm_args_array; }
-  static char** c1x_args_array()           { return _c1x_args_array; }
+  static char** graal_args_array()           { return _graal_args_array; }
   static int num_jvm_flags()               { return _num_jvm_flags; }
-  static int num_c1x_args()               { return _num_c1x_args; }
+  static int num_graal_args()               { return _num_graal_args; }
   static int num_jvm_args()                { return _num_jvm_args; }
   // return the arguments passed to the Java application
   static const char* java_command()        { return _java_command; }
--- a/src/share/vm/runtime/sharedRuntime.cpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Wed Jun 08 14:10:06 2011 +0200
@@ -785,7 +785,7 @@
 #ifndef PRODUCT
           _implicit_null_throws++;
 #endif
-          if (UseC1X) {
+          if (UseGraal) {
             target_pc = deoptimization_continuation(thread, pc, nm);
           } else {
             target_pc = nm->continuation_for_implicit_exception(pc);
@@ -805,9 +805,9 @@
 #ifndef PRODUCT
         _implicit_div0_throws++;
 #endif
-        if (UseC1X) {
+        if (UseGraal) {
           if (TraceSignals) {
-            tty->print_cr("c1x implicit div0");
+            tty->print_cr("graal implicit div0");
           }
           target_pc = deoptimization_continuation(thread, pc, nm);
         } else {
--- a/src/share/vm/runtime/thread.hpp	Wed Jun 08 13:06:45 2011 +0200
+++ b/src/share/vm/runtime/thread.hpp	Wed Jun 08 14:10:06 2011 +0200
@@ -833,8 +833,8 @@
 
  private:
 
-  // c1x needs some place to put the dimensions
-  jint c1x_multinewarray_storage[256];
+  // graal needs some place to put the dimensions
+  jint graal_multinewarray_storage[256];
 
   StackGuardState        _stack_guard_state;
 
@@ -1271,7 +1271,7 @@
   static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); }
   static ByteSize stack_guard_state_offset()     { return byte_offset_of(JavaThread, _stack_guard_state   ); }
   static ByteSize suspend_flags_offset()         { return byte_offset_of(JavaThread, _suspend_flags       ); }
-  static ByteSize c1x_multinewarray_storage_offset() { return byte_offset_of(JavaThread, c1x_multinewarray_storage); }
+  static ByteSize graal_multinewarray_storage_offset() { return byte_offset_of(JavaThread, graal_multinewarray_storage); }
 
   static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); }
   static ByteSize should_post_on_exceptions_flag_offset() {