changeset 4350:685cbfb8e08e

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 13 Jan 2012 18:46:56 +0100
parents 7e974a026889 62cb0e636094
children 279a43776f42
files graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCompiler.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIR.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/stub/CompilerStub.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompilerStubEmitter.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFIOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFLOpcode.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java mx/org.eclipse.jdt.core.prefs mx/org.eclipse.jdt.ui.prefs mx/projects src/share/vm/graal/graal_paths.hpp src/share/vm/runtime/arguments.cpp
diffstat 57 files changed, 1647 insertions(+), 2182 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Fri Jan 13 11:04:30 2012 +0100
+++ b/.hgignore	Fri Jan 13 18:46:56 2012 +0100
@@ -23,6 +23,9 @@
 \.pdf$
 \.dot$
 \.pyc$
+build.xml
+nbproject
+dist
 ^doc/.*/dot_temp_
 ^doc/doxygen/.*$
 \.orig$
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCompiler.java	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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.
- */
-package com.oracle.max.cri.ci;
-
-import com.oracle.max.cri.ri.*;
-
-public interface CiCompiler {
-
-    /**
-     * Denotes the level of debug info for safepoints that should be generated by a compilation.
-     */
-    enum DebugInfoLevel {
-        /**
-         * Only ref maps are required.
-         */
-        REF_MAPS,
-
-        /**
-         * Code positions and ref maps are required.
-         */
-        CODE_POS_AND_REF_MAPS,
-
-        /**
-         * Frame info, code positions and ref maps are required.
-         * Only a compilation with level can make speculative optimizations.
-         */
-        FULL
-    }
-
-    /**
-     * Compile the specified method.
-     *
-     * @param method the method to compile
-     * @param osrBCI the bytecode index of the entrypoint for an on-stack-replacement or {@code -1} if this is not an
-     *            on-stack-replacement compilation
-     * @param debugInfoLevel TODO
-     */
-    CiTargetMethod compileMethod(RiResolvedMethod method, int osrBCI, DebugInfoLevel debugInfoLevel);
-}
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRuntime.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRuntime.java	Fri Jan 13 18:46:56 2012 +0100
@@ -130,6 +130,8 @@
      */
     RiRegisterConfig getRegisterConfig(RiMethod method);
 
+    RiRegisterConfig getGlobalStubRegisterConfig();
+
     /**
      * Custom area on the stack of each compiled method that the VM can use for its own purposes.
      * @return the size of the custom area in bytes
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java	Fri Jan 13 18:46:56 2012 +0100
@@ -499,10 +499,6 @@
          */
         PointerCAS,
         /**
-         * Call the {@link XirTemplate.GlobalFlags#GLOBAL_STUB shared stub} defined by {@code extra} with {@code args} and put the result in {@code r}.
-         */
-        CallStub,
-        /**
          * Call the {@link RiMethod} defined by {@code extra}  with {@code args} and put the result in {@code r}.
          */
         CallRuntime,
@@ -821,11 +817,6 @@
         append(new XirInstruction(CiKind.Void, message, ShouldNotReachHere, null));
     }
 
-    public void callStub(XirTemplate stub, XirOperand result, XirOperand... args) {
-        CiKind resultKind = result == null ? CiKind.Void : result.kind;
-        append(new XirInstruction(resultKind, stub, CallStub, result, args));
-    }
-
     public void callRuntime(Object rt, XirOperand result, XirOperand... args) {
         callRuntime(rt, result, false, args);
     }
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/RiXirGenerator.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/RiXirGenerator.java	Fri Jan 13 18:46:56 2012 +0100
@@ -22,11 +22,9 @@
  */
 package com.oracle.max.cri.xir;
 
-import java.util.*;
-
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.ri.RiType.*;
+import com.oracle.max.cri.ri.RiType.Representation;
 
 /**
  * Represents the interface through which the compiler requests the XIR for a given bytecode from the runtime system.
@@ -112,12 +110,10 @@
     XirSnippet genTypeCheck(XirSite site, XirArgument object, XirArgument hub, RiType type);
 
     /**
-     * Gets the list of XIR templates, using the given XIR assembler to create them if
-     * they haven't yet been created.
+     * Initializes the XIR generator for the given XIR assembler.
      *
      * @param asm the XIR assembler
-     * @return the list of templates
      */
-    List<XirTemplate> makeTemplates(CiXirAssembler asm);
+    void initialize(CiXirAssembler asm);
 
 }
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirTemplate.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirTemplate.java	Fri Jan 13 18:46:56 2012 +0100
@@ -112,8 +112,6 @@
 
     public final boolean allocateResultOperand;
 
-    public final XirTemplate[] calleeTemplates;
-
     public final XirMark[] marks;
 
     public final int outgoingStackSize;
@@ -139,7 +137,6 @@
                        XirTemp[] temps,
                        XirConstant[] constantValues,
                        int flags,
-                       XirTemplate[] calleeTemplates,
                        XirMark[] marks,
                        int outgoingStackSize) {
         this.name = name;
@@ -153,7 +150,6 @@
         this.temps = temps;
         this.allocateResultOperand = allocateResultOperand;
         this.constants = constantValues;
-        this.calleeTemplates = calleeTemplates;
         this.marks = marks;
         this.outgoingStackSize = outgoingStackSize;
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java	Fri Jan 13 18:46:56 2012 +0100
@@ -22,7 +22,6 @@
  */
 package com.oracle.max.graal.alloc.simple;
 
-import static com.oracle.max.graal.compiler.lir.LIRPhiMapping.*;
 import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static com.oracle.max.graal.alloc.util.ValueUtil.*;
 
@@ -30,12 +29,14 @@
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ci.CiRegister.RegisterFlag;
-import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.alloc.util.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.lir.LIRInstruction.*;
+import com.oracle.max.graal.compiler.lir.LIRInstruction.OperandFlag;
+import com.oracle.max.graal.compiler.lir.LIRInstruction.OperandMode;
+import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
+import com.oracle.max.graal.compiler.lir.LIRPhiMapping.PhiValueProcedure;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.compiler.util.*;
 
@@ -43,17 +44,15 @@
     private final GraalContext context;
     private final LIR lir;
     private final FrameMap frameMap;
-    private final RiRegisterConfig registerConfig;
 
     private final DataFlowAnalysis dataFlow;
 
-    public SpillAllAllocator(GraalContext context, LIR lir, GraalCompilation compilation, RiRegisterConfig registerConfig) {
+    public SpillAllAllocator(GraalContext context, LIR lir, FrameMap frameMap) {
         this.context = context;
         this.lir = lir;
-        this.registerConfig = registerConfig;
-        this.frameMap = compilation.frameMap();
+        this.frameMap = frameMap;
 
-        this.dataFlow = new DataFlowAnalysis(context, lir, registerConfig);
+        this.dataFlow = new DataFlowAnalysis(context, lir, frameMap.registerConfig);
         this.blockLocations = new LocationMap[lir.linearScanOrder().size()];
         this.moveResolver = new MoveResolverImpl(frameMap);
     }
@@ -65,7 +64,7 @@
 
         @Override
         protected CiValue scratchRegister(Variable spilled) {
-            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = registerConfig.getCategorizedAllocatableRegisters();
+            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
             CiRegister[] availableRegs = categorizedRegs.get(spilled.flag);
             for (CiRegister reg : availableRegs) {
                 if (curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null) {
@@ -110,7 +109,7 @@
     }
 
     private boolean isAllocatableRegister(CiValue value) {
-        return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
     }
 
 
@@ -132,7 +131,7 @@
     private LIRInstruction curInstruction;
 
     public void execute() {
-        assert LIRVerifier.verify(true, lir, frameMap, registerConfig);
+        assert LIRVerifier.verify(true, lir, frameMap);
 
         dataFlow.execute();
         allocate();
@@ -144,13 +143,13 @@
         resolveDataFlow.execute();
 
         context.observable.fireCompilationEvent("After resolve data flow", lir);
-        assert RegisterVerifier.verify(lir, frameMap, registerConfig);
+        assert RegisterVerifier.verify(lir, frameMap);
 
         AssignRegisters assignRegisters = new AssignRegistersImpl(lir, frameMap);
         assignRegisters.execute();
 
         context.observable.fireCompilationEvent("After register asignment", lir);
-        assert LIRVerifier.verify(true, lir, frameMap, registerConfig);
+        assert LIRVerifier.verify(true, lir, frameMap);
     }
 
     private void allocate() {
@@ -404,7 +403,7 @@
             }
         }
 
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = registerConfig.getCategorizedAllocatableRegisters();
+        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
         CiRegister[] availableRegs = categorizedRegs.get(variable.flag);
 
         for (CiRegister reg : availableRegs) {
@@ -457,7 +456,7 @@
     }
 
     private boolean checkNoCallerSavedRegister() {
-        for (CiRegister reg : registerConfig.getCallerSaveRegisters()) {
+        for (CiRegister reg : frameMap.registerConfig.getCallerSaveRegisters()) {
             assert curOutRegisterState[reg.number] == null || curOutRegisterState[reg.number] == curInstruction : "caller saved register in use accross call site";
         }
         return true;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java	Fri Jan 13 18:46:56 2012 +0100
@@ -28,7 +28,6 @@
 import java.util.*;
 
 import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.OperandFlag;
@@ -41,7 +40,6 @@
 public final class LIRVerifier {
     private final LIR lir;
     private final FrameMap frameMap;
-    private final RiRegisterConfig registerConfig;
 
     private final boolean beforeRegisterAllocation;
 
@@ -60,7 +58,7 @@
     }
 
     private boolean isAllocatableRegister(CiValue value) {
-        return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+        return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
     }
 
     public static boolean verify(final LIRInstruction op) {
@@ -74,18 +72,17 @@
         return true;
     }
 
-    public static boolean verify(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap, RiRegisterConfig registerConfig) {
-        LIRVerifier verifier = new LIRVerifier(beforeRegisterAllocation, lir, frameMap, registerConfig);
+    public static boolean verify(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap) {
+        LIRVerifier verifier = new LIRVerifier(beforeRegisterAllocation, lir, frameMap);
         verifier.verify();
         return true;
     }
 
 
-    private LIRVerifier(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap, RiRegisterConfig registerConfig) {
+    private LIRVerifier(boolean beforeRegisterAllocation, LIR lir, FrameMap frameMap) {
         this.beforeRegisterAllocation = beforeRegisterAllocation;
         this.lir = lir;
         this.frameMap = frameMap;
-        this.registerConfig = registerConfig;
         this.blockLiveOut = new BitSet[lir.linearScanOrder().size()];
         this.variableDefinitions = new Object[lir.numVariables()];
     }
@@ -120,7 +117,7 @@
 
                 op.forEachInput(useProc);
                 if (op.hasCall()) {
-                    for (CiRegister register : registerConfig.getCallerSaveRegisters()) {
+                    for (CiRegister register : frameMap.registerConfig.getCallerSaveRegisters()) {
                         curRegistersLive[register.number] = null;
                     }
                 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/RegisterVerifier.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/RegisterVerifier.java	Fri Jan 13 18:46:56 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.alloc.util;
 
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static com.oracle.max.graal.alloc.util.ValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
@@ -36,7 +36,6 @@
 
 public final class RegisterVerifier {
     private final FrameMap frameMap;
-    private final RiRegisterConfig registerConfig;
 
     /**
      * All blocks that must be processed.
@@ -70,16 +69,15 @@
         return new HashMap<>(inputState);
     }
 
-    public static boolean verify(LIR lir, FrameMap frameMap, RiRegisterConfig registerConfig) {
-        RegisterVerifier verifier = new RegisterVerifier(lir, frameMap, registerConfig);
+    public static boolean verify(LIR lir, FrameMap frameMap) {
+        RegisterVerifier verifier = new RegisterVerifier(lir, frameMap);
         verifier.verify(lir.startBlock());
         return true;
     }
 
     @SuppressWarnings("unchecked")
-    private RegisterVerifier(LIR lir, FrameMap frameMap, RiRegisterConfig registerConfig) {
+    private RegisterVerifier(LIR lir, FrameMap frameMap) {
         this.frameMap = frameMap;
-        this.registerConfig = registerConfig;
         this.workList = new LinkedList<>();
         this.blockStates = new Map[lir.linearScanOrder().size()];
     }
@@ -162,7 +160,7 @@
         Iterator<Object> iter = curInputState.keySet().iterator();
         while (iter.hasNext()) {
             Object value1 = iter.next();
-            if (value1 instanceof CiRegister && registerConfig.getAttributesMap()[((CiRegister) value1).number].isCallerSave) {
+            if (value1 instanceof CiRegister && frameMap.registerConfig.getAttributesMap()[((CiRegister) value1).number].isCallerSave) {
                 assert trace("    remove caller save register %s", value1);
                 iter.remove();
             }
@@ -187,7 +185,7 @@
     }
 
     private boolean isIgnoredRegister(CiValue value) {
-        return isRegister(value) && !registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
+        return isRegister(value) && !frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable;
     }
 
     private CiValue use(CiValue value) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,396 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, 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 static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiCompiler.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.xir.*;
-import com.oracle.max.criutils.*;
-import com.oracle.max.graal.alloc.simple.*;
-import com.oracle.max.graal.compiler.alloc.*;
-import com.oracle.max.graal.compiler.asm.*;
-import com.oracle.max.graal.compiler.gen.*;
-import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.observer.*;
-import com.oracle.max.graal.compiler.phases.*;
-import com.oracle.max.graal.compiler.phases.PhasePlan.PhasePosition;
-import com.oracle.max.graal.compiler.schedule.*;
-import com.oracle.max.graal.debug.*;
-import com.oracle.max.graal.graph.*;
-import com.oracle.max.graal.nodes.*;
-import com.oracle.max.graal.nodes.virtual.*;
-
-/**
- * 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 {
-    public final GraalCompiler compiler;
-    public final RiResolvedMethod method;
-    public final RiRegisterConfig registerConfig;
-    public final FrameState placeholderState;
-
-    public final StructuredGraph graph;
-    public final CiAssumptions assumptions = GraalOptions.OptAssumptions ? new CiAssumptions() : null;
-    public NodeMap<CiValue> nodeOperands;
-
-    private FrameMap frameMap;
-
-    private LIR lir;
-
-    /**
-     * Creates a new compilation for the specified method and runtime.
-     *
-     * @param context the compilation context
-     * @param compiler the compiler
-     * @param method the method to be compiled or {@code null} if generating code for a stub
-     * @param graph the initial graph
-     * @param osrBCI the bytecode index for on-stack replacement, if requested
-     * @param stats externally supplied statistics object to be used if not {@code null}
-     * @param debugInfoLevel TODO
-     */
-    public GraalCompilation(GraalContext context, GraalCompiler compiler, RiResolvedMethod method, StructuredGraph graph, int osrBCI, DebugInfoLevel debugInfoLevel) {
-        if (osrBCI != -1) {
-            throw new CiBailout("No OSR supported");
-        }
-        this.compiler = compiler;
-        this.graph = graph;
-        this.method = method;
-        this.registerConfig = method == null ? compiler.compilerStubRegisterConfig : compiler.runtime.getRegisterConfig(method);
-        this.placeholderState = debugInfoLevel == DebugInfoLevel.REF_MAPS ? new FrameState(method, 0, 0, 0, false) : null;
-
-        if (context().isObserved() && method != null) {
-            context().observable.fireCompilationStarted(this);
-        }
-    }
-
-    public void close() {
-        // TODO(tw): Check if we can delete this method.
-    }
-
-    public LIR lir() {
-        return lir;
-    }
-
-    public CiValue operand(ValueNode valueNode) {
-        if (nodeOperands == null) {
-            return null;
-        }
-        return nodeOperands.get(valueNode);
-    }
-
-    public void setOperand(ValueNode valueNode, CiValue operand) {
-        assert operand(valueNode) == null : "operand cannot be set twice";
-        assert operand != null && isLegal(operand) : "operand must be legal";
-        assert operand.kind.stackKind() == valueNode.kind();
-        assert !(valueNode instanceof VirtualObjectNode);
-        nodeOperands.set(valueNode, operand);
-    }
-
-    /**
-     * Converts this compilation to a string.
-     * @return a string representation of this compilation
-     */
-    @Override
-    public String toString() {
-        return "compile: " + method;
-    }
-
-    /**
-     * Returns the frame map of this compilation.
-     * @return the frame map
-     */
-    public FrameMap frameMap() {
-        return frameMap;
-    }
-
-    private TargetMethodAssembler createAssembler() {
-        AbstractAssembler masm = compiler.backend.newAssembler(registerConfig);
-        TargetMethodAssembler tasm = new TargetMethodAssembler(this, masm);
-        tasm.setFrameSize(frameMap.frameSize());
-        tasm.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea());
-        return tasm;
-    }
-
-    public CiTargetMethod compile(PhasePlan plan) {
-        CiTargetMethod targetMethod;
-        try {
-            try {
-                emitHIR(plan);
-                emitLIR(compiler.xir);
-                targetMethod = emitCode();
-
-                Debug.metric("BytecodesCompiled").add(method.codeSize());
-            } catch (CiBailout bailout) {
-                throw bailout;
-            } catch (GraalInternalError e) {
-                throw e.addContext("method", CiUtil.format("%H.%n(%p):%r", method));
-            } catch (Throwable t) {
-                throw new RuntimeException("Exception while compiling: " + method, t);
-            }
-        } catch (GraalInternalError error) {
-            if (context().isObserved()) {
-                if (error.node() != null) {
-                    context().observable.fireCompilationEvent("VerificationError on Node " + error.node(), CompilationEvent.ERROR, this, error.node().graph());
-                } else if (error.graph() != null) {
-                    context().observable.fireCompilationEvent("VerificationError on Graph " + error.graph(), CompilationEvent.ERROR, this, error.graph());
-                }
-            }
-            throw error;
-        } finally {
-            if (context().isObserved()) {
-                context().observable.fireCompilationFinished(this);
-            }
-        }
-
-        return targetMethod;
-    }
-
-    /**
-     * Builds the graph, optimizes it.
-     */
-    public void emitHIR(PhasePlan plan) {
-        try {
-            context().timers.startScope("HIR");
-
-            if (graph.start().next() == null) {
-                plan.runPhases(PhasePosition.AFTER_PARSING, graph, context());
-                new DeadCodeEliminationPhase().apply(graph, context());
-            } else {
-                if (context().isObserved()) {
-                    context().observable.fireCompilationEvent("initial state", graph);
-                }
-            }
-
-            new PhiStampPhase().apply(graph);
-
-            if (GraalOptions.ProbabilityAnalysis && graph.start().probability() == 0) {
-                new ComputeProbabilityPhase().apply(graph, context());
-            }
-
-            if (GraalOptions.Intrinsify) {
-                new IntrinsificationPhase(compiler.runtime).apply(graph, context());
-            }
-
-            if (GraalOptions.Inline && !plan.isPhaseDisabled(InliningPhase.class)) {
-                new InliningPhase(compiler.target, compiler.runtime, null, assumptions, plan).apply(graph, context());
-                new DeadCodeEliminationPhase().apply(graph, context());
-                new PhiStampPhase().apply(graph);
-            }
-
-            if (GraalOptions.OptCanonicalizer) {
-                new CanonicalizerPhase(compiler.target, compiler.runtime, assumptions).apply(graph, context());
-            }
-
-            plan.runPhases(PhasePosition.HIGH_LEVEL, graph, context());
-
-            if (GraalOptions.OptLoops) {
-                graph.mark();
-                new FindInductionVariablesPhase().apply(graph, context());
-                if (GraalOptions.OptCanonicalizer) {
-                    new CanonicalizerPhase(compiler.target, compiler.runtime, true, assumptions).apply(graph, context());
-                }
-                new SafepointPollingEliminationPhase().apply(graph, context());
-            }
-
-            if (GraalOptions.EscapeAnalysis && !plan.isPhaseDisabled(EscapeAnalysisPhase.class)) {
-                new EscapeAnalysisPhase(compiler.target, compiler.runtime, assumptions, plan).apply(graph, context());
-                new PhiStampPhase().apply(graph);
-                new CanonicalizerPhase(compiler.target, compiler.runtime, assumptions).apply(graph, context());
-            }
-
-            if (GraalOptions.OptGVN) {
-                new GlobalValueNumberingPhase().apply(graph, context());
-            }
-
-            graph.mark();
-            new LoweringPhase(compiler.runtime).apply(graph, context());
-            new CanonicalizerPhase(compiler.target, compiler.runtime, true, assumptions).apply(graph, context());
-
-            if (GraalOptions.OptLoops) {
-                graph.mark();
-                new RemoveInductionVariablesPhase().apply(graph, context());
-                if (GraalOptions.OptCanonicalizer) {
-                    new CanonicalizerPhase(compiler.target, compiler.runtime, true, assumptions).apply(graph, context());
-                }
-            }
-
-            if (GraalOptions.Lower) {
-                new FloatingReadPhase().apply(graph, context());
-                if (GraalOptions.OptReadElimination) {
-                    new ReadEliminationPhase().apply(graph, context());
-                }
-            }
-            new RemovePlaceholderPhase().apply(graph, context());
-            new DeadCodeEliminationPhase().apply(graph, context());
-
-            plan.runPhases(PhasePosition.MID_LEVEL, graph, context());
-
-            plan.runPhases(PhasePosition.LOW_LEVEL, graph, context());
-
-            IdentifyBlocksPhase schedule = new IdentifyBlocksPhase(true, LIRBlock.FACTORY);
-            schedule.apply(graph, context());
-
-            if (context().isObserved()) {
-                context().observable.fireCompilationEvent("After IdentifyBlocksPhase", this, graph, schedule);
-            }
-
-            List<Block> blocks = schedule.getBlocks();
-            NodeMap<LIRBlock> valueToBlock = new NodeMap<>(graph);
-            for (Block b : blocks) {
-                for (Node i : b.getInstructions()) {
-                    valueToBlock.set(i, (LIRBlock) b);
-                }
-            }
-            LIRBlock startBlock = valueToBlock.get(graph.start());
-            assert startBlock != null;
-            assert startBlock.numberOfPreds() == 0;
-
-            context().timers.startScope("Compute Linear Scan Order");
-            try {
-                ComputeLinearScanOrder clso = new ComputeLinearScanOrder(blocks.size(), schedule.loopCount(), startBlock);
-                List<LIRBlock> linearScanOrder = clso.linearScanOrder();
-                List<LIRBlock> codeEmittingOrder = clso.codeEmittingOrder();
-
-                int z = 0;
-                for (LIRBlock b : linearScanOrder) {
-                    b.setLinearScanNumber(z++);
-                }
-
-                lir = new LIR(startBlock, linearScanOrder, codeEmittingOrder, valueToBlock, schedule.loopCount());
-
-                if (context().isObserved()) {
-                    context().observable.fireCompilationEvent("After linear scan order", this, graph, lir);
-                }
-            } catch (AssertionError t) {
-                    context().observable.fireCompilationEvent("AssertionError in ComputeLinearScanOrder", CompilationEvent.ERROR, this, graph);
-                throw t;
-            } catch (RuntimeException t) {
-                    context().observable.fireCompilationEvent("RuntimeException in ComputeLinearScanOrder", CompilationEvent.ERROR, this, graph);
-                throw t;
-            } finally {
-                context().timers.endScope();
-            }
-        } finally {
-            context().timers.endScope();
-        }
-    }
-
-    public void initFrameMap() {
-        frameMap = this.compiler.backend.newFrameMap(this);
-    }
-
-    private void emitLIR(RiXirGenerator xir) {
-        context().timers.startScope("LIR");
-        try {
-            if (GraalOptions.GenLIR) {
-                context().timers.startScope("Create LIR");
-                nodeOperands = graph.createNodeMap();
-                LIRGenerator lirGenerator = null;
-                try {
-                    initFrameMap();
-
-                    lirGenerator = compiler.backend.newLIRGenerator(this, xir);
-
-                    for (LIRBlock b : lir.linearScanOrder()) {
-                        lirGenerator.doBlock(b);
-                    }
-
-                    for (LIRBlock b : lir.linearScanOrder()) {
-                        if (b.phis != null) {
-                            b.phis.fillInputs(lirGenerator);
-                        }
-                    }
-                } finally {
-                    context().timers.endScope();
-                }
-
-                if (context().isObserved()) {
-                    context().observable.fireCompilationEvent("After LIR generation", this, graph, lir);
-                }
-                if (GraalOptions.PrintLIR && !TTY.isSuppressed()) {
-                    LIR.printLIR(lir.linearScanOrder());
-                }
-
-                if (GraalOptions.AllocSSA) {
-                    new SpillAllAllocator(context(), lir, this, registerConfig).execute();
-                } else {
-                    new LinearScan(this, lir, lirGenerator, frameMap()).allocate();
-                }
-            }
-        } catch (Error e) {
-            if (context().isObserved() && GraalOptions.PlotOnError) {
-                context().observable.fireCompilationEvent(e.getClass().getSimpleName() + " in emitLIR", CompilationEvent.ERROR, this, graph);
-            }
-            throw e;
-        } catch (RuntimeException e) {
-            if (context().isObserved() && GraalOptions.PlotOnError) {
-                context().observable.fireCompilationEvent(e.getClass().getSimpleName() + " in emitLIR", CompilationEvent.ERROR, this, graph);
-            }
-            throw e;
-        } finally {
-            context().timers.endScope();
-        }
-    }
-
-    private CiTargetMethod emitCode() {
-        if (GraalOptions.GenLIR && GraalOptions.GenCode) {
-            context().timers.startScope("Create Code");
-            try {
-                TargetMethodAssembler tasm = createAssembler();
-                lir.emitCode(tasm);
-
-                CiTargetMethod targetMethod = tasm.finishTargetMethod(method, compiler.runtime, false);
-                if (assumptions != null && !assumptions.isEmpty()) {
-                    targetMethod.setAssumptions(assumptions);
-                }
-
-                if (context().isObserved()) {
-                    context().observable.fireCompilationEvent("After code generation", this, lir, targetMethod);
-                }
-                return targetMethod;
-            } finally {
-                context().timers.endScope();
-            }
-        }
-
-        return null;
-    }
-
-    private GraalContext context() {
-        return compiler.context;
-    }
-
-    public void printGraph(String phase, Graph printedGraph) {
-        if (context().isObserved()) {
-            context().observable.fireCompilationEvent(phase, this, printedGraph);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Fri Jan 13 18:46:56 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
@@ -26,21 +26,28 @@
 
 import java.util.*;
 
+import com.oracle.max.asm.*;
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
 import com.oracle.max.cri.xir.*;
 import com.oracle.max.criutils.*;
+import com.oracle.max.graal.alloc.simple.*;
+import com.oracle.max.graal.compiler.alloc.*;
+import com.oracle.max.graal.compiler.asm.*;
+import com.oracle.max.graal.compiler.gen.*;
+import com.oracle.max.graal.compiler.lir.*;
+import com.oracle.max.graal.compiler.observer.*;
 import com.oracle.max.graal.compiler.phases.*;
-import com.oracle.max.graal.compiler.stub.*;
+import com.oracle.max.graal.compiler.phases.PhasePlan.PhasePosition;
+import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.compiler.target.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.debug.*;
+import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 
 public class GraalCompiler {
 
-    public final Map<Object, CompilerStub> stubs = new HashMap<>();
-
     public final GraalContext context;
 
     /**
@@ -63,84 +70,251 @@
      */
     public final Backend backend;
 
-    public final RiRegisterConfig compilerStubRegisterConfig;
-
-    public GraalCompiler(GraalContext context, GraalRuntime runtime, CiTarget target, RiXirGenerator xirGen, RiRegisterConfig compilerStubRegisterConfig) {
+    public GraalCompiler(GraalContext context, GraalRuntime runtime, CiTarget target, Backend backend, RiXirGenerator xirGen) {
         this.context = context;
         this.runtime = runtime;
         this.target = target;
         this.xir = xirGen;
-        this.compilerStubRegisterConfig = compilerStubRegisterConfig;
-        this.backend = Backend.create(target.arch, this);
-        init();
+        this.backend = backend;
     }
 
-    public CiTargetMethod compileMethod(RiResolvedMethod method, int osrBCI, CiCompiler.DebugInfoLevel debugInfoLevel) {
-        return compileMethod(method, osrBCI, debugInfoLevel, PhasePlan.DEFAULT);
+    public CiTargetMethod compileMethod(RiResolvedMethod method, int osrBCI, PhasePlan plan) {
+        return compileMethod(method, new StructuredGraph(method), osrBCI, plan);
     }
 
-    public CiTargetMethod compileMethod(RiResolvedMethod method, int osrBCI, CiCompiler.DebugInfoLevel debugInfoLevel, PhasePlan plan) {
-        return compileMethod(method, new StructuredGraph(method), osrBCI, debugInfoLevel, plan);
-    }
-
-    public CiTargetMethod compileMethod(final RiResolvedMethod method, StructuredGraph graph, int osrBCI, CiCompiler.DebugInfoLevel debugInfoLevel, final PhasePlan plan) {
-        final GraalCompilation compilation = new GraalCompilation(context, GraalCompiler.this, method, graph, osrBCI, debugInfoLevel);
+    public CiTargetMethod compileMethod(RiResolvedMethod method, StructuredGraph graph, int osrBCI, PhasePlan plan) {
+        if (osrBCI != -1) {
+            throw new CiBailout("No OSR supported");
+        }
         final CiTargetMethod[] result = new CiTargetMethod[1];
-        Debug.scope("CompileMethod", new Runnable() { public void run() {
-            TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
-            try {
-                result[0] = compilation.compile(plan);
-            } finally {
-                filter.remove();
-            }
+        Debug.scope("CompileMethod", new Runnable() { 
+                public void run() {
+                        TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
+                        CiAssumptions assumptions = GraalOptions.OptAssumptions ? new CiAssumptions() : null;
+                        LIR lir = emitHIR(graph, assumptions, plan);
+                        FrameMap frameMap = emitLIR(lir, graph, method);
+                        result[0] = emitCode(assumptions, method, lir, frameMap);
+                }
         }}, method);
         return result[0];
     }
 
-    private void init() {
-        final List<XirTemplate> xirTemplateStubs = xir.makeTemplates(backend.newXirAssembler());
+    /**
+     * Builds the graph, optimizes it.
+     */
+    public LIR emitHIR(StructuredGraph graph, CiAssumptions assumptions, PhasePlan plan) {
+        try {
+            context.timers.startScope("HIR");
 
-        if (xirTemplateStubs != null) {
-            for (XirTemplate template : xirTemplateStubs) {
-                TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, template.name);
+            if (graph.start().next() == null) {
+                plan.runPhases(PhasePosition.AFTER_PARSING, graph, context);
+                new DeadCodeEliminationPhase().apply(graph, context);
+            } else {
+                if (context.isObserved()) {
+                    context.observable.fireCompilationEvent("initial state", graph);
+                }
+            }
+
+            new PhiStampPhase().apply(graph);
+
+            if (GraalOptions.ProbabilityAnalysis && graph.start().probability() == 0) {
+                new ComputeProbabilityPhase().apply(graph, context);
+            }
+
+            if (GraalOptions.Intrinsify) {
+                new IntrinsificationPhase(runtime).apply(graph, context);
+            }
+
+            if (GraalOptions.Inline && !plan.isPhaseDisabled(InliningPhase.class)) {
+                new InliningPhase(target, runtime, null, assumptions, plan).apply(graph, context);
+                new DeadCodeEliminationPhase().apply(graph, context);
+                new PhiStampPhase().apply(graph);
+            }
+
+            if (GraalOptions.OptCanonicalizer) {
+                new CanonicalizerPhase(target, runtime, assumptions).apply(graph, context);
+            }
+
+            plan.runPhases(PhasePosition.HIGH_LEVEL, graph, context);
+
+            if (GraalOptions.OptLoops) {
+                graph.mark();
+                new FindInductionVariablesPhase().apply(graph, context);
+                if (GraalOptions.OptCanonicalizer) {
+                    new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph, context);
+                }
+                new SafepointPollingEliminationPhase().apply(graph, context);
+            }
+
+            if (GraalOptions.EscapeAnalysis && !plan.isPhaseDisabled(EscapeAnalysisPhase.class)) {
+                new EscapeAnalysisPhase(target, runtime, assumptions, plan).apply(graph, context);
+                new PhiStampPhase().apply(graph);
+                new CanonicalizerPhase(target, runtime, assumptions).apply(graph, context);
+            }
+
+            if (GraalOptions.OptGVN) {
+                new GlobalValueNumberingPhase().apply(graph, context);
+            }
+
+            graph.mark();
+            new LoweringPhase(runtime).apply(graph, context);
+            new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph, context);
+
+            if (GraalOptions.OptLoops) {
+                graph.mark();
+                new RemoveInductionVariablesPhase().apply(graph, context);
+                if (GraalOptions.OptCanonicalizer) {
+                    new CanonicalizerPhase(target, runtime, true, assumptions).apply(graph, context);
+                }
+            }
+
+            if (GraalOptions.Lower) {
+                new FloatingReadPhase().apply(graph, context);
+                if (GraalOptions.OptReadElimination) {
+                    new ReadEliminationPhase().apply(graph, context);
+                }
+            }
+            new RemovePlaceholderPhase().apply(graph, context);
+            new DeadCodeEliminationPhase().apply(graph, context);
+
+            plan.runPhases(PhasePosition.MID_LEVEL, graph, context);
+
+            plan.runPhases(PhasePosition.LOW_LEVEL, graph, context);
+
+            IdentifyBlocksPhase schedule = new IdentifyBlocksPhase(true, LIRBlock.FACTORY);
+            schedule.apply(graph, context);
+
+            if (context.isObserved()) {
+                context.observable.fireCompilationEvent("After IdentifyBlocksPhase", graph, schedule);
+            }
+
+            List<Block> blocks = schedule.getBlocks();
+            NodeMap<LIRBlock> valueToBlock = new NodeMap<>(graph);
+            for (Block b : blocks) {
+                for (Node i : b.getInstructions()) {
+                    valueToBlock.set(i, (LIRBlock) b);
+                }
+            }
+            LIRBlock startBlock = valueToBlock.get(graph.start());
+            assert startBlock != null;
+            assert startBlock.numberOfPreds() == 0;
+
+            context.timers.startScope("Compute Linear Scan Order");
+            try {
+                ComputeLinearScanOrder clso = new ComputeLinearScanOrder(blocks.size(), schedule.loopCount(), startBlock);
+                List<LIRBlock> linearScanOrder = clso.linearScanOrder();
+                List<LIRBlock> codeEmittingOrder = clso.codeEmittingOrder();
+
+                int z = 0;
+                for (LIRBlock b : linearScanOrder) {
+                    b.setLinearScanNumber(z++);
+                }
+
+                LIR lir = new LIR(startBlock, linearScanOrder, codeEmittingOrder, valueToBlock, schedule.loopCount());
+
+                if (context.isObserved()) {
+                    context.observable.fireCompilationEvent("After linear scan order", graph, lir);
+                }
+                return lir;
+            } catch (AssertionError t) {
+                    context.observable.fireCompilationEvent("AssertionError in ComputeLinearScanOrder", CompilationEvent.ERROR, graph);
+                throw t;
+            } catch (RuntimeException t) {
+                    context.observable.fireCompilationEvent("RuntimeException in ComputeLinearScanOrder", CompilationEvent.ERROR, graph);
+                throw t;
+            } finally {
+                context.timers.endScope();
+            }
+        } finally {
+            context.timers.endScope();
+        }
+    }
+
+    public FrameMap emitLIR(LIR lir, StructuredGraph graph, RiResolvedMethod method) {
+        context.timers.startScope("LIR");
+        try {
+            if (GraalOptions.GenLIR) {
+                context.timers.startScope("Create LIR");
+                LIRGenerator lirGenerator = null;
+                FrameMap frameMap;
                 try {
-                    stubs.put(template, backend.emit(context, template));
+                    frameMap = backend.newFrameMap(runtime.getRegisterConfig(method));
+
+                    lirGenerator = backend.newLIRGenerator(context, graph, frameMap, method, lir, xir);
+
+                    for (LIRBlock b : lir.linearScanOrder()) {
+                        lirGenerator.doBlock(b);
+                    }
+
+                    for (LIRBlock b : lir.linearScanOrder()) {
+                        if (b.phis != null) {
+                            b.phis.fillInputs(lirGenerator);
+                        }
+                    }
                 } finally {
-                    filter.remove();
+                    context.timers.endScope();
                 }
+
+                if (context.isObserved()) {
+                    context.observable.fireCompilationEvent("After LIR generation", graph, lir, lirGenerator);
+                }
+                if (GraalOptions.PrintLIR && !TTY.isSuppressed()) {
+                    LIR.printLIR(lir.linearScanOrder());
+                }
+
+                if (GraalOptions.AllocSSA) {
+                    new SpillAllAllocator(context, lir, frameMap).execute();
+                } else {
+                    new LinearScan(context, target, method, graph, lir, lirGenerator, frameMap).allocate();
+                }
+                return frameMap;
+            } else {
+                return null;
+            }
+        } catch (Error e) {
+            if (context.isObserved() && GraalOptions.PlotOnError) {
+                context.observable.fireCompilationEvent(e.getClass().getSimpleName() + " in emitLIR", CompilationEvent.ERROR, graph);
+            }
+            throw e;
+        } catch (RuntimeException e) {
+            if (context.isObserved() && GraalOptions.PlotOnError) {
+                context.observable.fireCompilationEvent(e.getClass().getSimpleName() + " in emitLIR", CompilationEvent.ERROR, graph);
+            }
+            throw e;
+        } finally {
+            context.timers.endScope();
+        }
+    }
+
+    private TargetMethodAssembler createAssembler(FrameMap frameMap, LIR lir) {
+        AbstractAssembler masm = backend.newAssembler(frameMap.registerConfig);
+        TargetMethodAssembler tasm = new TargetMethodAssembler(context, target, runtime, frameMap, lir.slowPaths, masm);
+        tasm.setFrameSize(frameMap.frameSize());
+        tasm.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea());
+        return tasm;
+    }
+
+    public CiTargetMethod emitCode(CiAssumptions assumptions, RiResolvedMethod method, LIR lir, FrameMap frameMap) {
+        if (GraalOptions.GenLIR && GraalOptions.GenCode) {
+            context.timers.startScope("Create Code");
+            try {
+                TargetMethodAssembler tasm = createAssembler(frameMap, lir);
+                lir.emitCode(tasm);
+
+                CiTargetMethod targetMethod = tasm.finishTargetMethod(method, false);
+                if (assumptions != null && !assumptions.isEmpty()) {
+                    targetMethod.setAssumptions(assumptions);
+                }
+
+                if (context.isObserved()) {
+                    context.observable.fireCompilationEvent("After code generation", lir, targetMethod);
+                }
+                return targetMethod;
+            } finally {
+                context.timers.endScope();
             }
         }
 
-        for (CompilerStub.Id id : CompilerStub.Id.values()) {
-            TTY.Filter suppressor = new TTY.Filter(GraalOptions.PrintFilter, id);
-            try {
-                stubs.put(id, backend.emit(context, id));
-            } finally {
-                suppressor.remove();
-            }
-        }
-    }
-
-    public CompilerStub lookupStub(CompilerStub.Id id) {
-        CompilerStub stub = stubs.get(id);
-        assert stub != null : "no stub for global stub id: " + id;
-        return stub;
-    }
-
-    public CompilerStub lookupStub(XirTemplate template) {
-        CompilerStub stub = stubs.get(template);
-        assert stub != null : "no stub for XirTemplate: " + template;
-        return stub;
-    }
-
-    public CompilerStub lookupStub(CiRuntimeCall runtimeCall) {
-        CompilerStub stub = stubs.get(runtimeCall);
-        if (stub == null) {
-            stub = backend.emit(context, runtimeCall);
-            stubs.put(runtimeCall, stub);
-        }
-
-        assert stub != null : "could not find global stub for runtime call: " + runtimeCall;
-        return stub;
+        return null;
     }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/IntervalWalker.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/IntervalWalker.java	Fri Jan 13 18:46:56 2012 +0100
@@ -32,7 +32,6 @@
  */
 public class IntervalWalker {
 
-    protected final GraalCompilation compilation;
     protected final LinearScan allocator;
 
     /**
@@ -91,7 +90,6 @@
      * @param unhandledAny the list of unhandled {@linkplain RegisterBinding#Any non-fixed} intervals
      */
     IntervalWalker(LinearScan allocator, Interval unhandledFixed, Interval unhandledAny) {
-        this.compilation = allocator.compilation;
         this.allocator = allocator;
 
         unhandledLists = new RegisterBindingLists(unhandledFixed, unhandledAny);
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Fri Jan 13 18:46:56 2012 +0100
@@ -37,9 +37,12 @@
 import com.oracle.max.graal.compiler.alloc.Interval.SpillState;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.lir.LIRInstruction.*;
+import com.oracle.max.graal.compiler.lir.LIRInstruction.OperandFlag;
+import com.oracle.max.graal.compiler.lir.LIRInstruction.OperandMode;
+import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.graph.*;
+import com.oracle.max.graal.nodes.*;
 
 /**
  * An implementation of the linear scan register allocator algorithm described
@@ -49,7 +52,8 @@
 public final class LinearScan {
 
     final GraalContext context;
-    final GraalCompilation compilation;
+    final CiTarget target;
+    final RiMethod method;
     final LIR ir;
     final LIRGenerator gen;
     final FrameMap frameMap;
@@ -115,17 +119,21 @@
      */
     private final int firstVariableNumber;
 
+    private final StructuredGraph graph;
 
-    public LinearScan(GraalCompilation compilation, LIR ir, LIRGenerator gen, FrameMap frameMap) {
-        this.context = compilation.compiler.context;
-        this.compilation = compilation;
+
+    public LinearScan(GraalContext context, CiTarget target, RiResolvedMethod method, StructuredGraph graph, LIR ir, LIRGenerator gen, FrameMap frameMap) {
+        this.context = context;
+        this.target = target;
+        this.method = method;
+        this.graph = graph;
         this.ir = ir;
         this.gen = gen;
         this.frameMap = frameMap;
         this.sortedBlocks = ir.linearScanOrder().toArray(new LIRBlock[ir.linearScanOrder().size()]);
-        this.registerAttributes = compilation.registerConfig.getAttributesMap();
+        this.registerAttributes = frameMap.registerConfig.getAttributesMap();
 
-        this.registers = compilation.compiler.target.arch.registers;
+        this.registers = target.arch.registers;
         this.firstVariableNumber = registers.length;
         this.variables = new ArrayList<>(ir.numVariables() * 3 / 2);
     }
@@ -814,7 +822,7 @@
     }
 
     private void reportFailure(int numBlocks) {
-        TTY.println(compilation.method.toString());
+        TTY.println(method.toString());
         TTY.println("Error: liveIn set of first block must be empty (when this fails, variables are used before they are defined)");
         TTY.print("affected registers:");
         TTY.println(ir.startBlock().liveIn.toString());
@@ -1031,15 +1039,15 @@
         }
     }
 
-    void addRegisterHint(final LIRInstruction op, final CiValue target, OperandMode mode, EnumSet<OperandFlag> flags) {
-        if (flags.contains(OperandFlag.RegisterHint) && isVariableOrRegister(target)) {
+    void addRegisterHint(final LIRInstruction op, final CiValue targetValue, OperandMode mode, EnumSet<OperandFlag> flags) {
+        if (flags.contains(OperandFlag.RegisterHint) && isVariableOrRegister(targetValue)) {
 
-            op.forEachRegisterHint(target, mode, new ValueProcedure() {
+            op.forEachRegisterHint(targetValue, mode, new ValueProcedure() {
                 @Override
                 protected CiValue doValue(CiValue registerHint) {
                     if (isVariableOrRegister(registerHint)) {
                         Interval from = intervalFor(registerHint);
-                        Interval to = intervalFor(target);
+                        Interval to = intervalFor(targetValue);
                         if (from != null && to != null) {
                             to.setLocationHint(from);
                             if (GraalOptions.TraceLinearScanLevel >= 4) {
@@ -1059,8 +1067,7 @@
         intervals = new Interval[intervalsSize + INITIAL_SPLIT_INTERVALS_CAPACITY];
 
         // create a list with all caller-save registers (cpu, fpu, xmm)
-        RiRegisterConfig registerConfig = compilation.registerConfig;
-        CiRegister[] callerSaveRegs = registerConfig.getCallerSaveRegisters();
+        CiRegister[] callerSaveRegs = frameMap.registerConfig.getCallerSaveRegisters();
 
         // iterate all blocks in reverse order
         for (int i = blockCount() - 1; i >= 0; i--) {
@@ -1339,7 +1346,7 @@
         notPrecoloredIntervals = result.second;
 
         // allocate cpu registers
-        LinearScanWalker lsw = new LinearScanWalker(this, precoloredIntervals, notPrecoloredIntervals);
+        LinearScanWalker lsw = new LinearScanWalker(this, precoloredIntervals, notPrecoloredIntervals, !target.arch.isX86());
         lsw.walk();
         lsw.finishAllocation();
     }
@@ -1542,12 +1549,12 @@
                 }
 
                 case Float: {
-                    assert !compilation.compiler.target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
+                    assert !target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
                     break;
                 }
 
                 case Double: {
-                    assert !compilation.compiler.target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
+                    assert !target.arch.isX86() || reg.isFpu() : "not xmm register: " + reg;
                     break;
                 }
 
@@ -1869,7 +1876,7 @@
         }
 
         if (context.isObserved()) {
-            context.observable.fireCompilationEvent(label, compilation, this, Arrays.copyOf(intervals, intervalsSize));
+            context.observable.fireCompilationEvent(label, graph, this, Arrays.copyOf(intervals, intervalsSize));
         }
     }
 
@@ -1882,7 +1889,7 @@
         }
 
         if (context.isObserved()) {
-            context.observable.fireCompilationEvent(label, compilation, hirValid ? compilation.graph : null, compilation.lir());
+            context.observable.fireCompilationEvent(label, hirValid ? graph : null, ir);
         }
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScanWalker.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScanWalker.java	Fri Jan 13 18:46:56 2012 +0100
@@ -42,6 +42,8 @@
  */
 final class LinearScanWalker extends IntervalWalker {
 
+    private final boolean hasCalleeSavedRegisters;
+
     private CiRegister[] availableRegs;
 
     private final int[] usePos;
@@ -51,6 +53,7 @@
 
     private MoveResolver moveResolver; // for ordering spill moves
 
+
     // accessors mapped to same functions in class LinearScan
     int blockCount() {
         return allocator.blockCount();
@@ -64,8 +67,9 @@
         return allocator.blockForId(opId);
     }
 
-    LinearScanWalker(LinearScan allocator, Interval unhandledFixedFirst, Interval unhandledAnyFirst) {
+    LinearScanWalker(LinearScan allocator, Interval unhandledFixedFirst, Interval unhandledAnyFirst, boolean hasCalleeSavedRegisters) {
         super(allocator, unhandledFixedFirst, unhandledAnyFirst);
+        this.hasCalleeSavedRegisters = hasCalleeSavedRegisters;
         moveResolver = new MoveResolver(allocator);
         spillIntervals = Util.uncheckedCast(new List[allocator.registers.length]);
         for (int i = 0; i < allocator.registers.length; i++) {
@@ -789,7 +793,7 @@
 
     boolean noAllocationPossible(Interval interval) {
 
-        if (compilation.compiler.target.arch.isX86()) {
+        if (!hasCalleeSavedRegisters) {
             // fast calculation of intervals that can never get a register because the
             // the next instruction is a call that blocks all registers
             // Note: this does not work if callee-saved registers are available (e.g. on Sparc)
@@ -815,7 +819,7 @@
     }
 
     void initVarsForAlloc(Interval interval) {
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = allocator.compilation.registerConfig.getCategorizedAllocatableRegisters();
+        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = allocator.frameMap.registerConfig.getCategorizedAllocatableRegisters();
         availableRegs = categorizedRegs.get(asVariable(interval.operand).flag);
     }
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java	Fri Jan 13 18:46:56 2012 +0100
@@ -30,7 +30,6 @@
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.util.*;
 
 /**
  */
@@ -193,7 +192,7 @@
 
     private void insertMove(Interval fromInterval, Interval toInterval) {
         assert fromInterval.operand != toInterval.operand : "from and to interval equal: " + fromInterval;
-        assert Util.archKindsEqual(fromInterval.kind(), toInterval.kind()) : "move between different types";
+        assert fromInterval.kind() == toInterval.kind() : "move between different types";
         assert insertIdx != -1 : "must setup insert position first";
 
         CiValue fromOpr = fromInterval.operand;
@@ -207,7 +206,7 @@
     }
 
     private void insertMove(CiValue fromOpr, Interval toInterval) {
-        assert Util.archKindsEqual(fromOpr.kind, toInterval.kind()) : "move between different types";
+        assert fromOpr.kind == toInterval.kind() : "move between different types";
         assert insertIdx != -1 : "must setup insert position first";
 
         CiValue toOpr = toInterval.operand;
@@ -331,7 +330,7 @@
         }
 
         assert fromInterval.operand != toInterval.operand : "from and to interval equal: " + fromInterval;
-        assert Util.archKindsEqual(fromInterval.kind(), toInterval.kind());
+        assert fromInterval.kind() == toInterval.kind();
         mappingFrom.add(fromInterval);
         mappingFromOpr.add(CiValue.IllegalValue);
         mappingTo.add(toInterval);
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Fri Jan 13 18:46:56 2012 +0100
@@ -42,10 +42,6 @@
     ArrayMap<Interval[]> savedStates; // saved information of previous check
 
     // simplified access to methods of LinearScan
-    GraalCompilation compilation() {
-        return allocator.compilation;
-    }
-
     Interval intervalAt(CiValue operand) {
         return allocator.intervalFor(operand);
     }
@@ -249,7 +245,7 @@
             op.forEachInput(useProc);
             // invalidate all caller save registers at calls
             if (op.hasCall()) {
-                for (CiRegister r : allocator.compilation.registerConfig.getCallerSaveRegisters()) {
+                for (CiRegister r : allocator.frameMap.registerConfig.getCallerSaveRegisters()) {
                     statePut(inputState, r.asValue(), null);
                 }
             }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java	Fri Jan 13 18:46:56 2012 +0100
@@ -32,22 +32,31 @@
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
+import com.oracle.max.graal.compiler.lir.LIR.SlowPath;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.debug.*;
 
 public class TargetMethodAssembler {
-    public final GraalCompilation compilation;
+
     public final AbstractAssembler asm;
     public final CiTargetMethod targetMethod;
     public final CiTarget target;
+    public final RiRuntime runtime;
+    public final FrameMap frameMap;
+    public final List<SlowPath> slowPaths;
+
     private List<ExceptionInfo> exceptionInfoList;
     private int lastSafepointPos;
+    private final GraalContext context;
 
-    public TargetMethodAssembler(GraalCompilation compilation, AbstractAssembler asm) {
-        this.compilation = compilation;
+    public TargetMethodAssembler(GraalContext context, CiTarget target, RiRuntime runtime, FrameMap frameMap, List<SlowPath> slowPaths, AbstractAssembler asm) {
+        this.context = context;
+        this.target = target;
+        this.runtime = runtime;
+        this.frameMap = frameMap;
+        this.slowPaths = slowPaths;
         this.asm = asm;
         this.targetMethod = new CiTargetMethod();
-        this.target = compilation.compiler.target;
         // 0 is a valid pc for safepoints in template methods
         this.lastSafepointPos = -1;
     }
@@ -64,7 +73,7 @@
         targetMethod.addAnnotation(new CiTargetMethod.CodeComment(asm.codeBuffer.position(), s));
     }
 
-    public CiTargetMethod finishTargetMethod(Object name, RiRuntime runtime, boolean isStub) {
+    public CiTargetMethod finishTargetMethod(Object name, boolean isStub) {
         // Install code, data and frame size
         targetMethod.setTargetCode(asm.codeBuffer.close(false), asm.codeBuffer.position());
 
@@ -224,10 +233,18 @@
         return recordDataReferenceInCode((CiConstant) value, alignment);
     }
 
+    /**
+     * Returns the address of a long constant that is embedded as a data references into the code.
+     */
+    public CiAddress asLongConstRef(CiValue value) {
+        assert value.kind == CiKind.Long && isConstant(value);
+        return recordDataReferenceInCode((CiConstant) value, 8);
+    }
+
     public CiAddress asAddress(CiValue value) {
         if (isStackSlot(value)) {
             CiStackSlot slot = (CiStackSlot) value;
-            return new CiAddress(slot.kind, compilation.registerConfig.getFrameRegister().asValue(), compilation.frameMap().offsetForStackSlot(slot));
+            return new CiAddress(slot.kind, frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot));
         }
         return (CiAddress) value;
     }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java	Fri Jan 13 18:46:56 2012 +0100
@@ -26,28 +26,23 @@
 import java.util.Map.Entry;
 
 import com.oracle.max.cri.ci.*;
-import com.oracle.max.graal.compiler.*;
-import com.oracle.max.graal.compiler.gen.LIRGenerator.*;
+import com.oracle.max.graal.compiler.gen.LIRGenerator.LockScope;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.virtual.*;
 
 public class DebugInfoBuilder {
-    public final GraalCompilation compilation;
+    private final NodeMap<CiValue> nodeOperands;
 
-    public DebugInfoBuilder(GraalCompilation compilation) {
-        this.compilation = compilation;
+    public DebugInfoBuilder(NodeMap<CiValue> nodeOperands) {
+        this.nodeOperands = nodeOperands;
     }
 
 
     private HashMap<VirtualObjectNode, CiVirtualObject> virtualObjects = new HashMap<>();
 
     public LIRDebugInfo build(FrameState topState, LockScope locks, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
-        if (compilation.placeholderState != null) {
-            return null;
-        }
-
         assert virtualObjects.size() == 0;
         CiFrame frame = computeFrameForState(topState, locks);
 
@@ -158,8 +153,8 @@
             return ((ConstantNode) value).value;
 
         } else if (value != null) {
-            CiValue operand = compilation.operand(value);
-            assert operand != null && operand instanceof Variable || operand instanceof CiConstant;
+            CiValue operand = nodeOperands.get(value);
+            assert operand != null && (operand instanceof Variable || operand instanceof CiConstant);
             return operand;
 
         } else {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Fri Jan 13 18:46:56 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.compiler.gen;
 
-import static com.oracle.max.graal.compiler.lir.StandardOpcode.*;
 import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
 import static com.oracle.max.cri.ci.CiValue.*;
 import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static com.oracle.max.cri.util.MemoryBarriers.*;
 import static com.oracle.max.graal.alloc.util.ValueUtil.*;
+import static com.oracle.max.graal.compiler.lir.StandardOpcode.*;
 
 import java.lang.reflect.*;
 import java.util.*;
@@ -48,7 +48,6 @@
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.schedule.*;
-import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.debug.*;
 import com.oracle.max.graal.graph.*;
@@ -59,13 +58,21 @@
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.spi.*;
+import com.oracle.max.graal.nodes.virtual.*;
 
 /**
  * This class traverses the HIR instructions and generates LIR instructions from them.
  */
 public abstract class LIRGenerator extends LIRGeneratorTool {
     public final GraalContext context;
-    public final GraalCompilation compilation;
+
+    protected final Graph graph;
+    protected final RiRuntime runtime;
+    protected final CiTarget target;
+    protected final RiResolvedMethod method;
+    protected final FrameMap frameMap;
+    public final NodeMap<CiValue> nodeOperands;
+
     protected final LIR lir;
     protected final XirSupport xirSupport;
     protected final RiXirGenerator xir;
@@ -132,19 +139,24 @@
     private LockScope curLocks;
 
 
-    public LIRGenerator(GraalCompilation compilation, RiXirGenerator xir) {
-        this.context = compilation.compiler.context;
-        this.compilation = compilation;
-        this.lir = compilation.lir();
+    public LIRGenerator(GraalContext context, Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
+        this.context = context;
+        this.graph = graph;
+        this.runtime = runtime;
+        this.target = target;
+        this.frameMap = frameMap;
+        this.method = method;
+        this.nodeOperands = graph.createNodeMap();
+        this.lir = lir;
         this.xir = xir;
         this.xirSupport = new XirSupport();
-        this.debugInfoBuilder = new DebugInfoBuilder(compilation);
+        this.debugInfoBuilder = new DebugInfoBuilder(nodeOperands);
         this.blockLocks = new LockScope[lir.linearScanOrder().size()];
     }
 
     @Override
     public CiTarget target() {
-        return compilation.compiler.target;
+        return target;
     }
 
     private LockScope locksFor(LIRBlock block) {
@@ -162,7 +174,10 @@
      */
     @Override
     public CiValue operand(ValueNode node) {
-        return compilation.operand(node);
+        if (nodeOperands == null) {
+            return null;
+        }
+        return nodeOperands.get(node);
     }
 
     /**
@@ -191,7 +206,11 @@
     public CiValue setResult(ValueNode x, CiValue operand) {
         assert (isVariable(operand) && x.kind() == operand.kind) || (isConstant(operand) && x.kind() == operand.kind.stackKind()) : operand.kind + " for node " + x;
 
-        compilation.setOperand(x, operand);
+        assert operand(x) == null : "operand cannot be set twice";
+        assert operand != null && isLegal(operand) : "operand must be legal";
+        assert operand.kind.stackKind() == x.kind();
+        assert !(x instanceof VirtualObjectNode);
+        nodeOperands.set(x, operand);
         return operand;
     }
 
@@ -255,7 +274,7 @@
         if (kind == CiKind.Void) {
             return IllegalValue;
         }
-        return compilation.registerConfig.getReturnRegister(kind).asValue(kind);
+        return frameMap.registerConfig.getReturnRegister(kind).asValue(kind);
     }
 
 
@@ -406,7 +425,7 @@
         emitNode(instr);
 
         if (GraalOptions.TraceLIRVisit) {
-            TTY.println("Operand for " + instr + " = " + compilation.operand(instr));
+            TTY.println("Operand for " + instr + " = " + operand(instr));
         }
     }
 
@@ -420,7 +439,7 @@
     }
 
     private void emitPrologue() {
-        CiCallingConvention incomingArguments = compilation.registerConfig.getCallingConvention(JavaCallee, CiUtil.signatureToKinds(compilation.method), compilation.compiler.target, false);
+        CiCallingConvention incomingArguments = frameMap.registerConfig.getCallingConvention(JavaCallee, CiUtil.signatureToKinds(method), target, false);
 
         CiValue[] params = new CiValue[incomingArguments.locations.length];
         for (int i = 0; i < params.length; i++) {
@@ -428,12 +447,12 @@
         }
         append(PARAMS.create(params));
 
-        XirSnippet prologue = xir.genPrologue(null, compilation.method);
+        XirSnippet prologue = xir.genPrologue(null, method);
         if (prologue != null) {
             emitXir(prologue, null, null, null, false);
         }
 
-        for (LocalNode local : compilation.graph.getNodes(LocalNode.class)) {
+        for (LocalNode local : graph.getNodes(LocalNode.class)) {
             CiValue param = params[local.index()];
             assert param.kind == local.kind().stackKind();
             setResult(local, emitMove(param));
@@ -441,9 +460,9 @@
     }
 
     private boolean checkStartOperands(Node node, FrameState fs) {
-        if (!Modifier.isNative(compilation.method.accessFlags())) {
+        if (!Modifier.isNative(method.accessFlags())) {
             if (node == ((StructuredGraph) node.graph()).start()) {
-                CiKind[] arguments = CiUtil.signatureToKinds(compilation.method);
+                CiKind[] arguments = CiUtil.signatureToKinds(method);
                 int slot = 0;
                 for (CiKind kind : arguments) {
                     ValueNode arg = fs.localAt(slot);
@@ -477,9 +496,9 @@
 
     @Override
     public void visitMonitorEnter(MonitorEnterNode x) {
-        CiStackSlot lockData = compilation.frameMap().allocateStackBlock(compilation.compiler.runtime.sizeOfLockData(), false);
+        CiStackSlot lockData = frameMap.allocateStackBlock(runtime.sizeOfLockData(), false);
         if (x.eliminated()) {
-            // No code is emitted for elimianted locks, but for proper debug information generation we need to
+            // No code is emitted for eliminated locks, but for proper debug information generation we need to
             // register the monitor and its lock data.
             curLocks = new LockScope(curLocks, x.stateAfter().outerFrameState(), x, lockData);
             return;
@@ -491,7 +510,7 @@
         LIRDebugInfo stateBefore = state();
         // The state before the monitor enter is used for null checks, so it must not contain the newly locked object.
         curLocks = new LockScope(curLocks, x.stateAfter().outerFrameState(), x, lockData);
-        // The state after the monitor enter is used for deotpimization, after the montior has blocked, so it must contain the newly locked object.
+        // The state after the monitor enter is used for deoptimization, after the monitor has blocked, so it must contain the newly locked object.
         LIRDebugInfo stateAfter = stateFor(x.stateAfter());
 
         XirSnippet snippet = xir.genMonitorEnter(site(x), obj, lockAddress);
@@ -611,9 +630,9 @@
             operand = resultOperandFor(x.kind());
             emitMove(operand(x.result()), operand);
         }
-        XirSnippet epilogue = xir.genEpilogue(site(x), compilation.method);
+        XirSnippet epilogue = xir.genEpilogue(site(x), method);
         if (epilogue != null) {
-            emitXir(epilogue, x, null, compilation.method, false);
+            emitXir(epilogue, x, null, method, false);
             append(StandardOpcode.RETURN.create(operand));
         }
     }
@@ -698,7 +717,7 @@
         LIRDebugInfo info = state();
         XirArgument clazz = toXirArgument(node.type().getEncoding(Representation.ObjectHub));
         XirSnippet typeCheck = xir.genTypeCheck(site(node), toXirArgument(node.object()), clazz, node.type());
-        emitXir(typeCheck, node, info, compilation.method, false);
+        emitXir(typeCheck, node, info, method, false);
     }
 
 
@@ -835,27 +854,27 @@
     @Override
     public void emitInvoke(Invoke x) {
         MethodCallTargetNode callTarget = x.callTarget();
-        RiMethod target = callTarget.targetMethod();
+        RiMethod targetMethod = callTarget.targetMethod();
 
         XirSnippet snippet = null;
         XirArgument receiver;
         switch (callTarget.invokeKind()) {
             case Static:
-                snippet = xir.genInvokeStatic(site(x.node()), target);
+                snippet = xir.genInvokeStatic(site(x.node()), targetMethod);
                 break;
             case Special:
                 receiver = toXirArgument(callTarget.receiver());
-                snippet = xir.genInvokeSpecial(site(x.node()), receiver, target);
+                snippet = xir.genInvokeSpecial(site(x.node()), receiver, targetMethod);
                 break;
             case Virtual:
                 assert callTarget.receiver().kind() == CiKind.Object : callTarget + ": " + callTarget.targetMethod().toString();
                 receiver = toXirArgument(callTarget.receiver());
-                snippet = xir.genInvokeVirtual(site(x.node()), receiver, target);
+                snippet = xir.genInvokeVirtual(site(x.node()), receiver, targetMethod);
                 break;
             case Interface:
                 assert callTarget.receiver().kind() == CiKind.Object : callTarget;
                 receiver = toXirArgument(callTarget.receiver());
-                snippet = xir.genInvokeInterface(site(x.node()), receiver, target);
+                snippet = xir.genInvokeInterface(site(x.node()), receiver, targetMethod);
                 break;
         }
 
@@ -870,8 +889,8 @@
         CiValue resultOperand = resultOperandFor(x.node().kind());
 
         CiKind[] signature = CiUtil.signatureToKinds(callTarget.targetMethod().signature(), callTarget.isStatic() ? null : callTarget.targetMethod().holder().kind(true));
-        CiCallingConvention cc = compilation.registerConfig.getCallingConvention(JavaCall, signature, target(), false);
-        compilation.frameMap().callsMethod(cc, JavaCall);
+        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(JavaCall, signature, target(), false);
+        frameMap.callsMethod(cc, JavaCall);
         List<CiStackSlot> pointerSlots = new ArrayList<>(2);
         List<CiValue> argList = visitInvokeArguments(cc, callTarget.arguments(), pointerSlots);
 
@@ -887,10 +906,10 @@
         if (destinationAddress instanceof CiConstant) {
             // Direct call
             assert ((CiConstant) destinationAddress).isDefaultValue() : "destination address should be zero";
-            append(StandardOpcode.DIRECT_CALL.create(target, resultOperand, argList, null, callInfo, snippet.marks));
+            append(StandardOpcode.DIRECT_CALL.create(targetMethod, resultOperand, argList, null, callInfo, snippet.marks));
         } else {
             // Indirect call
-            append(StandardOpcode.INDIRECT_CALL.create(target, resultOperand, argList, destinationAddress, callInfo, snippet.marks));
+            append(StandardOpcode.INDIRECT_CALL.create(targetMethod, resultOperand, argList, destinationAddress, callInfo, snippet.marks));
         }
 
         if (isLegal(resultOperand)) {
@@ -950,8 +969,8 @@
         List<CiValue> argumentList;
         if (arguments.length > 0) {
             // move the arguments into the correct location
-            CiCallingConvention cc = compilation.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
-            compilation.frameMap().callsMethod(cc, RuntimeCall);
+            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
+            frameMap.callsMethod(cc, RuntimeCall);
             assert cc.locations.length == args.length : "argument count mismatch";
             for (int i = 0; i < args.length; i++) {
                 CiValue arg = args[i];
@@ -979,8 +998,8 @@
         // TODO Merge with emitCallToRuntime() method above.
 
         CiValue resultOperand = resultOperandFor(x.kind());
-        CiCallingConvention cc = compilation.registerConfig.getCallingConvention(RuntimeCall, x.call().arguments, target(), false);
-        compilation.frameMap().callsMethod(cc, RuntimeCall);
+        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, x.call().arguments, target(), false);
+        frameMap.callsMethod(cc, RuntimeCall);
         List<CiStackSlot> pointerSlots = new ArrayList<>(2);
         List<CiValue> argList = visitInvokeArguments(cc, x.arguments(), pointerSlots);
 
@@ -1001,18 +1020,6 @@
         }
     }
 
-    protected CompilerStub stubFor(CompilerStub.Id id) {
-        CompilerStub stub = compilation.compiler.lookupStub(id);
-        compilation.frameMap().usesStub(stub);
-        return stub;
-    }
-
-    protected CompilerStub stubFor(XirTemplate template) {
-        CompilerStub stub = compilation.compiler.lookupStub(template);
-        compilation.frameMap().usesStub(stub);
-        return stub;
-    }
-
     @Override
     public void emitLookupSwitch(LookupSwitchNode x) {
         Variable tag = load(operand(x.value()));
@@ -1205,18 +1212,18 @@
         return variable;
     }
 
-    protected CiValue emitXir(XirSnippet snippet, ValueNode x, LIRDebugInfo info, RiMethod method, boolean setInstructionResult) {
-        return emitXir(snippet, x, info, null, method, setInstructionResult);
+    protected CiValue emitXir(XirSnippet snippet, ValueNode x, LIRDebugInfo info, RiMethod currentMethod, boolean setInstructionResult) {
+        return emitXir(snippet, x, info, null, currentMethod, setInstructionResult);
     }
 
-    protected CiValue emitXir(XirSnippet snippet, ValueNode instruction, LIRDebugInfo info, LIRDebugInfo infoAfter, RiMethod method, boolean setInstructionResult) {
+    protected CiValue emitXir(XirSnippet snippet, ValueNode instruction, LIRDebugInfo info, LIRDebugInfo infoAfter, RiMethod currentMethod, boolean setInstructionResult) {
         if (GraalOptions.PrintXirTemplates) {
             TTY.println("Emit XIR template " + snippet.template.name);
         }
 
         final CiValue[] operandsArray = new CiValue[snippet.template.variableCount];
 
-        compilation.frameMap().reserveOutgoing(snippet.template.outgoingStackSize);
+        frameMap.reserveOutgoing(snippet.template.outgoingStackSize);
 
         XirOperand resultOperand = snippet.template.resultOperand;
 
@@ -1247,11 +1254,6 @@
             }
         }
 
-        for (XirTemplate calleeTemplate : snippet.template.calleeTemplates) {
-            // TODO Save these for use in AMD64LIRAssembler
-            stubFor(calleeTemplate);
-        }
-
         for (XirConstant c : snippet.template.constants) {
             assert operandsArray[c.index] == null;
             operandsArray[c.index] = c.value;
@@ -1299,7 +1301,7 @@
         }
 
         if (setInstructionResult && isLegal(allocatedResultOperand)) {
-            CiValue operand = compilation.operand(instruction);
+            CiValue operand = operand(instruction);
             if (operand == null) {
                 setResult(instruction, allocatedResultOperand);
             } else {
@@ -1314,7 +1316,7 @@
             append(StandardOpcode.XIR.create(snippet, operandsArray, allocatedResultOperand,
                     inputOperandArray, tempOperandArray, inputOperandIndicesArray, tempOperandIndicesArray,
                     (allocatedResultOperand == IllegalValue) ? -1 : resultOperand.index,
-                    info, infoAfter, method));
+                    info, infoAfter, currentMethod));
             Debug.metric("LIRXIRInstructions").increment();
         }
 
@@ -1331,8 +1333,8 @@
         List<CiValue> argumentList;
         if (arguments.length > 0) {
             // move the arguments into the correct location
-            CiCallingConvention cc = compilation.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
-            compilation.frameMap().callsMethod(cc, RuntimeCall);
+            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
+            frameMap.callsMethod(cc, RuntimeCall);
             assert cc.locations.length == args.length : "argument count mismatch";
             for (int i = 0; i < args.length; i++) {
                 CiValue arg = args[i];
@@ -1483,4 +1485,8 @@
             return "XirSupport<" + current + ">";
         }
     }
+
+    public FrameMap frameMap() {
+        return frameMap;
+    }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/FrameMap.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/FrameMap.java	Fri Jan 13 18:46:56 2012 +0100
@@ -22,14 +22,13 @@
  */
 package com.oracle.max.graal.compiler.lir;
 
-import static com.oracle.max.graal.alloc.util.ValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiCallingConvention.*;
+import com.oracle.max.cri.ci.CiCallingConvention.Type;
 import com.oracle.max.cri.ri.*;
-import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
 
 /**
@@ -213,18 +212,6 @@
     }
 
     /**
-     * Informs the frame map that the compiled code uses a particular compiler stub, which
-     * may need stack space for outgoing arguments.
-     * @param stub The compiler stub.
-     */
-    public void usesStub(CompilerStub stub) {
-        // TODO look at the actual stack slot offsets?
-        int argsSize = stub.inArgs.length * target.wordSize;
-        int resultSize = stub.resultKind.isVoid() ? 0 : target.wordSize;
-        reserveOutgoing(Math.max(argsSize, resultSize));
-    }
-
-    /**
      * Reserves space for stack-based outgoing arguments.
      * @param argsSize The amount of space (in bytes) to reserve for stack-based outgoing arguments.
      */
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIR.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIR.java	Fri Jan 13 18:46:56 2012 +0100
@@ -64,8 +64,7 @@
     public SlowPath methodEndMarker;
 
     private int numVariables;
-    private int numLoops;
-
+    private final int numLoops;
 
     public interface SlowPath {
         void emitCode(TargetMethodAssembler tasm);
@@ -73,6 +72,7 @@
 
     /**
      * Creates a new LIR instance for the specified compilation.
+     * @param loopCount number of loops
      * @param compilation the compilation
      */
     public LIR(LIRBlock startBlock, List<LIRBlock> linearScanOrder, List<LIRBlock> codeEmittingOrder, NodeMap<LIRBlock> valueToBlock, int numLoops) {
@@ -81,6 +81,7 @@
         this.startBlock = startBlock;
         this.valueToBlock = valueToBlock;
         this.numLoops = numLoops;
+        this.loopCount = loopCount;
 
         slowPaths = new ArrayList<>();
         deoptimizationStubs = new ArrayList<>();
@@ -106,6 +107,10 @@
         return valueToBlock;
     }
 
+    public int loopCount() {
+        return loopCount;
+    }
+
     public int numVariables() {
         return numVariables;
     }
@@ -185,7 +190,7 @@
     private void printAssembly(TargetMethodAssembler tasm) {
         byte[] currentBytes = tasm.asm.codeBuffer.copyData(lastDecodeStart, tasm.asm.codeBuffer.position());
         if (currentBytes.length > 0) {
-            String disasm = tasm.compilation.compiler.runtime.disassemble(currentBytes, lastDecodeStart);
+            String disasm = tasm.runtime.disassemble(currentBytes, lastDecodeStart);
             if (disasm.length() != 0) {
                 TTY.println(disasm);
             } else {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationEvent.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationEvent.java	Fri Jan 13 18:46:56 2012 +0100
@@ -22,6 +22,8 @@
  */
 package com.oracle.max.graal.compiler.observer;
 
+import java.util.*;
+
 /**
  * An event that occurred during compilation. Instances of this class provide information about the event and the state
  * of the compilation when the event was raised. Depending on the state of the compiler and the compilation phase,
@@ -36,16 +38,17 @@
     public static final Object ERROR = new Object() {};
 
     public final String label;
-    private Object[] debugObjects;
+    private List<Object> debugObjects;
 
-    protected CompilationEvent(String label, Object...debugObjects) {
+    protected CompilationEvent(String label, ArrayList<Object> debugObjects) {
         this.label = label;
         this.debugObjects = debugObjects;
     }
 
     @SuppressWarnings("unchecked")
     public <T> T debugObject(Class<T> type) {
-        for (Object o : debugObjects) {
+        for (ListIterator<Object> iter = debugObjects.listIterator(debugObjects.size()); iter.hasPrevious();) {
+            Object o = iter.previous();
             if (type.isInstance(o)) {
                 return (T) o;
             }
@@ -54,7 +57,8 @@
     }
 
     public boolean hasDebugObject(Object search) {
-        for (Object o : debugObjects) {
+        for (ListIterator<Object> iter = debugObjects.listIterator(debugObjects.size()); iter.hasPrevious();) {
+            Object o = iter.previous();
             if (o == search) {
                 return true;
             }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationObserver.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/CompilationObserver.java	Fri Jan 13 18:46:56 2012 +0100
@@ -22,7 +22,6 @@
  */
 package com.oracle.max.graal.compiler.observer;
 
-import com.oracle.max.graal.compiler.*;
 
 /**
  * Interface for classes that observe events of an {@link ObservableCompiler}.
@@ -31,11 +30,11 @@
 
     /**
      * Called when compilation of a method has started. This is always the first event raised for a particular
-     * {@link GraalCompilation}.
+     * method compilation.
      *
-     * @param compilation Current state of the compilation.
+     * @param event Information associated with the event and current state of the compilation.
      */
-    void compilationStarted(GraalCompilation compilation);
+    void compilationStarted(CompilationEvent event);
 
     /**
      * Called when an event has occurred, for example that a particular phase in the compilation has been entered.
@@ -46,10 +45,10 @@
 
     /**
      * Called when compilation of a method has completed (successfully or not). This is always the last event raised for
-     * a particular {@link GraalCompilation}.
+     * a particular method compilation.
      *
-     * @param compilation Current state of the compilation.
+     * @param event Information associated with the event and current state of the compilation.
      */
-    void compilationFinished(GraalCompilation compilation);
+    void compilationFinished(CompilationEvent event);
 
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/ObservableContext.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/observer/ObservableContext.java	Fri Jan 13 18:46:56 2012 +0100
@@ -24,8 +24,6 @@
 
 import java.util.*;
 
-import com.oracle.max.graal.compiler.*;
-
 /**
  * Base class for compilers that notify subscribed {@link CompilationObserver CompilationObservers} of
  * {@link CompilationEvent CompilationEvents} that occur during their compilations.
@@ -34,6 +32,20 @@
 
     private List<CompilationObserver> observers;
 
+    private ThreadLocal<StringBuilder> scopeName = new ThreadLocal<StringBuilder>() {
+        @Override
+        protected StringBuilder initialValue() {
+            return new StringBuilder();
+        }
+    };
+
+    private ThreadLocal<ArrayList<Object>> debugObjects = new ThreadLocal<ArrayList<Object>>() {
+        @Override
+        protected ArrayList<Object> initialValue() {
+            return new ArrayList<>();
+        }
+    };
+
     /**
      * @return {@code true} if one or more observers are subscribed to receive notifications from this compiler,
      *         {@code false} otherwise.
@@ -56,28 +68,36 @@
         observers.add(observer);
     }
 
-    public void fireCompilationStarted(GraalCompilation compilation) {
+    public void fireCompilationStarted(Object... additionalDebugObjects) {
         if (isObserved()) {
+            addDebugObjects(null, additionalDebugObjects);
+            CompilationEvent event = new CompilationEvent("started", debugObjects.get());
             for (CompilationObserver observer : observers) {
-                observer.compilationStarted(compilation);
+                observer.compilationStarted(event);
             }
+            removeDebugObjects(null, additionalDebugObjects);
         }
     }
 
-    public void fireCompilationEvent(String label, Object...debugObjects) {
+    public void fireCompilationEvent(String label, Object... additionalDebugObjects) {
         if (isObserved()) {
-            CompilationEvent event = new CompilationEvent(label, debugObjects);
+            addDebugObjects(null, additionalDebugObjects);
+            CompilationEvent event = new CompilationEvent(label, debugObjects.get());
             for (CompilationObserver observer : observers) {
                 observer.compilationEvent(event);
             }
+            removeDebugObjects(null, additionalDebugObjects);
         }
     }
 
-    public void fireCompilationFinished(GraalCompilation compilation) {
+    public void fireCompilationFinished(Object... additionalDebugObjects) {
         if (isObserved()) {
+            addDebugObjects(null, additionalDebugObjects);
+            CompilationEvent event = new CompilationEvent("finished", debugObjects.get());
             for (CompilationObserver observer : observers) {
-                observer.compilationFinished(compilation);
+                observer.compilationFinished(event);
             }
+            removeDebugObjects(null, additionalDebugObjects);
         }
     }
 
@@ -100,4 +120,25 @@
             observers = null;
         }
     }
+
+    public void addDebugObjects(String name, Object[] additionalDebugObjects) {
+        if (name != null) {
+            if (scopeName.get().length() > 0) {
+                scopeName.get().append('.');
+            }
+            scopeName.get().append(name);
+        }
+        for (Object obj : additionalDebugObjects) {
+            debugObjects.get().add(obj);
+        }
+    }
+
+    public void removeDebugObjects(String name, Object[] additionalDebugObjects) {
+        if (name != null) {
+            scopeName.get().setLength(Math.max(0, scopeName.get().length() - name.length()));
+        }
+        for (int i = 0; i < additionalDebugObjects.length; i++) {
+            debugObjects.get().remove(debugObjects.get().size() - 1);
+        }
+    }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/stub/CompilerStub.java	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +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.stub;
-
-import static com.oracle.max.cri.ci.CiKind.*;
-
-import com.oracle.max.cri.ci.*;
-
-/**
- * A compiler stub is a shared routine that performs an operation on behalf of compiled code.
- * Typically the routine is too large to inline, is infrequent, or requires runtime support.
- * Compiler stubs are called with a callee-save convention; the compiler stub must save any
- * registers it may destroy and then restore them upon return. This allows the register
- * allocator to ignore calls to compiler stubs. Parameters to compiler stubs are
- * passed on the stack in order to preserve registers for the rest of the code.
- */
-public class CompilerStub {
-
-    public enum Id {
-        f2i(Int, Float),
-        f2l(Long, Float),
-        d2i(Int, Double),
-        d2l(Long, Double);
-
-        public final CiKind resultKind;
-        public final CiKind[] arguments;
-
-        private Id(CiKind resultKind, CiKind... args) {
-            this.resultKind = resultKind;
-            this.arguments = args;
-        }
-    }
-
-    public final Id id;
-    public final CiKind resultKind;
-    public final Object stubObject;
-
-    /**
-     * The slots in which the stub finds its incoming arguments.
-     * To get the arguments from the perspective of the stub's caller,
-     * use {@link CiStackSlot#asOutArg()}.
-     */
-    public final CiStackSlot[] inArgs;
-
-    /**
-     * The slot in which the stub places its return value (if any).
-     * To get the value from the perspective of the stub's caller,
-     * use {@link CiStackSlot#asOutArg()}.
-     */
-    public final CiStackSlot outResult;
-
-    public CompilerStub(Id id, CiKind resultKind, Object stubObject, CiStackSlot[] argSlots, CiStackSlot resultSlot) {
-        this.id = id;
-        this.resultKind = resultKind;
-        this.stubObject = stubObject;
-        this.inArgs = argSlots;
-        this.outResult = resultSlot;
-    }
-
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/Backend.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/Backend.java	Fri Jan 13 18:46:56 2012 +0100
@@ -31,36 +31,34 @@
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.stub.*;
+import com.oracle.max.graal.graph.*;
 
 /**
  * The {@code Backend} class represents a compiler backend for Graal.
  */
 public abstract class Backend {
-    public final GraalCompiler compiler;
+    public final RiRuntime runtime;
+    public final CiTarget target;
 
-    protected Backend(GraalCompiler compiler) {
-        this.compiler = compiler;
+    protected Backend(RiRuntime runtime, CiTarget target) {
+        this.runtime = runtime;
+        this.target = target;
     }
 
-    public static Backend create(CiArchitecture arch, GraalCompiler compiler) {
+    public static Backend create(CiArchitecture arch, RiRuntime runtime, CiTarget target) {
         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(GraalCompiler.class);
-            return (Backend) cons.newInstance(compiler);
+            Constructor<?> cons = c.getDeclaredConstructor(RiRuntime.class, CiTarget.class);
+            return (Backend) cons.newInstance(runtime, target);
         } catch (Exception e) {
             throw new Error("Could not instantiate " + className, e);
         }
     }
 
-    public abstract FrameMap newFrameMap(GraalCompilation compilation);
-    public abstract LIRGenerator newLIRGenerator(GraalCompilation compilation, RiXirGenerator xir);
+    public abstract FrameMap newFrameMap(RiRegisterConfig registerConfig);
+    public abstract LIRGenerator newLIRGenerator(GraalContext context, Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir);
     public abstract AbstractAssembler newAssembler(RiRegisterConfig registerConfig);
     public abstract CiXirAssembler newXirAssembler();
 
-    public abstract CompilerStub emit(GraalContext context, CompilerStub.Id stub);
-    public abstract CompilerStub emit(GraalContext context, CiRuntimeCall runtimeCall);
-    public abstract CompilerStub emit(GraalContext context, XirTemplate t);
-
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java	Fri Jan 13 18:46:56 2012 +0100
@@ -25,24 +25,21 @@
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiCompiler.*;
 import com.oracle.max.cri.ri.*;
 import com.oracle.max.cri.xir.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.stub.*;
-import com.oracle.max.graal.compiler.stub.CompilerStub.Id;
 import com.oracle.max.graal.compiler.target.*;
-import com.oracle.max.graal.nodes.*;
+import com.oracle.max.graal.graph.*;
 
 /**
  * The {@code X86Backend} class represents the backend for the AMD64 architecture.
  */
 public class AMD64Backend extends Backend {
 
-    public AMD64Backend(GraalCompiler compiler) {
-        super(compiler);
+    public AMD64Backend(RiRuntime runtime, CiTarget target) {
+        super(runtime, target);
     }
     /**
      * Creates a new LIRGenerator for x86.
@@ -50,62 +47,22 @@
      * @return an appropriate LIR generator instance
      */
     @Override
-    public LIRGenerator newLIRGenerator(GraalCompilation compilation, RiXirGenerator xir) {
-        return new AMD64LIRGenerator(compilation, xir);
+    public LIRGenerator newLIRGenerator(GraalContext context, Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
+        return new AMD64LIRGenerator(context, graph, runtime, target, frameMap, method, lir, xir);
     }
 
     @Override
-    public FrameMap newFrameMap(GraalCompilation compilation) {
-        return new FrameMap(compilation.compiler.runtime, compilation.compiler.target, compilation.registerConfig);
+    public FrameMap newFrameMap(RiRegisterConfig registerConfig) {
+        return new FrameMap(runtime, target, registerConfig);
     }
 
     @Override
     public AbstractAssembler newAssembler(RiRegisterConfig registerConfig) {
-        return new AMD64MacroAssembler(compiler.target, registerConfig);
+        return new AMD64MacroAssembler(target, registerConfig);
     }
 
     @Override
     public CiXirAssembler newXirAssembler() {
-        return new AMD64XirAssembler(compiler.target);
-    }
-
-    @Override
-    public CompilerStub emit(GraalContext context, Id stub) {
-        final GraalCompilation comp = new GraalCompilation(context, compiler, null, new StructuredGraph(), -1, DebugInfoLevel.FULL);
-        try {
-            return new AMD64CompilerStubEmitter(comp, stub.arguments, stub.resultKind).emit(stub);
-        } finally {
-            comp.close();
-        }
-    }
-
-    @Override
-    public CompilerStub emit(GraalContext context, CiRuntimeCall rtCall) {
-        final GraalCompilation comp = new GraalCompilation(context, compiler, null, new StructuredGraph(), -1, DebugInfoLevel.FULL);
-        try {
-            return new AMD64CompilerStubEmitter(comp, rtCall.arguments, rtCall.resultKind).emit(rtCall);
-        } finally {
-            comp.close();
-        }
-    }
-
-    private static CiKind[] getArgumentKinds(XirTemplate template) {
-        CiXirAssembler.XirParameter[] params = template.parameters;
-        CiKind[] result = new CiKind[params.length];
-        for (int i = 0; i < params.length; i++) {
-            result[i] = params[i].kind;
-        }
-        return result;
-    }
-
-
-    @Override
-    public CompilerStub emit(GraalContext context, XirTemplate t) {
-        final GraalCompilation comp = new GraalCompilation(context, compiler, null, new StructuredGraph(), -1, DebugInfoLevel.FULL);
-        try {
-            return new AMD64CompilerStubEmitter(comp, getArgumentKinds(t), t.resultOperand.kind).emit(t);
-        } finally {
-            comp.close();
-        }
+        return new AMD64XirAssembler(target);
     }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CallOpcode.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CallOpcode.java	Fri Jan 13 18:46:56 2012 +0100
@@ -28,12 +28,11 @@
 
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiTargetMethod.*;
-import com.oracle.max.cri.xir.CiXirAssembler.*;
+import com.oracle.max.cri.ci.CiTargetMethod.Mark;
+import com.oracle.max.cri.xir.CiXirAssembler.XirMark;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
 
 public enum AMD64CallOpcode implements StandardOpcode.CallOpcode {
@@ -94,38 +93,14 @@
         }
     }
 
-    public static void callStub(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CompilerStub stub, LIRDebugInfo info, CiValue result, CiValue... args) {
-        assert args.length == stub.inArgs.length;
-        for (int i = 0; i < args.length; i++) {
-            assert stub.inArgs[i].inCallerFrame();
-            AMD64MoveOpcode.move(tasm, masm, stub.inArgs[i].asOutArg(), args[i]);
-        }
-
-        directCall(tasm, masm, stub.stubObject, info);
-
-        if (isLegal(result)) {
-            AMD64MoveOpcode.move(tasm, masm, result, stub.outResult.asOutArg());
-        }
-
-        // Clear out parameters
-        if (GraalOptions.GenAssertionCode) {
-            for (int i = 0; i < args.length; i++) {
-                CiStackSlot inArg = stub.inArgs[i];
-                CiStackSlot outArg = inArg.asOutArg();
-                CiAddress dst = tasm.asAddress(outArg);
-                masm.movptr(dst, 0);
-            }
-        }
-    }
-
     public static void directCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Object target, LIRDebugInfo info) {
         int before = masm.codeBuffer.position();
         if (target instanceof CiRuntimeCall) {
-            long maxOffset = tasm.compilation.compiler.runtime.getMaxCallTargetOffset((CiRuntimeCall) target);
+            long maxOffset = tasm.runtime.getMaxCallTargetOffset((CiRuntimeCall) target);
             if (maxOffset != (int) maxOffset) {
                 // offset might not fit a 32-bit immediate, generate an
                 // indirect call with a 64-bit immediate
-                CiRegister scratch = tasm.compilation.registerConfig.getScratchRegister();
+                CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
                 // TODO(cwi): we want to get rid of a generally reserved scratch register.
                 masm.movq(scratch, 0L);
                 masm.call(scratch);
@@ -159,7 +134,7 @@
     }
 
     private static Object asCallTarget(TargetMethodAssembler tasm, Object o) {
-        return tasm.compilation.compiler.runtime.asCallTarget(o);
+        return tasm.runtime.asCallTarget(o);
     }
 
     public static void shouldNotReachHere(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompilerStubEmitter.java	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,340 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, 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.target.amd64;
-
-import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import java.util.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiRegister.*;
-import com.oracle.max.cri.ri.*;
-import com.oracle.max.cri.xir.*;
-import com.oracle.max.cri.xir.CiXirAssembler.*;
-import com.oracle.max.graal.compiler.*;
-import com.oracle.max.graal.compiler.asm.*;
-import com.oracle.max.graal.compiler.stub.*;
-
-/**
- * An object used to produce a single compiler stub.
- */
-public class AMD64CompilerStubEmitter {
-
-    private static final CiRegister convertArgument = AMD64.xmm0;
-    private static final CiRegister convertResult = AMD64.rax;
-
-    /**
-     * The slots in which the stub finds its incoming arguments.
-     * To get the arguments from the perspective of the stub's caller,
-     * use {@link CiStackSlot#asOutArg()}.
-     */
-    private final CiStackSlot[] inArgs;
-
-    /**
-     * The slot in which the stub places its return value (if any).
-     * To get the value from the perspective of the stub's caller,
-     * use {@link CiStackSlot#asOutArg()}.
-     */
-    private final CiStackSlot outResult;
-
-    /**
-     * The layout of the callee save area of the stub being emitted.
-     */
-    private CiCalleeSaveLayout calleeSaveLayout;
-
-    /**
-     * The compilation object for the stub being emitted.
-     */
-    private final GraalCompilation comp;
-
-    private final TargetMethodAssembler tasm;
-    private final AMD64MacroAssembler asm;
-
-    public AMD64CompilerStubEmitter(GraalCompilation compilation, CiKind[] argTypes, CiKind resultKind) {
-        compilation.initFrameMap();
-        this.comp = compilation;
-        final RiRegisterConfig registerConfig = compilation.compiler.compilerStubRegisterConfig;
-        this.asm = new AMD64MacroAssembler(compilation.compiler.target, registerConfig);
-        this.tasm = new TargetMethodAssembler(compilation, asm);
-
-        inArgs = new CiStackSlot[argTypes.length];
-        if (argTypes.length != 0) {
-            final CiValue[] locations = registerConfig.getCallingConvention(JavaCallee, argTypes, compilation.compiler.target, true).locations;
-            for (int i = 0; i < argTypes.length; i++) {
-                inArgs[i] = (CiStackSlot) locations[i];
-            }
-        }
-
-        if (resultKind != CiKind.Void) {
-            final CiValue location = registerConfig.getCallingConvention(JavaCallee, new CiKind[] {resultKind}, compilation.compiler.target, true).locations[0];
-            outResult = (CiStackSlot) location;
-        } else {
-            outResult = null;
-        }
-    }
-
-    public CompilerStub emit(CiRuntimeCall runtimeCall) {
-        emitStandardForward(null, runtimeCall);
-        String name = "graal-stub-" + runtimeCall;
-        CiTargetMethod targetMethod = tasm.finishTargetMethod(name, comp.compiler.runtime, true);
-        Object stubObject = comp.compiler.runtime.registerCompilerStub(targetMethod, name);
-        return new CompilerStub(null, runtimeCall.resultKind, stubObject, inArgs, outResult);
-    }
-
-    public CompilerStub emit(CompilerStub.Id stub) {
-        switch (stub) {
-            case f2i:
-                emitF2I();
-                break;
-            case f2l:
-                emitF2L();
-                break;
-            case d2i:
-                emitD2I();
-                break;
-            case d2l:
-                emitD2L();
-                break;
-        }
-
-        String name = "graal-stub-" + stub;
-        CiTargetMethod targetMethod = tasm.finishTargetMethod(name, comp.compiler.runtime, true);
-        Object stubObject = comp.compiler.runtime.registerCompilerStub(targetMethod, name);
-        return new CompilerStub(stub, stub.resultKind, stubObject, inArgs, outResult);
-    }
-
-    private static CiValue allocateOperand(XirTemp temp, ArrayList<CiRegister> allocatableRegisters) {
-        if (temp instanceof XirRegister) {
-            XirRegister fixed = (XirRegister) temp;
-            return fixed.register;
-        }
-
-        return newRegister(temp.kind, allocatableRegisters);
-    }
-
-    private static CiValue newRegister(CiKind kind, ArrayList<CiRegister> allocatableRegisters) {
-        assert kind != CiKind.Float && kind != CiKind.Double;
-        assert allocatableRegisters.size() > 0;
-        return allocatableRegisters.remove(allocatableRegisters.size() - 1).asValue(kind);
-    }
-
-    public CompilerStub emit(XirTemplate template) {
-        ArrayList<CiRegister> allocatableRegisters = new ArrayList<>(Arrays.asList(comp.registerConfig.getCategorizedAllocatableRegisters().get(RegisterFlag.CPU)));
-        for (XirTemp t : template.temps) {
-            if (t instanceof XirRegister) {
-                final XirRegister fixed = (XirRegister) t;
-                if (isRegister(fixed.register)) {
-                    allocatableRegisters.remove(asRegister(fixed.register));
-                }
-            }
-        }
-
-        prologue(comp.registerConfig.getCalleeSaveLayout());
-
-        CiValue[] operands = new CiValue[template.variableCount];
-
-        XirOperand resultOperand = template.resultOperand;
-
-        if (template.allocateResultOperand) {
-            CiValue outputOperand = CiValue.IllegalValue;
-            // This snippet has a result that must be separately allocated
-            // Otherwise it is assumed that the result is part of the inputs
-            if (resultOperand.kind != CiKind.Void && resultOperand.kind != CiKind.Illegal) {
-                outputOperand = outResult;
-                assert operands[resultOperand.index] == null;
-            }
-            operands[resultOperand.index] = outputOperand;
-        }
-
-        for (int i = 0; i < template.parameters.length; i++) {
-            final XirParameter param = template.parameters[i];
-            assert !(param instanceof XirConstantOperand) : "constant parameters not supported for stubs";
-
-            CiValue op = inArgs[i];
-            assert operands[param.index] == null;
-
-            // Is the value destroyed?
-            if (template.isParameterDestroyed(param.parameterIndex)) {
-                CiValue newOp = newRegister(op.kind, allocatableRegisters);
-                AMD64MoveOpcode.move(tasm, asm, newOp, op);
-                operands[param.index] = newOp;
-            } else {
-                operands[param.index] = op;
-            }
-        }
-
-        for (XirConstant c : template.constants) {
-            assert operands[c.index] == null;
-            operands[c.index] = c.value;
-        }
-
-        for (XirTemp t : template.temps) {
-            CiValue op = allocateOperand(t, allocatableRegisters);
-            assert operands[t.index] == null;
-            operands[t.index] = op;
-        }
-
-        for (CiValue operand : operands) {
-            assert operand != null;
-        }
-
-        Label[] labels = new Label[template.labels.length];
-        for (int i = 0; i < labels.length; i++) {
-            labels[i] = new Label();
-        }
-
-        assert template.marks.length == 0 : "marks not supported in compiler stubs";
-        AMD64XirOpcode.emitXirInstructions(tasm, asm, null, template.fastPath, labels, operands, null);
-        epilogue();
-        String stubName = "graal-" + template.name;
-        CiTargetMethod targetMethod = tasm.finishTargetMethod(stubName, comp.compiler.runtime, true);
-        Object stubObject = comp.compiler.runtime.registerCompilerStub(targetMethod, stubName);
-        return new CompilerStub(null, template.resultOperand.kind, stubObject, inArgs, outResult);
-    }
-
-    private void convertPrologue() {
-        prologue(new CiCalleeSaveLayout(0, -1, comp.compiler.target.wordSize, convertArgument, convertResult));
-        asm.movq(convertArgument, tasm.asAddress(inArgs[0]));
-    }
-
-    private void convertEpilogue() {
-        asm.movq(tasm.asAddress(outResult), convertResult);
-        epilogue();
-    }
-
-    private void emitD2L() {
-        emitCOMISSD(true, false);
-    }
-
-    private void emitD2I() {
-        emitCOMISSD(true, true);
-    }
-
-    private void emitF2L() {
-        emitCOMISSD(false, false);
-    }
-
-    private void emitF2I() {
-        emitCOMISSD(false, true);
-    }
-
-    private void emitCOMISSD(boolean isDouble, @SuppressWarnings("unused") boolean isInt) {
-        // TODO(tw): Check why isInt is never checked?
-        convertPrologue();
-        if (isDouble) {
-            asm.ucomisd(convertArgument, tasm.asDoubleConstRef(CiConstant.DOUBLE_0));
-        } else {
-            asm.ucomiss(convertArgument, tasm.asFloatConstRef(CiConstant.FLOAT_0));
-        }
-        Label nan = new Label();
-        Label ret = new Label();
-        asm.jccb(ConditionFlag.parity, nan);
-        asm.jccb(ConditionFlag.below, ret);
-
-        // input is > 0 -> return maxInt
-        // result register already contains 0x80000000, so subtracting 1 gives 0x7fffffff
-        asm.decrementl(convertResult, 1);
-        asm.jmpb(ret);
-
-        // input is NaN -> return 0
-        asm.bind(nan);
-        asm.xorptr(convertResult, convertResult);
-
-        asm.bind(ret);
-        convertEpilogue();
-    }
-
-    private void emitStandardForward(CompilerStub.Id stub, CiRuntimeCall call) {
-        if (stub != null) {
-            assert stub.resultKind == call.resultKind;
-            assert stub.arguments.length == call.arguments.length;
-            for (int i = 0; i < stub.arguments.length; i++) {
-                assert stub.arguments[i] == call.arguments[i];
-            }
-        }
-
-        prologue(comp.registerConfig.getCalleeSaveLayout());
-        forwardRuntimeCall(call);
-        epilogue();
-    }
-
-    private void prologue(CiCalleeSaveLayout csl) {
-        assert this.calleeSaveLayout == null;
-        assert csl != null : "stub should define a callee save area";
-        this.calleeSaveLayout = csl;
-        int entryCodeOffset = comp.compiler.runtime.codeOffset();
-        if (entryCodeOffset != 0) {
-            // pad to normal code entry point
-            asm.nop(entryCodeOffset);
-        }
-        final int frameSize = frameSize();
-        asm.subq(AMD64.rsp, frameSize);
-        tasm.setFrameSize(frameSize);
-        comp.frameMap().setFrameSize(frameSize);
-        asm.save(csl, csl.frameOffsetToCSA);
-    }
-
-    private void epilogue() {
-        tasm.targetMethod.setRegisterRestoreEpilogueOffset(asm.codeBuffer.position());
-
-        // Restore registers
-        int frameToCSA = calleeSaveLayout.frameOffsetToCSA;
-        asm.restore(calleeSaveLayout, frameToCSA);
-
-        // Restore rsp
-        asm.addq(AMD64.rsp, frameSize());
-        asm.ret(0);
-    }
-
-    private int frameSize() {
-        return comp.compiler.target.alignFrameSize(calleeSaveLayout.size);
-    }
-
-    private void forwardRuntimeCall(CiRuntimeCall call) {
-        // Load arguments
-        CiCallingConvention cc = comp.registerConfig.getCallingConvention(RuntimeCall, call.arguments, comp.compiler.target, false);
-        for (int i = 0; i < cc.locations.length; ++i) {
-            CiValue location = cc.locations[i];
-            asm.movq(asRegister(location), tasm.asAddress(inArgs[i]));
-        }
-
-        if (GraalOptions.AlignCallsForPatching) {
-            asm.alignForPatchableDirectCall();
-        }
-        // Call to the runtime
-        int before = asm.codeBuffer.position();
-        asm.call();
-        int after = asm.codeBuffer.position();
-        tasm.recordDirectCall(before, after - before, comp.compiler.runtime.asCallTarget(call), null);
-        asm.ensureUniquePC();
-
-        if (call.resultKind != CiKind.Void) {
-            CiRegister returnRegister = comp.registerConfig.getReturnRegister(call.resultKind);
-            asm.movq(tasm.asAddress(outResult), returnRegister);
-        }
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFIOpcode.java	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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.target.amd64;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.graal.compiler.asm.*;
-import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.stub.*;
-import com.oracle.max.graal.compiler.util.*;
-
-public enum AMD64ConvertFIOpcode implements LIROpcode {
-    F2I, D2I;
-
-    public LIRInstruction create(CiValue result, final CompilerStub stub, CiValue x) {
-        CiValue[] inputs = new CiValue[] {x};
-        CiValue[] outputs = new CiValue[] {result};
-
-        return new AMD64LIRInstruction(this, outputs, null, inputs, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS) {
-            @Override
-            public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-                emit(tasm, masm, output(0), stub, input(0));
-            }
-        };
-    }
-
-    private void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CompilerStub stub, CiValue x) {
-        switch (this) {
-            case F2I: masm.cvttss2sil(asIntReg(result), asFloatReg(x)); break;
-            case D2I: masm.cvttsd2sil(asIntReg(result), asDoubleReg(x)); break;
-            default: throw Util.shouldNotReachHere();
-        }
-
-        Label endLabel = new Label();
-        masm.cmp32(asIntReg(result), Integer.MIN_VALUE);
-        masm.jcc(ConditionFlag.notEqual, endLabel);
-        AMD64CallOpcode.callStub(tasm, masm, stub, null, result, x);
-        masm.bind(endLabel);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFLOpcode.java	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, 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.target.amd64;
-
-import static com.oracle.max.cri.ci.CiValueUtil.*;
-
-import com.oracle.max.asm.*;
-import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
-import com.oracle.max.asm.target.amd64.*;
-import com.oracle.max.cri.ci.*;
-import com.oracle.max.graal.compiler.asm.*;
-import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.stub.*;
-import com.oracle.max.graal.compiler.util.*;
-
-public enum AMD64ConvertFLOpcode implements LIROpcode {
-    F2L, D2L;
-
-    public LIRInstruction create(CiValue result, final CompilerStub stub, CiValue x, CiValue scratch) {
-        CiValue[] inputs = new CiValue[] {x};
-        CiValue[] temps = new CiValue[] {scratch};
-        CiValue[] outputs = new CiValue[] {result};
-
-        return new AMD64LIRInstruction(this, outputs, null, inputs, LIRInstruction.NO_OPERANDS, temps) {
-            @Override
-            public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-                emit(tasm, masm, output(0), stub, input(0), temp(0));
-            }
-        };
-    }
-
-    private void emit(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CompilerStub stub, CiValue x, CiValue scratch) {
-        assert differentRegisters(result, scratch);
-
-        CiRegister dst = asLongReg(result);
-        CiRegister tmp = asLongReg(scratch);
-        switch (this) {
-            case F2L: masm.cvttss2siq(dst, asFloatReg(x)); break;
-            case D2L: masm.cvttsd2siq(dst, asDoubleReg(x)); break;
-            default: throw Util.shouldNotReachHere();
-        }
-
-        Label endLabel = new Label();
-        masm.movq(tmp, java.lang.Long.MIN_VALUE);
-        masm.cmpq(dst, tmp);
-        masm.jcc(ConditionFlag.notEqual, endLabel);
-        AMD64CallOpcode.callStub(tasm, masm, stub, null, result, x);
-        masm.bind(endLabel);
-    }
-}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertOpcode.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertOpcode.java	Fri Jan 13 18:46:56 2012 +0100
@@ -26,7 +26,9 @@
 
 import java.util.*;
 
+import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.asm.target.amd64.AMD64Assembler.*;
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
@@ -35,8 +37,8 @@
 public enum AMD64ConvertOpcode implements LIROpcode {
     I2L, L2I, I2B, I2C, I2S,
     F2D, D2F,
-    I2F, I2D,
-    L2F, L2D,
+    I2F, I2D, F2I, D2I,
+    L2F, L2D, F2L, D2L,
     MOV_I2F, MOV_L2D, MOV_F2I, MOV_D2L;
 
     public LIRInstruction create(CiValue result, CiValue x) {
@@ -84,6 +86,22 @@
             case I2D: masm.cvtsi2sdl(asDoubleReg(result), asIntReg(x)); break;
             case L2F: masm.cvtsi2ssq(asFloatReg(result), asLongReg(x)); break;
             case L2D: masm.cvtsi2sdq(asDoubleReg(result), asLongReg(x)); break;
+            case F2I:
+                masm.cvttss2sil(asIntReg(result), asFloatReg(x));
+                emitFixup(tasm, masm, result, x);
+                break;
+            case D2I:
+                masm.cvttsd2sil(asIntReg(result), asDoubleReg(x));
+                emitFixup(tasm, masm, result, x);
+                break;
+            case F2L:
+                masm.cvttss2siq(asLongReg(result), asFloatReg(x));
+                emitFixup(tasm, masm, result, x);
+                break;
+            case D2L:
+                masm.cvttsd2siq(asLongReg(result), asDoubleReg(x));
+                emitFixup(tasm, masm, result, x);
+                break;
             case MOV_I2F: masm.movdl(asFloatReg(result), asIntReg(x)); break;
             case MOV_L2D: masm.movdq(asDoubleReg(result), asLongReg(x)); break;
             case MOV_F2I: masm.movdl(asIntReg(result), asFloatReg(x)); break;
@@ -91,4 +109,55 @@
             default: throw Util.shouldNotReachHere();
         }
     }
+
+    private static void emitFixup(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue result, CiValue x) {
+        FixupSlowPath slowPath = new FixupSlowPath(result, x);
+        tasm.slowPaths.add(slowPath);
+        switch (result.kind) {
+            case Int:  masm.cmpl(asIntReg(result),  Integer.MIN_VALUE); break;
+            case Long: masm.cmpq(asLongReg(result), tasm.asLongConstRef(CiConstant.forLong(java.lang.Long.MIN_VALUE))); break;
+            default:   throw Util.shouldNotReachHere();
+        }
+        masm.jcc(ConditionFlag.equal, slowPath.start);
+        masm.bind(slowPath.continuation);
+    }
+
+    private static class FixupSlowPath extends AMD64SlowPath {
+        public final Label start = new Label();
+        public final Label continuation = new Label();
+        private final CiValue result;
+        private final CiValue x;
+
+        public FixupSlowPath(CiValue result, CiValue x) {
+            this.result = result;
+            this.x = x;
+        }
+
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            masm.bind(start);
+            switch (x.kind) {
+                case Float:  masm.ucomiss(asFloatReg(x),  tasm.asFloatConstRef(CiConstant.FLOAT_0)); break;
+                case Double: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(CiConstant.DOUBLE_0)); break;
+                default:     throw Util.shouldNotReachHere();
+            }
+            Label nan = new Label();
+            masm.jcc(ConditionFlag.parity, nan);
+            masm.jcc(ConditionFlag.below, continuation);
+
+            // input is > 0 -> return maxInt
+            // result register already contains 0x80000000, so subtracting 1 gives 0x7fffffff
+            switch (result.kind) {
+                case Int:  masm.decrementl(asIntReg(result),  1); break;
+                case Long: masm.decrementq(asLongReg(result), 1); break;
+                default:   throw Util.shouldNotReachHere();
+            }
+            masm.jmp(continuation);
+
+            // input is NaN -> return 0
+            masm.bind(nan);
+            masm.xorptr(asRegister(result), asRegister(result));
+            masm.jmp(continuation);
+        }
+    }
 }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Fri Jan 13 18:46:56 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -33,7 +33,7 @@
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.nodes.DeoptimizeNode.DeoptAction;
 
-public class AMD64DeoptimizationStub implements LIR.SlowPath {
+public class AMD64DeoptimizationStub extends AMD64SlowPath {
     public final Label label = new Label();
     public final LIRDebugInfo info;
     public final DeoptAction action;
@@ -49,11 +49,9 @@
     private static ArrayList<Object> keepAlive = new ArrayList<>();
 
     @Override
-    public void emitCode(TargetMethodAssembler tasm) {
-        AMD64MacroAssembler masm = (AMD64MacroAssembler) tasm.asm;
-
+    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
         // TODO(cwi): we want to get rid of a generally reserved scratch register.
-        CiRegister scratch = tasm.compilation.registerConfig.getScratchRegister();
+        CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
 
         masm.bind(label);
         if (GraalOptions.CreateDeoptInfo && deoptInfo != null) {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Fri Jan 13 18:46:56 2012 +0100
@@ -27,8 +27,6 @@
 import static com.oracle.max.graal.compiler.target.amd64.AMD64ArithmeticOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64CompareOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64CompareToIntOpcode.*;
-import static com.oracle.max.graal.compiler.target.amd64.AMD64ConvertFIOpcode.*;
-import static com.oracle.max.graal.compiler.target.amd64.AMD64ConvertFLOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64ConvertOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64DivOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64LogicFloatOpcode.*;
@@ -40,12 +38,13 @@
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.cri.xir.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
+import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.DeoptimizeNode.DeoptAction;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
@@ -73,8 +72,8 @@
         StandardOpcode.XIR = AMD64XirOpcode.XIR;
     }
 
-    public AMD64LIRGenerator(GraalCompilation compilation, RiXirGenerator xir) {
-        super(compilation, xir);
+    public AMD64LIRGenerator(GraalContext context, Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) {
+        super(context, graph, runtime, target, frameMap, method, lir, xir);
         lir.methodEndMarker = new AMD64MethodEndStub();
     }
 
@@ -424,12 +423,12 @@
             case D2F: append(D2F.create(result, input)); break;
             case I2F: append(I2F.create(result, input)); break;
             case I2D: append(I2D.create(result, input)); break;
-            case F2I: append(F2I.create(result, stubFor(CompilerStub.Id.f2i), input)); break;
-            case D2I: append(D2I.create(result, stubFor(CompilerStub.Id.d2i), input)); break;
+            case F2I: append(F2I.create(result, input)); break;
+            case D2I: append(D2I.create(result, input)); break;
             case L2F: append(L2F.create(result, input)); break;
             case L2D: append(L2D.create(result, input)); break;
-            case F2L: append(F2L.create(result, stubFor(CompilerStub.Id.f2l), input, newVariable(CiKind.Long))); break;
-            case D2L: append(D2L.create(result, stubFor(CompilerStub.Id.d2l), input, newVariable(CiKind.Long))); break;
+            case F2L: append(F2L.create(result, input)); break;
+            case D2L: append(D2L.create(result, input)); break;
             case MOV_I2F: append(MOV_I2F.create(result, input)); break;
             case MOV_L2D: append(MOV_L2D.create(result, input)); break;
             case MOV_F2I: append(MOV_F2I.create(result, input)); break;
@@ -453,8 +452,8 @@
 
     @Override
     public void emitMembar(int barriers) {
-        int necessaryBarriers = compilation.compiler.target.arch.requiredBarriers(barriers);
-        if (compilation.compiler.target.isMP && necessaryBarriers != 0) {
+        int necessaryBarriers = target.arch.requiredBarriers(barriers);
+        if (target.isMP && necessaryBarriers != 0) {
             append(MEMBAR.create(necessaryBarriers));
         }
     }
@@ -463,7 +462,7 @@
     protected void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiValue index) {
         // Making a copy of the switch value is necessary because jump table destroys the input value
         Variable tmp = emitMove(index);
-        append(TABLE_SWITCH.create(lowKey, defaultTarget, targets, tmp, newVariable(compilation.compiler.target.wordKind)));
+        append(TABLE_SWITCH.create(lowKey, defaultTarget, targets, tmp, newVariable(target.wordKind)));
     }
 
     @Override
@@ -496,7 +495,7 @@
         }
 
         if (kind == CiKind.Object) {
-            Variable loadedAddress = newVariable(compilation.compiler.target.wordKind);
+            Variable loadedAddress = newVariable(target.wordKind);
             append(LEA_MEMORY.create(loadedAddress, addrBase, addrIndex, CiAddress.Scale.Times1, addrDisplacement));
             preGCWriteBarrier(loadedAddress, false, null);
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRInstruction.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRInstruction.java	Fri Jan 13 18:46:56 2012 +0100
@@ -28,7 +28,7 @@
 import com.oracle.max.graal.compiler.lir.*;
 
 /**
- * Convenience class to cast AbstractAssembler to AMD64MacroAssembler for the {@link #emitCode} method.
+ * Convenience class to provide AMD64MacroAssembler for the {@link #emitCode} method.
  */
 public abstract class AMD64LIRInstruction extends LIRInstruction {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MethodEndStub.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MethodEndStub.java	Fri Jan 13 18:46:56 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
@@ -25,13 +25,10 @@
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.asm.*;
-import com.oracle.max.graal.compiler.lir.*;
 
-public class AMD64MethodEndStub implements LIR.SlowPath {
+public class AMD64MethodEndStub extends AMD64SlowPath {
     @Override
-    public void emitCode(TargetMethodAssembler tasm) {
-        AMD64MacroAssembler masm = (AMD64MacroAssembler) tasm.asm;
-
+    public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
         for (int i = 0; i < GraalOptions.MethodEndBreakpointGuards; ++i) {
             masm.int3();
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64SlowPath.java	Fri Jan 13 18:46:56 2012 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 2012, 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.target.amd64;
+
+import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.graal.compiler.asm.*;
+import com.oracle.max.graal.compiler.lir.*;
+
+/**
+ * Convenience class to provide AMD64MacroAssembler for the {@link #emitCode} method.
+ */
+public abstract class AMD64SlowPath implements LIR.SlowPath {
+    @Override
+    public final void emitCode(TargetMethodAssembler tasm) {
+        emitCode(tasm, (AMD64MacroAssembler) tasm.asm);
+    }
+
+    public abstract void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm);
+}
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirAssembler.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirAssembler.java	Fri Jan 13 18:46:56 2012 +0100
@@ -43,7 +43,6 @@
     protected XirTemplate buildTemplate(String name, boolean isStub) {
         List<XirInstruction> fastPath = new ArrayList<>(instructions.size());
         List<XirInstruction> slowPath = new ArrayList<>();
-        List<XirTemplate> calleeTemplates = new ArrayList<>();
 
         int flags = 0;
 
@@ -164,18 +163,6 @@
                     currentList.add(new XirInstruction(i.kind, i.op, i.result, i.x(), i.y(), fixedRAX));
                     appended = true;
                     break;
-                case CallStub:
-                    for (int j = 0; j < i.arguments.length; j++) {
-                        XirOperand op = i.arguments[j];
-                        if (op instanceof XirConstantOperand && (op.kind == CiKind.Object || op.kind == CiKind.Long)) {
-                            XirOperand tempLocation = createTemp("callStubTempLocation", op.kind);
-                            currentList.add(new XirInstruction(op.kind, XirOp.Mov, tempLocation, op));
-                            i.arguments[j] = tempLocation;
-                        }
-                    }
-                    flags |= HAS_STUB_CALL.mask;
-                    calleeTemplates.add((XirTemplate) i.extra);
-                    break;
                 case CallRuntime:
                     flags |= HAS_RUNTIME_CALL.mask;
                     break;
@@ -228,9 +215,8 @@
         XirParameter[] xirParameters = parameters.toArray(new XirParameter[parameters.size()]);
         XirTemp[] temporaryOperands = temps.toArray(new XirTemp[temps.size()]);
         XirConstant[] constantOperands = constants.toArray(new XirConstant[constants.size()]);
-        XirTemplate[] calleeTemplateArray = calleeTemplates.toArray(new XirTemplate[calleeTemplates.size()]);
         XirMark[] marksArray = marks.toArray(new XirMark[marks.size()]);
-        return new XirTemplate(name, this.variableCount, this.allocateResultOperand, resultOperand, fp, sp, xirLabels, xirParameters, temporaryOperands, constantOperands, flags, calleeTemplateArray, marksArray, outgoingStackSize);
+        return new XirTemplate(name, this.variableCount, this.allocateResultOperand, resultOperand, fp, sp, xirLabels, xirParameters, temporaryOperands, constantOperands, flags, marksArray, outgoingStackSize);
     }
 
     @Override
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirOpcode.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirOpcode.java	Fri Jan 13 18:46:56 2012 +0100
@@ -85,11 +85,11 @@
         }
 
         if (snippet.template.slowPath != null) {
-            tasm.compilation.lir().slowPaths.add(new SlowPath(op, labels, snippet.marks));
+            tasm.slowPaths.add(new SlowPath(op, labels, snippet.marks));
         }
     }
 
-    private static class SlowPath implements LIR.SlowPath {
+    private static class SlowPath extends AMD64SlowPath {
         public final LIRXirInstruction instruction;
         public final Label[] labels;
         public final Map<XirMark, Mark> marks;
@@ -100,8 +100,9 @@
             this.marks = marks;
         }
 
-        public void emitCode(TargetMethodAssembler tasm) {
-            emitSlowPath(tasm, (AMD64MacroAssembler) tasm.asm, this);
+        @Override
+        public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
+            emitSlowPath(tasm, masm, this);
         }
     }
 
@@ -294,26 +295,13 @@
 
                     break;
 
-                case CallStub: {
-                    XirTemplate stubId = (XirTemplate) inst.extra;
-                    CiValue result = CiValue.IllegalValue;
-                    if (inst.result != null) {
-                        result = operands[inst.result.index];
-                    }
-                    CiValue[] args = new CiValue[inst.arguments.length];
-                    for (int i = 0; i < args.length; i++) {
-                        args[i] = operands[inst.arguments[i].index];
-                    }
-                    AMD64CallOpcode.callStub(tasm, masm, tasm.compilation.compiler.lookupStub(stubId), info, result, args);
-                    break;
-                }
                 case CallRuntime: {
                     CiKind[] signature = new CiKind[inst.arguments.length];
                     for (int i = 0; i < signature.length; i++) {
                         signature[i] = inst.arguments[i].kind;
                     }
 
-                    CiCallingConvention cc = tasm.compilation.registerConfig.getCallingConvention(RuntimeCall, signature, tasm.target, false);
+                    CiCallingConvention cc = tasm.frameMap.registerConfig.getCallingConvention(RuntimeCall, signature, tasm.target, false);
                     for (int i = 0; i < inst.arguments.length; i++) {
                         CiValue argumentLocation = cc.locations[i];
                         CiValue argumentSourceLocation = operands[inst.arguments[i].index];
@@ -326,7 +314,7 @@
                     AMD64CallOpcode.directCall(tasm, masm, runtimeCallInformation.target, (runtimeCallInformation.useInfoAfter) ? infoAfter : info);
 
                     if (inst.result != null && inst.result.kind != CiKind.Illegal && inst.result.kind != CiKind.Void) {
-                        CiRegister returnRegister = tasm.compilation.registerConfig.getReturnRegister(inst.result.kind);
+                        CiRegister returnRegister = tasm.frameMap.registerConfig.getReturnRegister(inst.result.kind);
                         CiValue resultLocation = returnRegister.asValue(inst.result.kind.stackKind());
                         AMD64MoveOpcode.move(tasm, masm, operands[inst.result.index], resultLocation);
                     }
@@ -430,7 +418,7 @@
                     break;
                 }
                 case StackOverflowCheck: {
-                    int frameSize = tasm.compilation.frameMap().frameSize();
+                    int frameSize = tasm.frameMap.frameSize();
                     int lastFramePage = frameSize / tasm.target.pageSize;
                     // emit multiple stack bangs for methods with frames larger than a page
                     for (int i = 0; i <= lastFramePage; i++) {
@@ -441,7 +429,7 @@
                     break;
                 }
                 case PushFrame: {
-                    int frameSize = tasm.compilation.frameMap().frameSize();
+                    int frameSize = tasm.frameMap.frameSize();
                     masm.decrementq(AMD64.rsp, frameSize); // does not emit code for frameSize == 0
                     if (GraalOptions.ZapStackOnMethodEntry) {
                         final int intSize = 4;
@@ -449,22 +437,22 @@
                             masm.movl(new CiAddress(CiKind.Int, AMD64.rsp.asValue(), i * intSize), 0xC1C1C1C1);
                         }
                     }
-                    CiCalleeSaveLayout csl = tasm.compilation.registerConfig.getCalleeSaveLayout();
+                    CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
                     if (csl != null && csl.size != 0) {
-                        int frameToCSA = tasm.compilation.frameMap().offsetToCalleeSaveArea();
+                        int frameToCSA = tasm.frameMap.offsetToCalleeSaveArea();
                         assert frameToCSA >= 0;
                         masm.save(csl, frameToCSA);
                     }
                     break;
                 }
                 case PopFrame: {
-                    int frameSize = tasm.compilation.frameMap().frameSize();
+                    int frameSize = tasm.frameMap.frameSize();
 
-                    CiCalleeSaveLayout csl = tasm.compilation.registerConfig.getCalleeSaveLayout();
+                    CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
                     if (csl != null && csl.size != 0) {
                         tasm.targetMethod.setRegisterRestoreEpilogueOffset(masm.codeBuffer.position());
                         // saved all registers, restore all registers
-                        int frameToCSA = tasm.compilation.frameMap().offsetToCalleeSaveArea();
+                        int frameToCSA = tasm.frameMap.offsetToCalleeSaveArea();
                         masm.restore(csl, frameToCSA);
                     }
 
@@ -481,7 +469,7 @@
                     if (isRegister(result)) {
                         masm.pop(asRegister(result));
                     } else {
-                        CiRegister rscratch = tasm.compilation.registerConfig.getScratchRegister();
+                        CiRegister rscratch = tasm.frameMap.registerConfig.getScratchRegister();
                         masm.pop(rscratch);
                         AMD64MoveOpcode.move(tasm, masm, result, rscratch.asValue());
                     }
@@ -569,7 +557,7 @@
 
     private static CiValue assureNot64BitConstant(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue value) {
         if (isConstant(value) && (value.kind == CiKind.Long || value.kind == CiKind.Object)) {
-            CiRegisterValue register = tasm.compilation.registerConfig.getScratchRegister().asValue(value.kind);
+            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(value.kind);
             AMD64MoveOpcode.move(tasm, masm, register, value);
             return register;
         }
@@ -578,7 +566,7 @@
 
     private static CiRegisterValue assureInRegister(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiValue pointer) {
         if (isConstant(pointer)) {
-            CiRegisterValue register = tasm.compilation.registerConfig.getScratchRegister().asValue(pointer.kind);
+            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(pointer.kind);
             AMD64MoveOpcode.move(tasm, masm, register, pointer);
             return register;
         }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java	Fri Jan 13 18:46:56 2012 +0100
@@ -26,7 +26,6 @@
 
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
-import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 
@@ -346,24 +345,6 @@
     }
 
     /**
-     * Determines if the kinds of two given IR nodes are equal at the {@linkplain #archKind(CiKind) architecture}
-     * level in the context of the {@linkplain GraalCompilation#compilation()} compilation.
-     */
-    public static boolean archKindsEqual(ValueNode i, ValueNode other) {
-        return archKindsEqual(i.kind(), other.kind());
-    }
-
-    /**
-     * Determines if two given kinds are equal at the {@linkplain #archKind(CiKind) architecture} level
-     * in the context of the {@linkplain GraalCompilation#compilation()} compilation.
-     */
-    public static boolean archKindsEqual(CiKind k1, CiKind k2) {
-        // TODO(cwi): I think that implementation should do it with the new handling of Word types.
-        return k1 == k2;
-    }
-
-
-    /**
      * Checks that two instructions are equivalent, optionally comparing constants.
      * @param x the first instruction
      * @param y the second instruction
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/CompilerImpl.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/CompilerImpl.java	Fri Jan 13 18:46:56 2012 +0100
@@ -31,6 +31,7 @@
 import com.oracle.max.cri.xir.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.observer.*;
+import com.oracle.max.graal.compiler.target.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.hotspot.bridge.*;
 import com.oracle.max.graal.hotspot.logging.*;
@@ -151,17 +152,18 @@
     @Override
     public GraalCompiler getCompiler() {
         if (compiler == null) {
-            RiRegisterConfig registerConfig;
-
             // these options are important - graal will not generate correct code without them
             GraalOptions.StackShadowPages = config.stackShadowPages;
 
-            registerConfig = getRuntime().globalStubRegConfig;
-            RiXirGenerator generator = new HotSpotXirGenerator(config, getTarget(), registerConfig, this);
+            RiXirGenerator generator = new HotSpotXirGenerator(config, getTarget(), getRuntime().getGlobalStubRegisterConfig(), this);
             if (Logger.ENABLED) {
                 generator = LoggingProxy.getProxy(RiXirGenerator.class, generator);
             }
-            compiler = new GraalCompiler(context, getRuntime(), getTarget(), generator, registerConfig);
+
+            Backend backend = Backend.create(target.arch, runtime, target);
+            generator.initialize(backend.newXirAssembler());
+
+            compiler = new GraalCompiler(context, getRuntime(), getTarget(), backend, generator);
         }
         return compiler;
     }
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Jan 13 18:46:56 2012 +0100
@@ -27,12 +27,11 @@
 import java.util.concurrent.*;
 
 import com.oracle.max.cri.ci.*;
-import com.oracle.max.cri.ci.CiCompiler.*;
 import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.phases.*;
-import com.oracle.max.graal.compiler.phases.PhasePlan.*;
+import com.oracle.max.graal.compiler.phases.PhasePlan.PhasePosition;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.hotspot.Compiler;
 import com.oracle.max.graal.hotspot.ri.*;
@@ -186,7 +185,7 @@
                         CiTargetMethod result = null;
                         TTY.Filter filter = new TTY.Filter(GraalOptions.PrintFilter, method);
                         try {
-                            result = compiler.getCompiler().compileMethod(method, -1, DebugInfoLevel.FULL, plan);
+                            result = compiler.getCompiler().compileMethod(method, -1, plan);
                         } finally {
                             filter.remove();
                             if (printCompilation) {
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotRuntime.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotRuntime.java	Fri Jan 13 18:46:56 2012 +0100
@@ -51,7 +51,7 @@
     final GraalContext context;
     final HotSpotVMConfig config;
     final HotSpotRegisterConfig regConfig;
-    public final HotSpotRegisterConfig globalStubRegConfig;
+    private final HotSpotRegisterConfig globalStubRegConfig;
     private final Compiler compiler;
 
     public HotSpotRuntime(GraalContext context, HotSpotVMConfig config, Compiler compiler) {
@@ -430,4 +430,9 @@
         Compiler compilerInstance = CompilerImpl.getInstance();
         return HotSpotTargetMethod.installMethod(compilerInstance, (HotSpotMethodResolved) method, code, false);
     }
+
+    @Override
+    public RiRegisterConfig getGlobalStubRegisterConfig() {
+        return globalStubRegConfig;
+    }
 }
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotXirGenerator.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotXirGenerator.java	Fri Jan 13 18:46:56 2012 +0100
@@ -1306,10 +1306,8 @@
     }
 
     @Override
-    public List<XirTemplate> makeTemplates(CiXirAssembler asm) {
+    public void initialize(CiXirAssembler asm) {
         this.globalAsm = asm;
-        List<XirTemplate> templates = new ArrayList<>();
-        return templates;
     }
 
     private void verifyPointer(CiXirAssembler asm, XirOperand pointer) {
--- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java	Fri Jan 13 18:46:56 2012 +0100
@@ -108,7 +108,6 @@
     }
 
     public GraphBuilderPhase(RiRuntime runtime, GraphBuilderConfiguration config) {
-        assert config != null && runtime != null;
         this.config = config;
         this.runtime = runtime;
         this.log = GraalOptions.TraceBytecodeParserLevel > 0 ? new LogStream(TTY.out()) : null;
@@ -158,6 +157,7 @@
         this.canTrapBitSet = blockMap.canTrap;
 
         exceptionHandlers = blockMap.exceptionHandlers();
+
         nextBlockNumber = blockMap.blocks.size();
 
         lastInstr = currentGraph.start();
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinter.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinter.java	Fri Jan 13 18:46:56 2012 +0100
@@ -30,14 +30,15 @@
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
-import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
 import com.oracle.max.graal.compiler.alloc.Interval.UsePosList;
+import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.graph.*;
-import com.oracle.max.graal.graph.Node.*;
-import com.oracle.max.graal.graph.NodeClass.*;
+import com.oracle.max.graal.graph.Node.Verbosity;
+import com.oracle.max.graal.graph.NodeClass.NodeClassIterator;
+import com.oracle.max.graal.graph.NodeClass.Position;
 import com.oracle.max.graal.java.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
@@ -48,27 +49,19 @@
 class CFGPrinter extends CompilationPrinter {
 
     public final ByteArrayOutputStream buffer;
-    public final GraalCompilation compilation;
     public final CiTarget target;
     public final RiRuntime runtime;
+    public LIR lir;
+    public LIRGenerator lirGenerator;
 
     /**
      * Creates a control flow graph printer.
      *
      * @param buffer where the output generated via this printer shown be written
      */
-    public CFGPrinter(ByteArrayOutputStream buffer, GraalCompilation compilation) {
+    public CFGPrinter(ByteArrayOutputStream buffer, CiTarget target, RiRuntime runtime) {
         super(buffer);
         this.buffer = buffer;
-        this.compilation = compilation;
-        this.target = compilation.compiler.target;
-        this.runtime = compilation.compiler.runtime;
-    }
-
-    public CFGPrinter(ByteArrayOutputStream buffer, GraalCompilation compilation, CiTarget target, RiRuntime runtime) {
-        super(buffer);
-        this.buffer = buffer;
-        this.compilation = compilation;
         this.target = target;
         this.runtime = runtime;
     }
@@ -131,18 +124,17 @@
      *
      * @param label A label describing the compilation phase that produced the control flow graph.
      * @param blocks The list of blocks to be printed.
-     * @param printNodes If {@code true} the nodes in the block will be printed.
      */
-    public void printCFG(String label, List<? extends Block> blocks, boolean printNodes) {
+    public void printCFG(String label, List<? extends Block> blocks) {
         begin("cfg");
         out.print("name \"").print(label).println('"');
         for (Block block : blocks) {
-            printBlock(block, printNodes);
+            printBlock(block);
         }
         end("cfg");
     }
 
-    private void printBlock(Block block, boolean printNodes) {
+    private void printBlock(Block block) {
         begin("block");
 
         out.print("name \"").print(blockToString(block)).println('"');
@@ -186,9 +178,7 @@
         out.print("loop_index ").println(block.loopIndex());
         out.print("loop_depth ").println(block.loopDepth());
 
-        if (printNodes) {
-            printNodes(block);
-        }
+        printNodes(block);
 
         if (block instanceof LIRBlock) {
             printLIR((LIRBlock) block);
@@ -230,13 +220,14 @@
         } else if (node instanceof FloatingNode) {
             out.print("f ").print(HOVER_START).print("~").print(HOVER_SEP).print("floating").print(HOVER_END).println(COLUMN_END);
         }
-        if (compilation.nodeOperands != null && node instanceof ValueNode) {
-            CiValue operand = compilation.operand((ValueNode) node);
+        out.print("tid ").print(nodeToString(node)).println(COLUMN_END);
+
+        if (lirGenerator != null) {
+            CiValue operand = lirGenerator.nodeOperands.get(node);
             if (operand != null) {
                 out.print("result ").print(operand.toString()).println(COLUMN_END);
             }
         }
-        out.print("tid ").print(nodeToString(node)).println(COLUMN_END);
 
         if (node instanceof StateSplit) {
             StateSplit stateSplit = (StateSplit) node;
@@ -330,8 +321,8 @@
 
     private String stateValueToString(ValueNode value) {
         String result = nodeToString(value);
-        if (value != null) {
-            CiValue operand = compilation.operand(value);
+        if (lirGenerator != null && lirGenerator.nodeOperands != null && value != null) {
+            CiValue operand = lirGenerator.nodeOperands.get(value);
             if (operand != null) {
                 result += ": " + operand;
             }
@@ -345,8 +336,8 @@
      * @param block the block to print
      */
     private void printLIR(LIRBlock block) {
-        List<LIRInstruction> lir = block.lir();
-        if (lir == null) {
+        List<LIRInstruction> lirInstructions = block.lir();
+        if (lirInstructions == null) {
             return;
         }
 
@@ -366,8 +357,8 @@
             }
         }
 
-        for (int i = 0; i < lir.size(); i++) {
-            LIRInstruction inst = lir.get(i);
+        for (int i = 0; i < lirInstructions.size(); i++) {
+            LIRInstruction inst = lirInstructions.get(i);
             out.printf("nr %4d ", inst.id()).print(COLUMN_END);
 
             if (inst.info != null) {
@@ -396,7 +387,7 @@
             return "-";
         }
         String prefix;
-        if (node instanceof BeginNode && compilation != null && compilation.lir() == null) {
+        if (node instanceof BeginNode && lir == null) {
             prefix = "B";
         } else if (node instanceof ValueNode) {
             ValueNode value = (ValueNode) node;
@@ -412,7 +403,7 @@
     }
 
     private String blockToString(Block block) {
-        if (compilation != null && compilation.lir() == null) {
+        if (lir == null) {
             // During all the front-end phases, the block schedule is built only for the debug output.
             // Therefore, the block numbers would be different for every CFG printed -> use the id of the first instruction.
             return "B" + block.firstNode().toString(Verbosity.Id);
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/CFGPrinterObserver.java	Fri Jan 13 18:46:56 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -28,8 +28,8 @@
 import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
-import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
+import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.observer.*;
 import com.oracle.max.graal.compiler.schedule.*;
@@ -54,13 +54,15 @@
     };
 
     @Override
-    public void compilationStarted(GraalCompilation compilation) {
+    public void compilationStarted(CompilationEvent event) {
         if (TTY.isSuppressed()) {
             return;
         }
+        RiRuntime runtime = event.debugObject(RiRuntime.class);
+        CiTarget target = event.debugObject(CiTarget.class);
 
-        CFGPrinter cfgPrinter = new CFGPrinter(new ByteArrayOutputStream(), compilation);
-        cfgPrinter.printCompilation(compilation.method);
+        CFGPrinter cfgPrinter = new CFGPrinter(new ByteArrayOutputStream(), target, runtime);
+        cfgPrinter.printCompilation(event.debugObject(RiResolvedMethod.class));
         observations.get().push(cfgPrinter);
     }
 
@@ -75,10 +77,16 @@
         }
 
         RiRuntime runtime = cfgPrinter.runtime;
+        if (event.debugObject(LIR.class) != null) {
+            cfgPrinter.lir = event.debugObject(LIR.class);
+        }
+        if (event.debugObject(LIRGenerator.class) != null) {
+            cfgPrinter.lirGenerator = event.debugObject(LIRGenerator.class);
+        }
+
         BlockMap blockMap = event.debugObject(BlockMap.class);
         Graph graph = event.debugObject(Graph.class);
         IdentifyBlocksPhase schedule = event.debugObject(IdentifyBlocksPhase.class);
-        LIR lir = event.debugObject(LIR.class);
         LinearScan allocator = event.debugObject(LinearScan.class);
         Interval[] intervals = event.debugObject(Interval[].class);
         CiTargetMethod targetMethod = event.debugObject(CiTargetMethod.class);
@@ -87,8 +95,8 @@
             cfgPrinter.printCFG(event.label, blockMap);
             cfgPrinter.printBytecodes(runtime.disassemble(blockMap.method));
         }
-        if (lir != null) {
-            cfgPrinter.printCFG(event.label, lir.codeEmittingOrder(), graph != null);
+        if (cfgPrinter.lir != null) {
+            cfgPrinter.printCFG(event.label, cfgPrinter.lir.codeEmittingOrder());
             if (targetMethod != null) {
                 cfgPrinter.printMachineCode(runtime.disassemble(targetMethod), null);
             }
@@ -107,7 +115,7 @@
                 }
             }
             if (blocks != null) {
-                cfgPrinter.printCFG(event.label, blocks, true);
+                cfgPrinter.printCFG(event.label, blocks);
             }
         }
         if (allocator != null && intervals != null) {
@@ -116,7 +124,7 @@
     }
 
     @Override
-    public void compilationFinished(GraalCompilation compilation) {
+    public void compilationFinished(CompilationEvent event) {
         if (TTY.isSuppressed()) {
             return;
         }
--- a/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinterObserver.java	Fri Jan 13 11:04:30 2012 +0100
+++ b/graal/com.oracle.max.graal.printer/src/com/oracle/max/graal/printer/IdealGraphPrinterObserver.java	Fri Jan 13 18:46:56 2012 +0100
@@ -85,23 +85,23 @@
     }
 
     @Override
-    public void compilationStarted(GraalCompilation compilation) {
-        openPrinter(compilation, false);
+    public void compilationStarted(CompilationEvent event) {
+        openPrinter(event.debugObject(RiResolvedMethod.class), false);
     }
 
-    private void openPrinter(GraalCompilation compilation, boolean error) {
+    private void openPrinter(RiResolvedMethod method, boolean error) {
         assert (context().stream == null && printer() == null);
         if ((!TTY.isSuppressed() && GraalOptions.Plot) || (GraalOptions.PlotOnError && error)) {
             String name;
-            if (compilation != null) {
-                name = compilation.method.holder().name();
+            if (method != null) {
+                name = method.holder().name();
                 name = name.substring(1, name.length() - 1).replace('/', '.');
-                name = name + "." + compilation.method.name();
+                name = name + "." + method.name();
             } else {
                 name = "null";
             }
 
-            openPrinter(name, compilation == null ? null : compilation.method);
+            openPrinter(name, method);
         }
     }
 
@@ -189,7 +189,7 @@
     public void compilationEvent(CompilationEvent event) {
         boolean lazyStart = false;
         if (printer() == null && event.hasDebugObject(CompilationEvent.ERROR)) {
-            openPrinter(event.debugObject(GraalCompilation.class), true);
+            openPrinter(event.debugObject(RiResolvedMethod.class), true);
             lazyStart = true;
         }
         Graph graph = event.debugObject(Graph.class);
@@ -202,7 +202,7 @@
     }
 
     @Override
-    public void compilationFinished(GraalCompilation compilation) {
+    public void compilationFinished(CompilationEvent event) {
         if (printer() != null) {
             closePrinter();
         }
--- a/hotspot/.cproject	Fri Jan 13 11:04:30 2012 +0100
+++ b/hotspot/.cproject	Fri Jan 13 18:46:56 2012 +0100
@@ -36,6 +36,9 @@
 									<listOptionValue builtIn="false" value="_REENTRANT=1"/>
 									<listOptionValue builtIn="false" value="DEBUG=1"/>
 									<listOptionValue builtIn="false" value="AMD64=1"/>
+									<listOptionValue builtIn="false" value="LINUX=1"/>
+									<listOptionValue builtIn="false" value="TARGET_ARCH_x86"/>
+									<listOptionValue builtIn="false" value="TARGET_COMPILER_gcc=1"/>
 								</option>
 								<option id="gnu.cpp.compiler.option.preprocessor.undef.2137486146" name="Undefined symbols (-U)" superClass="gnu.cpp.compiler.option.preprocessor.undef" valueType="undefDefinedSymbols">
 									<listOptionValue builtIn="false" value="PRODUCT"/>
--- a/hotspot/.project	Fri Jan 13 11:04:30 2012 +0100
+++ b/hotspot/.project	Fri Jan 13 18:46:56 2012 +0100
@@ -93,7 +93,7 @@
 		<link>
 			<name>generated</name>
 			<type>2</type>
-			<locationURI>PARENT-1-PROJECT_LOC/build/linux/linux_amd64_compiler1/generated</locationURI>
+			<locationURI>PARENT-1-PROJECT_LOC/build/linux/linux_amd64_graal/generated</locationURI>
 		</link>
 		<link>
 			<name>os</name>
--- a/hotspot/.settings/org.eclipse.core.runtime.prefs	Fri Jan 13 11:04:30 2012 +0100
+++ b/hotspot/.settings/org.eclipse.core.runtime.prefs	Fri Jan 13 18:46:56 2012 +0100
@@ -1,6 +1,6 @@
 #Wed Sep 01 16:13:40 PDT 2010
 content-types/enabled=true
-content-types/org.eclipse.cdt.core.cHeader/file-extensions=hpp,incl
+content-types/org.eclipse.cdt.core.cxxHeader/file-extensions=hpp,incl
 content-types/org.eclipse.cdt.core.cxxSource/file-extensions=cpp
 eclipse.preferences.version=1
 
--- a/mx/commands.py	Fri Jan 13 11:04:30 2012 +0100
+++ b/mx/commands.py	Fri Jan 13 18:46:56 2012 +0100
@@ -26,8 +26,8 @@
 #
 # ----------------------------------------------------------------------------------------------------
 
-import os, sys, shutil, StringIO, zipfile, tempfile, re, time, datetime, platform, subprocess
-from os.path import join, exists, dirname, isdir, isabs, basename
+import os, sys, shutil, zipfile, tempfile, re, time, datetime, platform, subprocess, StringIO
+from os.path import join, exists, dirname, basename
 from argparse import ArgumentParser, REMAINDER
 import mx
 import sanitycheck
@@ -36,6 +36,31 @@
 _vmSourcesAvailable = exists(join(_graal_home, 'make')) and exists(join(_graal_home, 'src')) 
 _vmbuild = 'product'
 
+_copyrightTemplate = """/*
+ * Copyright (c) {0}, 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.
+ */
+ 
+"""
+
 def clean(args):
     """cleans the GraalVM source tree"""
     opts = mx.clean(args, parser=ArgumentParser(prog='mx clean'))
@@ -243,30 +268,30 @@
 
     p = subprocess.Popen('cmd.exe /E:ON /V:ON /K ""' + winSDK + '/Bin/SetEnv.cmd" & echo ' + STARTTOKEN + '"', \
             shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
-    output = p.stdout
-    input = p.stdin
+    stdout = p.stdout
+    stdin = p.stdin
     if logFile:
         log = open(logFile, 'w')
     ret = False
     while True:
-        line = output.readline().decode()
+        line = stdout.readline().decode()
         if logFile:
             log.write(line)
         line = line.strip()
         mx.log(line)
         if line == STARTTOKEN:
-            input.write('cd /D ' + workingDir + ' & ' + cmd + ' & echo ' + ENDTOKEN + newLine)
+            stdin.write('cd /D ' + workingDir + ' & ' + cmd + ' & echo ' + ENDTOKEN + newLine)
         for regex in respondTo.keys():
             match = regex.search(line)
             if match:
-                input.write(respondTo[regex] + newLine)
+                stdin.write(respondTo[regex] + newLine)
         if findInOutput:
             match = findInOutput.search(line)
             if match:
                 ret = True
         if line == ENDTOKEN:
             break
-    input.write('exit' + newLine)
+    stdin.write('exit' + newLine)
     if logFile:
         log.close()
     return ret
@@ -304,6 +329,16 @@
             if not 'Xusage.txt' in line:
                 sys.stderr.write(line + os.linesep)
                 
+        # Update graal_paths.hpp
+        out = StringIO.StringIO()
+        out.write(_copyrightTemplate.format(time.strftime('%Y')))
+        for p in mx.project('com.oracle.max.graal.hotspot').all_deps([], False):
+            out.write('    prepend_to_graal_classpath(scp_compiler, graal_dir, "' + p.name + '");\n')
+        graalPaths = join(_graal_home, 'src', 'share', 'vm', 'graal', 'graal_paths.hpp')
+        assert exists(graalPaths), 'File does not exist: ' + graalPaths
+        mx.update_file(graalPaths, out.getvalue())
+        out.close()
+                
         if platform.system() == 'Windows':
             compilelogfile = _graal_home + '/graalCompile.log'
             mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin')
@@ -338,136 +373,6 @@
     exe = join(_jdk(build), 'bin', mx.exe_suffix('java'))
     return mx.run([exe, vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)
 
-def ideinit(args):
-    """(re)generate Eclipse project configurations"""
-
-
-    def println(out, obj):
-        out.write(str(obj) + '\n')
-        
-    for p in mx.projects():
-        if p.native:
-            continue
-        
-        if not exists(p.dir):
-            os.makedirs(p.dir)
-
-        out = StringIO.StringIO()
-        
-        println(out, '<?xml version="1.0" encoding="UTF-8"?>')
-        println(out, '<classpath>')
-        for src in p.srcDirs:
-            srcDir = join(p.dir, src)
-            if not exists(srcDir):
-                os.mkdir(srcDir)
-            println(out, '\t<classpathentry kind="src" path="' + src + '"/>')
-    
-        # Every Java program depends on the JRE
-        println(out, '\t<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>')
-        
-        for dep in p.all_deps([], True):
-            if dep == p:
-                continue;
-            
-            if dep.isLibrary():
-                if hasattr(dep, 'eclipse.container'):
-                    println(out, '\t<classpathentry exported="true" kind="con" path="' + getattr(dep, 'eclipse.container') + '"/>')
-                elif hasattr(dep, 'eclipse.project'):
-                    println(out, '\t<classpathentry combineaccessrules="false" exported="true" kind="src" path="/' + getattr(dep, 'eclipse.project') + '"/>')
-                else:
-                    path = dep.path
-                    if dep.mustExist:
-                        if isabs(path):
-                            println(out, '\t<classpathentry exported="true" kind="lib" path="' + path + '"/>')
-                        else:
-                            println(out, '\t<classpathentry exported="true" kind="lib" path="/' + path + '"/>')
-            else:
-                println(out, '\t<classpathentry combineaccessrules="false" exported="true" kind="src" path="/' + dep.name + '"/>')
-                        
-        println(out, '\t<classpathentry kind="output" path="' + getattr(p, 'eclipse.output', 'bin') + '"/>')
-        println(out, '</classpath>')
-        mx.update_file(join(p.dir, '.classpath'), out.getvalue())
-        out.close()
-
-        csConfig = join(mx.project(p.checkstyleProj).dir, '.checkstyle_checks.xml')
-        if exists(csConfig):
-            out = StringIO.StringIO()
-            
-            dotCheckstyle = join(p.dir, ".checkstyle")
-            checkstyleConfigPath = '/' + p.checkstyleProj + '/.checkstyle_checks.xml'
-            println(out, '<?xml version="1.0" encoding="UTF-8"?>')
-            println(out, '<fileset-config file-format-version="1.2.0" simple-config="true">')
-            println(out, '\t<local-check-config name="Graal Checks" location="' + checkstyleConfigPath + '" type="project" description="">')
-            println(out, '\t\t<additional-data name="protect-config-file" value="false"/>')
-            println(out, '\t</local-check-config>')
-            println(out, '\t<fileset name="all" enabled="true" check-config-name="Graal Checks" local="true">')
-            println(out, '\t\t<file-match-pattern match-pattern="." include-pattern="true"/>')
-            println(out, '\t</fileset>')
-            println(out, '\t<filter name="FileTypesFilter" enabled="true">')
-            println(out, '\t\t<filter-data value="java"/>')
-            println(out, '\t</filter>')
-
-            exclude = join(p.dir, '.checkstyle.exclude')
-            if exists(exclude):
-                println(out, '\t<filter name="FilesFromPackage" enabled="true">')
-                with open(exclude) as f:
-                    for line in f:
-                        if not line.startswith('#'):
-                            line = line.strip()
-                            exclDir = join(p.dir, line)
-                            assert isdir(exclDir), 'excluded source directory listed in ' + exclude + ' does not exist or is not a directory: ' + exclDir
-                        println(out, '\t\t<filter-data value="' + line + '"/>')
-                println(out, '\t</filter>')
-                        
-            println(out, '</fileset-config>')
-            mx.update_file(dotCheckstyle, out.getvalue())
-            out.close()
-        
-
-        out = StringIO.StringIO()
-        
-        println(out, '<?xml version="1.0" encoding="UTF-8"?>')
-        println(out, '<projectDescription>')
-        println(out, '\t<name>' + p.name + '</name>')
-        println(out, '\t<comment></comment>')
-        println(out, '\t<projects>')
-        println(out, '\t</projects>')
-        println(out, '\t<buildSpec>')
-        println(out, '\t\t<buildCommand>')
-        println(out, '\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>')
-        println(out, '\t\t\t<arguments>')
-        println(out, '\t\t\t</arguments>')
-        println(out, '\t\t</buildCommand>')
-        if exists(csConfig):
-            println(out, '\t\t<buildCommand>')
-            println(out, '\t\t\t<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>')
-            println(out, '\t\t\t<arguments>')
-            println(out, '\t\t\t</arguments>')
-            println(out, '\t\t</buildCommand>')
-        println(out, '\t</buildSpec>')
-        println(out, '\t<natures>')
-        println(out, '\t\t<nature>org.eclipse.jdt.core.javanature</nature>')
-        if exists(csConfig):
-            println(out, '\t\t<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>')
-        println(out, '\t</natures>')
-        println(out, '</projectDescription>')
-        mx.update_file(join(p.dir, '.project'), out.getvalue())
-        out.close()
-
-        out = StringIO.StringIO()
-        settingsDir = join(p.dir, ".settings")
-        if not exists(settingsDir):
-            os.mkdir(settingsDir)
-
-        myDir = dirname(__file__)
-        
-        with open(join(myDir, 'org.eclipse.jdt.core.prefs')) as f:
-            content = f.read()
-        mx.update_file(join(settingsDir, 'org.eclipse.jdt.core.prefs'), content)
-            
-        with open(join(myDir, 'org.eclipse.jdt.ui.prefs')) as f:
-            content = f.read()
-        mx.update_file(join(settingsDir, 'org.eclipse.jdt.ui.prefs'), content)
 
 # Table of unit tests.
 # Keys are project names, values are package name lists.
@@ -631,8 +536,7 @@
         'gate' : [gate, ''],
         'bench' : [bench, ''],
         'unittest' : [unittest, '[filters...]'],
-        'vm': [vm, '[-options] class [args...]'],
-        'ideinit': [ideinit, '']
+        'vm': [vm, '[-options] class [args...]']
     }
 
     if (_vmSourcesAvailable):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mx/eclipse-settings/org.eclipse.jdt.core.prefs	Fri Jan 13 18:46:56 2012 +0100
@@ -0,0 +1,384 @@
+#Sun Dec 18 01:19:17 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=ignore
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=true
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=4
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=8
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=200
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=false
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mx/eclipse-settings/org.eclipse.jdt.ui.prefs	Fri Jan 13 18:46:56 2012 +0100
@@ -0,0 +1,121 @@
+cleanup.add_default_serial_version_id=false
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=false
+cleanup.add_missing_deprecated_annotations=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=false
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=false
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.format_source_code=false
+cleanup.make_local_variable_final=false
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=false
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=false
+cleanup.remove_trailing_whitespaces=false
+cleanup.remove_trailing_whitespaces_all=false
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=false
+cleanup.remove_unnecessary_nls_tags=false
+cleanup.remove_unused_imports=false
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=false
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=false
+cleanup.remove_unused_private_types=false
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=false
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=false
+cleanup_profile=_CleanUpAgitarTests
+cleanup_settings_version=2
+comment_clear_blank_lines=false
+comment_format_comments=true
+comment_format_header=true
+comment_format_html=true
+comment_format_source_code=true
+comment_indent_parameter_description=true
+comment_indent_root_tags=true
+comment_line_length=120
+comment_new_line_for_parameter=true
+comment_separate_root_tags=true
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_MaxineJavaCodeStyle
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=0
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=0
+sp_cleanup.add_default_serial_version_id=false
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=false
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=false
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=false
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=false
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=false
+sp_cleanup.remove_unused_private_types=false
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
--- a/mx/org.eclipse.jdt.core.prefs	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,384 +0,0 @@
-#Sun Dec 18 01:19:17 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.builder.cleanOutputFolder=clean
-org.eclipse.jdt.core.builder.duplicateResourceTask=warning
-org.eclipse.jdt.core.builder.invalidClasspath=abort
-org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
-org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
-org.eclipse.jdt.core.circularClasspath=error
-org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
-org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=ignore
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.processAnnotations=disabled
-org.eclipse.jdt.core.compiler.source=1.7
-org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
-org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
-org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=true
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
-org.eclipse.jdt.core.formatter.comment.line_length=120
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=4
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=8
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=true
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=200
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=space
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=false
-org.eclipse.jdt.core.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
--- a/mx/org.eclipse.jdt.ui.prefs	Fri Jan 13 11:04:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-cleanup.add_default_serial_version_id=false
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=false
-cleanup.add_missing_deprecated_annotations=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=false
-cleanup.add_serial_version_id=false
-cleanup.always_use_blocks=false
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.format_source_code=false
-cleanup.make_local_variable_final=false
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=false
-cleanup.organize_imports=false
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
-cleanup.qualify_static_member_accesses_with_declaring_class=false
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=false
-cleanup.remove_trailing_whitespaces=false
-cleanup.remove_trailing_whitespaces_all=false
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=false
-cleanup.remove_unnecessary_nls_tags=false
-cleanup.remove_unused_imports=false
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=false
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=false
-cleanup.remove_unused_private_types=false
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=false
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=false
-cleanup.use_this_for_non_static_field_access=false
-cleanup.use_this_for_non_static_field_access_only_if_necessary=false
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=false
-cleanup_profile=_CleanUpAgitarTests
-cleanup_settings_version=2
-comment_clear_blank_lines=false
-comment_format_comments=true
-comment_format_header=true
-comment_format_html=true
-comment_format_source_code=true
-comment_indent_parameter_description=true
-comment_indent_root_tags=true
-comment_line_length=120
-comment_new_line_for_parameter=true
-comment_separate_root_tags=true
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_MaxineJavaCodeStyle
-formatter_settings_version=11
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=java;javax;org;com;
-org.eclipse.jdt.ui.javadoc=false
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.ondemandthreshold=0
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.staticondemandthreshold=0
-sp_cleanup.add_default_serial_version_id=false
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=false
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=false
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=false
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=false
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=false
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=false
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=false
-sp_cleanup.remove_unused_private_types=false
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false
--- a/mxtool/mx.py	Fri Jan 13 11:04:30 2012 +0100
+++ b/mxtool/mx.py	Fri Jan 13 18:46:56 2012 +0100
@@ -89,13 +89,14 @@
 from collections import Callable
 from threading import Thread
 from argparse import ArgumentParser, REMAINDER
-from os.path import join, dirname, exists, getmtime, isabs, expandvars, isdir
+from os.path import join, dirname, exists, getmtime, isabs, expandvars, isdir, isfile
 
 DEFAULT_JAVA_ARGS = '-ea -Xss2m -Xmx1g'
 
 _projects = dict()
 _libs = dict()
 _suites = dict()
+_mainSuite = None
 _opts = None
 _java = None
 
@@ -201,7 +202,7 @@
 class Library(Dependency):
     def __init__(self, suite, name, path, mustExist, urls):
         Dependency.__init__(self, suite, name)
-        self.path = path
+        self.path = path.replace('/', os.sep)
         self.urls = urls
         self.mustExist = mustExist
     
@@ -213,6 +214,7 @@
             assert not len(self.urls) == 0, 'cannot find required library  ' + self.name + " " + path;
             print('Downloading ' + self.name + ' from ' + str(self.urls))
             download(path, self.urls)
+            
         return path
         
     def append_to_classpath(self, cp, resolve):
@@ -287,7 +289,7 @@
             self.projects.append(p)
 
         for name, attrs in libsMap.iteritems():
-            path = attrs['path']
+            path = attrs.pop('path')
             mustExist = attrs.pop('optional', 'false') != 'true'
             urls = pop_list(attrs, 'urls')
             l = Library(self, name, path, mustExist, urls)
@@ -365,10 +367,11 @@
 def _loadSuite(dir, primary=False):
     mxDir = join(dir, 'mx')
     if not exists(mxDir) or not isdir(mxDir):
-        return
+        return None
     if not _suites.has_key(dir):
         suite = Suite(dir, primary)
-        _suites[dir] = suite 
+        _suites[dir] = suite
+        return suite 
 
 def suites():
     """
@@ -463,7 +466,6 @@
             self.add_argument('--timeout', help='Timeout (in seconds) for command', type=int, default=0, metavar='<secs>')
             self.add_argument('--ptimeout', help='Timeout (in seconds) for subprocesses', type=int, default=0, metavar='<secs>')
         
-        
     def _parse_cmd_line(self, args=None):
         if args is None:
             args = sys.argv[1:]
@@ -471,6 +473,10 @@
         self.add_argument('commandAndArgs', nargs=REMAINDER, metavar='command args...')
         
         opts = self.parse_args()
+        
+        # Give the timeout options a default value to avoid the need for hasattr() tests
+        opts.__dict__.setdefault('timeout', 0)
+        opts.__dict__.setdefault('ptimeout', 0)
 
         if opts.java_home is None:
             opts.java_home = os.environ.get('JAVA_HOME')
@@ -567,7 +573,7 @@
     if _opts.verbose:
         log(' '.join(args))
         
-    if timeout is None and hasattr(_opts, 'ptimeout') and _opts.ptimeout != 0:
+    if timeout is None and _opts.ptimeout != 0:
         timeout = _opts.ptimeout
 
     global _currentSubprocess    
@@ -631,7 +637,7 @@
     """
     Gets the platform specific suffix for an executable 
     """
-    if os == 'windows':
+    if get_os() == 'windows':
         return name + '.exe'
     return name
 
@@ -646,6 +652,9 @@
         self.javac = exe_suffix(join(self.jdk, 'bin', 'javac'))
         self.javap = exe_suffix(join(self.jdk, 'bin', 'javap'))
 
+        if not exists(self.java):
+            abort('Java launcher derived from JAVA_HOME does not exist: ' + self.java)
+
         def delAtAndSplit(s):
             return shlex.split(s.lstrip('@'))
         
@@ -907,7 +916,6 @@
                     mustBuild = True
             
         javafilelist = []
-        nonjavafilelistdst = []
         for sourceDir in sourceDirs:
             for root, _, files in os.walk(sourceDir):
                 javafiles = [join(root, name) for name in files if name.endswith('.java') and name != 'package-info.java']
@@ -1182,7 +1190,357 @@
     print 'mx {0} {1}\n\n{2}\n'.format(name, usage, doc)
 
 
-# Commands are in alphabetical order in this file.
+def eclipseinit(args, suite=None):
+    """(re)generate Eclipse project configurations"""
+
+    if suite is None:
+        suite = _mainSuite
+        
+    def println(out, obj):
+        out.write(str(obj) + '\n')
+        
+    for p in projects():
+        if p.native:
+            continue
+        
+        if not exists(p.dir):
+            os.makedirs(p.dir)
+
+        out = StringIO.StringIO()
+        
+        println(out, '<?xml version="1.0" encoding="UTF-8"?>')
+        println(out, '<classpath>')
+        for src in p.srcDirs:
+            srcDir = join(p.dir, src)
+            if not exists(srcDir):
+                os.mkdir(srcDir)
+            println(out, '\t<classpathentry kind="src" path="' + src + '"/>')
+    
+        # Every Java program depends on the JRE
+        println(out, '\t<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>')
+        
+        for dep in p.all_deps([], True):
+            if dep == p:
+                continue;
+            
+            if dep.isLibrary():
+                if hasattr(dep, 'eclipse.container'):
+                    println(out, '\t<classpathentry exported="true" kind="con" path="' + getattr(dep, 'eclipse.container') + '"/>')
+                elif hasattr(dep, 'eclipse.project'):
+                    println(out, '\t<classpathentry combineaccessrules="false" exported="true" kind="src" path="/' + getattr(dep, 'eclipse.project') + '"/>')
+                else:
+                    path = dep.path
+                    if dep.mustExist:
+                        dep.get_path(resolve=True)
+                        if isabs(path):
+                            println(out, '\t<classpathentry exported="true" kind="lib" path="' + path + '"/>')
+                        else:
+                            println(out, '\t<classpathentry exported="true" kind="lib" path="' + join(suite.dir, path) + '"/>')
+            else:
+                println(out, '\t<classpathentry combineaccessrules="false" exported="true" kind="src" path="/' + dep.name + '"/>')
+                        
+        println(out, '\t<classpathentry kind="output" path="' + getattr(p, 'eclipse.output', 'bin') + '"/>')
+        println(out, '</classpath>')
+        update_file(join(p.dir, '.classpath'), out.getvalue())
+        out.close()
+
+        csConfig = join(project(p.checkstyleProj).dir, '.checkstyle_checks.xml')
+        if exists(csConfig):
+            out = StringIO.StringIO()
+            
+            dotCheckstyle = join(p.dir, ".checkstyle")
+            checkstyleConfigPath = '/' + p.checkstyleProj + '/.checkstyle_checks.xml'
+            println(out, '<?xml version="1.0" encoding="UTF-8"?>')
+            println(out, '<fileset-config file-format-version="1.2.0" simple-config="true">')
+            println(out, '\t<local-check-config name="Checks" location="' + checkstyleConfigPath + '" type="project" description="">')
+            println(out, '\t\t<additional-data name="protect-config-file" value="false"/>')
+            println(out, '\t</local-check-config>')
+            println(out, '\t<fileset name="all" enabled="true" check-config-name="Checks" local="true">')
+            println(out, '\t\t<file-match-pattern match-pattern="." include-pattern="true"/>')
+            println(out, '\t</fileset>')
+            println(out, '\t<filter name="FileTypesFilter" enabled="true">')
+            println(out, '\t\t<filter-data value="java"/>')
+            println(out, '\t</filter>')
+
+            exclude = join(p.dir, '.checkstyle.exclude')
+            if exists(exclude):
+                println(out, '\t<filter name="FilesFromPackage" enabled="true">')
+                with open(exclude) as f:
+                    for line in f:
+                        if not line.startswith('#'):
+                            line = line.strip()
+                            exclDir = join(p.dir, line)
+                            assert isdir(exclDir), 'excluded source directory listed in ' + exclude + ' does not exist or is not a directory: ' + exclDir
+                        println(out, '\t\t<filter-data value="' + line + '"/>')
+                println(out, '\t</filter>')
+                        
+            println(out, '</fileset-config>')
+            update_file(dotCheckstyle, out.getvalue())
+            out.close()
+        
+
+        out = StringIO.StringIO()
+        
+        println(out, '<?xml version="1.0" encoding="UTF-8"?>')
+        println(out, '<projectDescription>')
+        println(out, '\t<name>' + p.name + '</name>')
+        println(out, '\t<comment></comment>')
+        println(out, '\t<projects>')
+        println(out, '\t</projects>')
+        println(out, '\t<buildSpec>')
+        println(out, '\t\t<buildCommand>')
+        println(out, '\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>')
+        println(out, '\t\t\t<arguments>')
+        println(out, '\t\t\t</arguments>')
+        println(out, '\t\t</buildCommand>')
+        if exists(csConfig):
+            println(out, '\t\t<buildCommand>')
+            println(out, '\t\t\t<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>')
+            println(out, '\t\t\t<arguments>')
+            println(out, '\t\t\t</arguments>')
+            println(out, '\t\t</buildCommand>')
+        println(out, '\t</buildSpec>')
+        println(out, '\t<natures>')
+        println(out, '\t\t<nature>org.eclipse.jdt.core.javanature</nature>')
+        if exists(csConfig):
+            println(out, '\t\t<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>')
+        println(out, '\t</natures>')
+        println(out, '</projectDescription>')
+        update_file(join(p.dir, '.project'), out.getvalue())
+        out.close()
+
+        out = StringIO.StringIO()
+        settingsDir = join(p.dir, ".settings")
+        if not exists(settingsDir):
+            os.mkdir(settingsDir)
+
+        eclipseSettingsDir = join(suite.dir, 'mx', 'eclipse-settings')
+        if exists(eclipseSettingsDir):
+            for name in os.listdir(eclipseSettingsDir):
+                path = join(eclipseSettingsDir, name)
+                if isfile(path):
+                    with open(join(eclipseSettingsDir, name)) as f:
+                        content = f.read()
+                    update_file(join(settingsDir, name), content)
+
+def netbeansinit(args, suite=None):
+    """(re)generate NetBeans project configurations"""
+
+    if suite is None:
+        suite = _mainSuite
+
+    def println(out, obj):
+        out.write(str(obj) + '\n')
+        
+    updated = False
+    for p in projects():
+        if p.native:
+            continue
+        
+        if not exists(join(p.dir, 'nbproject')):
+            os.makedirs(join(p.dir, 'nbproject'))
+
+        out = StringIO.StringIO()
+        
+        println(out, '<?xml version="1.0" encoding="UTF-8"?>')
+        println(out, '<project name="' + p.name + '" default="default" basedir=".">')
+        println(out, '\t<description>Builds, tests, and runs the project ' + p.name + '.</description>')
+        println(out, '\t<import file="nbproject/build-impl.xml"/>')
+        println(out, '</project>')
+        updated = update_file(join(p.dir, 'build.xml'), out.getvalue()) or updated
+        out.close()
+        
+        out = StringIO.StringIO()
+        println(out, '<?xml version="1.0" encoding="UTF-8"?>')
+        println(out, '<project xmlns="http://www.netbeans.org/ns/project/1">')
+        println(out, '    <type>org.netbeans.modules.java.j2seproject</type>')
+        println(out, '    <configuration>')
+        println(out, '        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">')
+        println(out, '            <name>' + p.name+ '</name>')
+        println(out, '            <explicit-platform explicit-source-supported="true"/>')
+        println(out, '            <source-roots>')
+        println(out, '                <root id="src.dir"/>')
+        println(out, '            </source-roots>')
+        println(out, '            <test-roots>')
+        println(out, '                <root id="test.src.dir"/>')
+        println(out, '            </test-roots>')
+        println(out, '        </data>')
+        
+        firstDep = True
+        for dep in p.all_deps([], True):
+            if dep == p:
+                continue;
+            
+            if not dep.isLibrary():
+                n = dep.name.replace('.', '_')
+                if firstDep:
+                    println(out, '        <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">')
+                    firstDep = False
+                    
+                println(out, '            <reference>')
+                println(out, '                <foreign-project>' + n + '</foreign-project>')
+                println(out, '                <artifact-type>jar</artifact-type>')
+                println(out, '                <script>build.xml</script>')
+                println(out, '                <target>jar</target>')
+                println(out, '                <clean-target>clean</clean-target>')
+                println(out, '                <id>jar</id>')
+                println(out, '            </reference>')
+            
+        if not firstDep:
+            println(out, '        </references>')
+            
+        println(out, '    </configuration>')
+        println(out, '</project>')
+        updated = update_file(join(p.dir, 'nbproject', 'project.xml'), out.getvalue()) or updated
+        out.close()
+        
+        out = StringIO.StringIO()
+        
+        jdkPlatform = 'JDK_' + java().version
+        
+        content = """
+annotation.processing.enabled=false
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=""" + p.name + """
+application.vendor=mx
+build.classes.dir=${build.dir}
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=bin
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\\
+    ${run.classpath}
+debug.test.classpath=\\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/""" + p.name + """.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+includes=**
+jar.compress=false
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\\
+    ${javac.classpath}
+javac.source=1.7
+javac.target=1.7
+javac.test.classpath=\\
+    ${javac.classpath}:\\
+    ${build.classes.dir}
+javac.test.processorpath=\\
+    ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platforms.""" + jdkPlatform + """.home=""" + java().jdk + """
+platform.active=""" + jdkPlatform + """
+run.classpath=\\
+    ${javac.classpath}:\\
+    ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\\
+    ${javac.test.classpath}:\\
+    ${build.test.classes.dir}
+test.src.dir=
+source.encoding=UTF-8""".replace(':', os.pathsep).replace('/', os.sep)
+        println(out, content)
+
+        mainSrc = True
+        for src in p.srcDirs:
+            srcDir = join(p.dir, src)
+            if not exists(srcDir):
+                os.mkdir(srcDir)
+            ref = 'file.reference.' + p.name + '-' + src
+            println(out, ref + '=' + src)
+            if mainSrc:
+                println(out, 'src.dir=${' + ref + '}')
+                mainSrc = False
+            else:
+                println(out, 'src.' + src + '.dir=${' + ref + '}')
+            
+        javacClasspath = []    
+        for dep in p.all_deps([], True):
+            if dep == p:
+                continue;
+            
+            if dep.isLibrary():
+                if not dep.mustExist:
+                    continue
+                path = dep.get_path(resolve=True)
+                if os.sep == '\\':
+                    path = path.replace('\\', '\\\\')
+                ref = 'file.reference.' + dep.name + '-bin'
+                println(out, ref + '=' + path)
+                    
+            else:
+                n = dep.name.replace('.', '_')
+                relDepPath = os.path.relpath(dep.dir, p.dir).replace(os.sep, '/')
+                ref = 'reference.' + n + '.jar'
+                println(out, 'project.' + n + '=' + relDepPath)
+                println(out, ref + '=${project.' + n + '}/dist/' + dep.name + '.jar')
+                
+            javacClasspath.append('${' + ref + '}')
+            
+        println(out, 'javac.classpath=\\\n    ' + (os.pathsep + '\\\n    ').join(javacClasspath))
+        
+
+        updated = update_file(join(p.dir, 'nbproject', 'project.properties'), out.getvalue()) or updated
+        out.close()
+    
+    if updated:
+        log('If using NetBeans:')
+        log('  1. Ensure that a platform named "JDK ' + java().version + '" is defined (Tools -> Java Platforms)')
+        log('  2. Open/create a Project Group for the directory containing the projects (File -> Project Group -> New Group... -> Folder of Projects)')
+
+def ideclean(args, suite=None):
+    """remove all Eclipse and NetBeans project configurations"""
+    
+    def rm(path):
+        if exists(path):
+            os.remove(path)
+    
+    for p in projects():
+        if p.native:
+            continue
+        
+        shutil.rmtree(join(p.dir, '.settings'), ignore_errors=True)
+        shutil.rmtree(join(p.dir, 'nbproject'), ignore_errors=True)
+        rm(join(p.dir, '.classpath'))
+        rm(join(p.dir, '.project'))
+        rm(join(p.dir, 'build.xml'))
+        
+def ideinit(args, suite=None):
+    """(re)generate Eclipse and NetBeans project configurations"""
+    eclipseinit(args, suite)
+    netbeansinit(args, suite)
 
 def javap(args):
     """launch javap with a -classpath option denoting all available classes
@@ -1223,8 +1581,12 @@
     'checkstyle': [checkstyle, ''],
     'canonicalizeprojects': [canonicalizeprojects, ''],
     'clean': [clean, ''],
+    'eclipseinit': [eclipseinit, ''],
     'help': [help_, '[command]'],
+    'ideclean': [ideclean, ''],
+    'ideinit': [ideinit, ''],
     'javap': [javap, ''],
+    'netbeansinit': [netbeansinit, ''],
     'projects': [show_projects, ''],
 }
 
@@ -1233,7 +1595,8 @@
 def main():
     cwdMxDir = join(os.getcwd(), 'mx')
     if exists(cwdMxDir) and isdir(cwdMxDir):
-        _loadSuite(os.getcwd(), True)
+        global _mainSuite
+        _mainSuite = _loadSuite(os.getcwd(), True)
             
     opts, commandAndArgs = _argParser._parse_cmd_line()
     
@@ -1256,7 +1619,7 @@
         
     c, _ = commands[command][:2]
     try:
-        if hasattr(opts, 'timeout') and opts.timeout != 0:
+        if opts.timeout != 0:
             def alarm_handler(signum, frame):
                 abort('Command timed out after ' + str(opts.timeout) + ' seconds: ' + ' '.join(commandAndArgs))
             signal.signal(signal.SIGALRM, alarm_handler)