changeset 5547:b6617d13ea44

Dropping Ci* prefixes. Some additional renamings in the api.code interface.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 09 Jun 2012 20:10:05 +0200
parents e42c0df7212a
children 8872bc0eebdf
files graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/LocationUtil.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/MoveResolver.java graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BailoutException.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodeFrame.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodePosition.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CalleeSaveLayout.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CallingConvention.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiAddress.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiArchitecture.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiAssumptions.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiBailout.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCalleeSaveLayout.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCallingConvention.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCodePos.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCompilationStatistics.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiDebugInfo.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiDeoptAction.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiFrame.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiMonitorValue.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegister.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterAttributes.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterConfig.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterConfigImpl.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterValue.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRuntimeCall.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiStackSlot.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTarget.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiUtil.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiValueUtil.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DebugInfo.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DeoptimizationAction.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Register.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterAttributes.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterConfig.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterConfigImpl.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RuntimeCall.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlot.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/OptimisticOptimizations.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/InstructionPrinter.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirAssembler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypeCachePhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/Util.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRegisterConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/DirectStoreNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64SafepointOp.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64TailcallOp.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRValueUtil.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRXirInstruction.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueUtil.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueUtil.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64MathIntrinsicOp.java graal/com.oracle.max.asm/src/com/oracle/max/asm/AbstractAssembler.java graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64.java graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSite.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseProfilingInfo.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/SnapshotProfilingInfo.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TypeCheckHints.java src/share/vm/classfile/systemDictionary.hpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/graal/graalCompilerToVM.cpp src/share/vm/graal/graalJavaAccess.hpp
diffstat 165 files changed, 5049 insertions(+), 5055 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,8 +22,8 @@
  */
 package com.oracle.graal.alloc.simple;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
-import static com.oracle.graal.lir.ValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
+import static com.oracle.graal.lir.LIRValueUtil.*;
 
 import java.util.*;
 
@@ -36,9 +36,9 @@
 
 public class DataFlowAnalysis {
     private final LIR lir;
-    private final CiRegisterConfig registerConfig;
+    private final RegisterConfig registerConfig;
 
-    public DataFlowAnalysis(LIR lir, CiRegisterConfig registerConfig) {
+    public DataFlowAnalysis(LIR lir, RegisterConfig registerConfig) {
         this.lir = lir;
         this.registerConfig = registerConfig;
     }
--- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java	Sat Jun 09 20:10:05 2012 +0200
@@ -27,7 +27,7 @@
 
 import com.oracle.graal.alloc.util.*;
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiRegister.*;
+import com.oracle.graal.api.code.Register.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.debug.*;
 import com.oracle.graal.graph.*;
@@ -62,14 +62,14 @@
         protected Value scratchRegister(Variable spilled) {
             GraalInternalError.shouldNotReachHere("needs working implementation");
 
-            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-            CiRegister[] availableRegs = categorizedRegs.get(spilled.flag);
-            for (CiRegister reg : availableRegs) {
+            EnumMap<RegisterFlag, Register[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+            Register[] availableRegs = categorizedRegs.get(spilled.flag);
+            for (Register reg : availableRegs) {
                 if (curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null) {
                     return reg.asValue(spilled.kind);
                 }
             }
-            throw new CiBailout("No register found");
+            throw new BailoutException("No register found");
         }
     }
 
@@ -323,7 +323,7 @@
 
     private void spillCallerSaveRegisters() {
         Debug.log("    spill caller save registers in curInRegisterState %s", Arrays.toString(curInRegisterState));
-        for (CiRegister reg : frameMap.registerConfig.getCallerSaveRegisters()) {
+        for (Register reg : frameMap.registerConfig.getCallerSaveRegisters()) {
             Value in = curInRegisterState[reg.number];
             if (in != null && isLocation(in)) {
                 spill(asLocation(in));
@@ -431,7 +431,7 @@
             return null;
         }
         Debug.log("      try registerHint for %s %s: %s", mode, variable, registerHint);
-        CiRegister hint = null;
+        Register hint = null;
         if (isRegister(registerHint)) {
             hint = asRegister(registerHint);
         } else if (isLocation(registerHint) && isRegister(asLocation(registerHint).location)) {
@@ -461,11 +461,11 @@
             return asLocation(hintResult);
         }
 
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-        CiRegister[] availableRegs = categorizedRegs.get(variable.flag);
+        EnumMap<RegisterFlag, Register[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+        Register[] availableRegs = categorizedRegs.get(variable.flag);
 
         Location bestSpillCandidate = null;
-        for (CiRegister reg : availableRegs) {
+        for (Register reg : availableRegs) {
             if (isFree(reg, mode)) {
                 return selectRegister(reg, variable, mode);
             } else {
@@ -499,7 +499,7 @@
         }
         curLocations.put(newLoc);
 
-        CiRegister reg = asRegister(value.location);
+        Register reg = asRegister(value.location);
         assert curInRegisterState[reg.number] == value;
         curInRegisterState[reg.number] = null;
         if (curOutRegisterState[reg.number] == value) {
@@ -507,7 +507,7 @@
         }
     }
 
-    private boolean isFree(CiRegister reg, OperandMode mode) {
+    private boolean isFree(Register reg, OperandMode mode) {
         switch (mode) {
             case Input:  return curInRegisterState[reg.number] == null;
             case Alive:  return curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null;
@@ -517,7 +517,7 @@
         }
     }
 
-    private Location spillCandidate(CiRegister reg) {
+    private Location spillCandidate(Register reg) {
         Value in = curInRegisterState[reg.number];
         Value out = curOutRegisterState[reg.number];
         if (in == out && in != null && isLocation(in) && lastUseFor(asLocation(in).variable) < curOp.id()) {
@@ -548,7 +548,7 @@
         return result;
     }
 
-    private Location selectRegister(CiRegister reg, Variable variable, OperandMode mode) {
+    private Location selectRegister(Register reg, Variable variable, OperandMode mode) {
         assert isFree(reg, mode);
 
         Location loc = new Location(variable, reg.asValue(variable.kind));
--- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java	Sat Jun 09 20:10:05 2012 +0200
@@ -27,7 +27,7 @@
 
 import com.oracle.graal.alloc.util.*;
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiRegister.*;
+import com.oracle.graal.api.code.Register.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.debug.*;
 import com.oracle.graal.graph.*;
@@ -57,14 +57,14 @@
 
         @Override
         protected Value scratchRegister(Variable spilled) {
-            EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-            CiRegister[] availableRegs = categorizedRegs.get(spilled.flag);
-            for (CiRegister reg : availableRegs) {
+            EnumMap<RegisterFlag, Register[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+            Register[] availableRegs = categorizedRegs.get(spilled.flag);
+            for (Register reg : availableRegs) {
                 if (curInRegisterState[reg.number] == null && curOutRegisterState[reg.number] == null) {
                     return reg.asValue(spilled.kind);
                 }
             }
-            throw new CiBailout("No register found");
+            throw new BailoutException("No register found");
         }
     }
 
@@ -365,7 +365,7 @@
                 @Override
                 public Value doValue(Value registerHint) {
                     Debug.log("      registerHint %s", registerHint);
-                    CiRegister hint = null;
+                    Register hint = null;
                     if (isRegister(registerHint)) {
                         hint = asRegister(registerHint);
                     } else if (isLocation(registerHint) && isRegister(asLocation(registerHint).location)) {
@@ -383,23 +383,23 @@
             }
         }
 
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
-        CiRegister[] availableRegs = categorizedRegs.get(variable.flag);
+        EnumMap<RegisterFlag, Register[]> categorizedRegs = frameMap.registerConfig.getCategorizedAllocatableRegisters();
+        Register[] availableRegs = categorizedRegs.get(variable.flag);
 
-        for (CiRegister reg : availableRegs) {
+        for (Register reg : availableRegs) {
             if (isFree(reg, inRegisterState, outRegisterState)) {
                 return selectRegister(reg, variable, inRegisterState, outRegisterState);
             }
 
         }
-        throw new CiBailout("No register found");
+        throw new BailoutException("No register found");
     }
 
-    private static boolean isFree(CiRegister reg, Object[] inRegisterState, Object[] outRegisterState) {
+    private static boolean isFree(Register reg, Object[] inRegisterState, Object[] outRegisterState) {
         return (inRegisterState == null || inRegisterState[reg.number] == null) && (outRegisterState == null || outRegisterState[reg.number] == null);
     }
 
-    private Location selectRegister(CiRegister reg, Variable variable, Object[] inRegisterState, Object[] outRegisterState) {
+    private Location selectRegister(Register reg, Variable variable, Object[] inRegisterState, Object[] outRegisterState) {
         Location loc = new Location(variable, reg.asValue(variable.kind));
         if (inRegisterState != null) {
             inRegisterState[reg.number] = loc;
@@ -436,7 +436,7 @@
     }
 
     private boolean checkNoCallerSavedRegister() {
-        for (CiRegister reg : frameMap.registerConfig.getCallerSaveRegisters()) {
+        for (Register 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.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java	Sat Jun 09 20:10:05 2012 +0200
@@ -35,7 +35,7 @@
 
 public final class IntervalPrinter {
 
-    public static void printBeforeAllocation(String label, LIR lir, CiRegisterConfig registerConfig, DataFlowAnalysis dataFlow) {
+    public static void printBeforeAllocation(String label, LIR lir, RegisterConfig registerConfig, DataFlowAnalysis dataFlow) {
         if (Debug.isDumpEnabled()) {
             IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, null);
             Debug.dump(lir, label);
@@ -43,7 +43,7 @@
         }
     }
 
-    public static void printAfterAllocation(String label, LIR lir, CiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
+    public static void printAfterAllocation(String label, LIR lir, RegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
         if (Debug.isDumpEnabled()) {
             IntervalPrinter printer = new IntervalPrinter(lir, registerConfig, dataFlow, blockEndLocations);
             Debug.dump(lir, label);
@@ -96,13 +96,13 @@
 
 
     private final LIR lir;
-    private final CiRegisterConfig registerConfig;
+    private final RegisterConfig registerConfig;
     private final DataFlowAnalysis dataFlow;
     private final LocationMap[] blockEndLocations;
     private final Variable[] variables;
     private final Map<String, Interval> intervals;
 
-    private IntervalPrinter(LIR lir, CiRegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
+    private IntervalPrinter(LIR lir, RegisterConfig registerConfig, DataFlowAnalysis dataFlow, LocationMap[] blockEndLocations) {
         this.lir = lir;
         this.registerConfig = registerConfig;
         this.dataFlow = dataFlow;
--- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/LocationUtil.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/LocationUtil.java	Sat Jun 09 20:10:05 2012 +0200
@@ -25,7 +25,7 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.lir.*;
 
-public class LocationUtil extends ValueUtil {
+public class LocationUtil extends LIRValueUtil {
 
     public static boolean isLocation(Value value) {
         assert value != null;
--- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/MoveResolver.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/MoveResolver.java	Sat Jun 09 20:10:05 2012 +0200
@@ -302,7 +302,7 @@
 
     /**
      * Provides a register that can be used by the move resolver. If the returned value is a
-     * {@link CiRegisterValue}, the register can be overwritten without precautions. If the
+     * {@link RegisterValue}, the register can be overwritten without precautions. If the
      * returned value is a {@link Location}, it needs to be spilled and rescued itself.
      */
     protected abstract Value scratchRegister(Variable spilled);
--- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java	Sat Jun 09 20:10:05 2012 +0200
@@ -44,9 +44,9 @@
     /**
      * Saved information of previous check.
      * <br>
-     * State mapping: mapping from registers and stack slots ({@link CiRegister} and {@link Integer} stack slot offsets) to the
-     * value that is currently contained in there ({@link Location} for operands that were variables; {@link CiRegisterValue} or
-     * {@link CiStackSlot} for operands that used fixed registers or stack slots).
+     * State mapping: mapping from registers and stack slots ({@link Register} and {@link Integer} stack slot offsets) to the
+     * value that is currently contained in there ({@link Location} for operands that were variables; {@link RegisterValue} or
+     * {@link StackSlot} for operands that used fixed registers or stack slots).
      */
     private final Map<Object, Value>[] blockStates;
 
@@ -158,7 +158,7 @@
         Iterator<Object> iter = curInputState.keySet().iterator();
         while (iter.hasNext()) {
             Object value1 = iter.next();
-            if (value1 instanceof CiRegister && frameMap.registerConfig.getAttributesMap()[((CiRegister) value1).number].isCallerSave) {
+            if (value1 instanceof Register && frameMap.registerConfig.getAttributesMap()[((Register) value1).number].isCallerSave) {
                 Debug.log("    remove caller save register %s", value1);
                 iter.remove();
             }
@@ -222,14 +222,14 @@
         Collections.sort(keys, new Comparator<Object>() {
             @Override
             public int compare(Object o1, Object o2) {
-                if (o1 instanceof CiRegister) {
-                    if (o2 instanceof CiRegister) {
-                        return ((CiRegister) o1).number - ((CiRegister) o2).number;
+                if (o1 instanceof Register) {
+                    if (o2 instanceof Register) {
+                        return ((Register) o1).number - ((Register) o2).number;
                     } else {
                         return -1;
                     }
                 } else {
-                    if (o2 instanceof CiRegister) {
+                    if (o2 instanceof Register) {
                         return 1;
                     } else {
                         return ((Integer) o1).intValue() - ((Integer) o2).intValue();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2010, 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.graal.api.code;
+
+import static com.oracle.graal.api.code.ValueUtil.*;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Represents an address in target machine memory, specified via some combination of a base register, an index register,
+ * a displacement and a scale. Note that the base and index registers may be a variable that will get a register assigned
+ * later by the register allocator.
+ */
+public final class Address extends Value {
+    private static final long serialVersionUID = -1003772042519945089L;
+
+    /**
+     * A sentinel value used as a place holder in an instruction stream for an address that will be patched.
+     */
+    public static final Address Placeholder = new Address(Kind.Illegal, Value.IllegalValue);
+
+    /**
+     * Base register that defines the start of the address computation.
+     * If not present, is denoted by {@link Value#IllegalValue}.
+     */
+    public Value base;
+
+    /**
+     * Index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}.
+     * If not present, is denoted by {@link Value#IllegalValue}.
+     */
+    public Value index;
+
+    /**
+     * Scaling factor for indexing, dependent on target operand size.
+     */
+    public final Scale scale;
+
+    /**
+     * Optional additive displacement.
+     */
+    public final int displacement;
+
+    /**
+     * Creates a {@code CiAddress} with given base register, no scaling and no displacement.
+     * @param kind the kind of the value being addressed
+     * @param base the base register
+     */
+    public Address(Kind kind, Value base) {
+        this(kind, base, IllegalValue, Scale.Times1, 0);
+    }
+
+    /**
+     * Creates a {@code CiAddress} with given base register, no scaling and a given displacement.
+     * @param kind the kind of the value being addressed
+     * @param base the base register
+     * @param displacement the displacement
+     */
+    public Address(Kind kind, Value base, int displacement) {
+        this(kind, base, IllegalValue, Scale.Times1, displacement);
+    }
+
+    /**
+     * Creates a {@code CiAddress} with given base and index registers, scaling and displacement.
+     * This is the most general constructor..
+     * @param kind the kind of the value being addressed
+     * @param base the base register
+     * @param index the index register
+     * @param scale the scaling factor
+     * @param displacement the displacement
+     */
+    public Address(Kind kind, Value base, Value index, Scale scale, int displacement) {
+        super(kind);
+        this.base = base;
+        this.index = index;
+        this.scale = scale;
+        this.displacement = displacement;
+
+        assert !isConstant(base) && !isStackSlot(base);
+        assert !isConstant(index) && !isStackSlot(index);
+    }
+
+    /**
+     * A scaling factor used in complex addressing modes such as those supported by x86 platforms.
+     */
+    public enum Scale {
+        Times1(1, 0),
+        Times2(2, 1),
+        Times4(4, 2),
+        Times8(8, 3);
+
+        private Scale(int value, int log2) {
+            this.value = value;
+            this.log2 = log2;
+        }
+
+        /**
+         * The value (or multiplier) of this scale.
+         */
+        public final int value;
+
+        /**
+         * The {@linkplain #value value} of this scale log 2.
+         */
+        public final int log2;
+
+        public static Scale fromInt(int scale) {
+            switch (scale) {
+                case 1:  return Times1;
+                case 2:  return Times2;
+                case 4:  return Times4;
+                case 8:  return Times8;
+                default: throw new IllegalArgumentException(String.valueOf(scale));
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        if (this == Placeholder) {
+            return "[<placeholder>]";
+        }
+
+        StringBuilder s = new StringBuilder();
+        s.append(kind.javaName).append("[");
+        String sep = "";
+        if (isLegal(base)) {
+            s.append(base);
+            sep = " + ";
+        }
+        if (isLegal(index)) {
+            s.append(sep).append(index).append(" * ").append(scale.value);
+            sep = " + ";
+        }
+        if (displacement < 0) {
+            s.append(" - ").append(-displacement);
+        } else if (displacement > 0) {
+            s.append(sep).append(displacement);
+        }
+        s.append("]");
+        return s.toString();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof Address) {
+            Address addr = (Address) obj;
+            return kind == addr.kind && displacement == addr.displacement && base.equals(addr.base) && scale == addr.scale && index.equals(addr.index);
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return base.hashCode() ^ index.hashCode() ^ (displacement << 4) ^ (scale.value << 8) ^ (kind.ordinal() << 12);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,211 @@
+/*
+ * 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.graal.api.code;
+
+import java.util.*;
+
+import com.oracle.graal.api.code.Register.*;
+
+
+/**
+ * Represents a CPU architecture, including information such as its endianness, CPU
+ * registers, word width, etc.
+ */
+public abstract class Architecture {
+
+    /**
+     * The endianness of the architecture.
+     */
+    public static enum ByteOrder {
+        LittleEndian,
+        BigEndian
+    }
+
+    /**
+     * The number of bits required in a bit map covering all the registers that may store references.
+     * The bit position of a register in the map is the register's {@linkplain Register#number number}.
+     */
+    public final int registerReferenceMapBitCount;
+
+    /**
+     * Represents the natural size of words (typically registers and pointers) of this architecture, in bytes.
+     */
+    public final int wordSize;
+
+    /**
+     * The name of this architecture (e.g. "AMD64", "SPARCv9").
+     */
+    public final String name;
+
+    /**
+     * Array of all available registers on this architecture. The index of each register in this
+     * array is equal to its {@linkplain Register#number number}.
+     */
+    public final Register[] registers;
+
+    /**
+     * Map of all registers keyed by their {@linkplain Register#name names}.
+     */
+    public final HashMap<String, Register> registersByName;
+
+    /**
+     * The byte ordering can be either little or big endian.
+     */
+    public final ByteOrder byteOrder;
+
+    /**
+     * Mask of the barrier constants defined in {@link MemoryBarriers} denoting the barriers that
+     * are not required to be explicitly inserted under this architecture.
+     */
+    public final int implicitMemoryBarriers;
+
+    /**
+     * Determines the barriers in a given barrier mask that are explicitly required on this architecture.
+     *
+     * @param barriers a mask of the barrier constants defined in {@link MemoryBarriers}
+     * @return the value of {@code barriers} minus the barriers unnecessary on this architecture
+     */
+    public final int requiredBarriers(int barriers) {
+        return barriers & ~implicitMemoryBarriers;
+    }
+
+    /**
+     * Offset in bytes from the beginning of a call instruction to the displacement.
+     */
+    public final int machineCodeCallDisplacementOffset;
+
+    /**
+     * The size of the return address pushed to the stack by a call instruction.
+     * A value of 0 denotes that call linkage uses registers instead (e.g. SPARC).
+     */
+    public final int returnAddressSize;
+
+    private final EnumMap<RegisterFlag, Register[]> registersByTypeAndEncoding;
+
+    /**
+     * Gets the register for a given {@linkplain Register#encoding encoding} and type.
+     *
+     * @param encoding a register value as used in a machine instruction
+     * @param type the type of the register
+     */
+    public Register registerFor(int encoding, RegisterFlag type) {
+        Register[] regs = registersByTypeAndEncoding.get(type);
+        assert encoding >= 0 && encoding < regs.length;
+        Register reg = regs[encoding];
+        assert reg != null;
+        return reg;
+    }
+
+    protected Architecture(String name,
+                    int wordSize,
+                    ByteOrder byteOrder,
+                    Register[] registers,
+                    int implicitMemoryBarriers,
+                    int nativeCallDisplacementOffset,
+                    int registerReferenceMapBitCount,
+                    int returnAddressSize) {
+        this.name = name;
+        this.registers = registers;
+        this.wordSize = wordSize;
+        this.byteOrder = byteOrder;
+        this.implicitMemoryBarriers = implicitMemoryBarriers;
+        this.machineCodeCallDisplacementOffset = nativeCallDisplacementOffset;
+        this.registerReferenceMapBitCount = registerReferenceMapBitCount;
+        this.returnAddressSize = returnAddressSize;
+
+        registersByName = new HashMap<>(registers.length);
+        for (Register register : registers) {
+            registersByName.put(register.name, register);
+            assert registers[register.number] == register;
+        }
+
+        registersByTypeAndEncoding = new EnumMap<>(RegisterFlag.class);
+        EnumMap<RegisterFlag, Register[]> categorizedRegs = Register.categorize(registers);
+        for (RegisterFlag type : RegisterFlag.values()) {
+            Register[] regs = categorizedRegs.get(type);
+            int max = Register.maxRegisterEncoding(regs);
+            Register[] regsByEnc = new Register[max + 1];
+            for (Register reg : regs) {
+                regsByEnc[reg.encoding] = reg;
+            }
+            registersByTypeAndEncoding.put(type, regsByEnc);
+        }
+    }
+
+    /**
+     * Converts this architecture to a string.
+     * @return the string representation of this architecture
+     */
+    @Override
+    public final String toString() {
+        return name.toLowerCase();
+    }
+
+    /**
+     * Checks whether this is a 32-bit architecture.
+     * @return {@code true} if this architecture is 32-bit
+     */
+    public final boolean is32bit() {
+        return wordSize == 4;
+    }
+
+    /**
+     * Checks whether this is a 64-bit architecture.
+     * @return {@code true} if this architecture is 64-bit
+     */
+    public final boolean is64bit() {
+        return wordSize == 8;
+    }
+
+    // The following methods are architecture specific and not dependent on state
+    // stored in this class. They have convenient default implementations.
+
+    /**
+     * Checks whether this architecture's normal arithmetic instructions use a two-operand form
+     * (e.g. x86 which overwrites one operand register with the result when adding).
+     * @return {@code true} if this architecture uses two-operand mode
+     */
+    public boolean twoOperandMode() {
+        return false;
+    }
+
+    // TODO: Why enumerate the concrete subclasses here rather
+    // than use instanceof comparisons in code that cares?
+
+    /**
+     * Checks whether the architecture is x86.
+     * @return {@code true} if the architecture is x86
+     */
+    public boolean isX86() {
+        return false;
+    }
+
+    /**
+     * Checks whether the architecture is SPARC.
+     * @return {@code true} if the architecture is SPARC
+     */
+    public boolean isSPARC() {
+        return false;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,262 @@
+/*
+ * 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.graal.api.code;
+
+import java.io.*;
+import java.util.*;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Class for recording optimistic assumptions made during compilation.
+ * Recorded assumption can be visited for subsequent processing using
+ * an implementation of the {@link CiAssumptionProcessor} interface.
+ */
+public final class Assumptions implements Serializable, Iterable<Assumptions.Assumption> {
+
+    private static final long serialVersionUID = 5152062717588239131L;
+
+    public abstract static class Assumption implements Serializable {
+
+        private static final long serialVersionUID = -1936652569665112915L;
+    }
+
+    /**
+     * An assumption about a unique subtype of a given type.
+     */
+    public static final class ConcreteSubtype extends Assumption {
+
+        private static final long serialVersionUID = -1457173265437676252L;
+
+        /**
+         * Type the assumption is made about.
+         */
+        public final ResolvedJavaType context;
+
+        /**
+         * Assumed unique concrete sub-type of the context type.
+         */
+        public final ResolvedJavaType subtype;
+
+        public ConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) {
+            this.context = context;
+            this.subtype = subtype;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + context.hashCode();
+            result = prime * result + subtype.hashCode();
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj instanceof ConcreteSubtype) {
+                ConcreteSubtype other = (ConcreteSubtype) obj;
+                return other.context == context && other.subtype == subtype;
+            }
+            return false;
+        }
+    }
+
+    /**
+     * An assumption about a unique implementation of a virtual method.
+     */
+    public static final class ConcreteMethod extends Assumption {
+
+        private static final long serialVersionUID = -7636746737947390059L;
+
+        /**
+         * A virtual (or interface) method whose unique implementation for the receiver type
+         * in {@link #context} is {@link #impl}.
+         */
+        public final ResolvedJavaMethod method;
+
+        /**
+         * A receiver type.
+         */
+        public final ResolvedJavaType context;
+
+        /**
+         * The unique implementation of {@link #method} for {@link #context}.
+         */
+        public final ResolvedJavaMethod impl;
+
+        public ConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) {
+            this.method = method;
+            this.context = context;
+            this.impl = impl;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + method.hashCode();
+            result = prime * result + context.hashCode();
+            result = prime * result + impl.hashCode();
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj instanceof ConcreteMethod) {
+                ConcreteMethod other = (ConcreteMethod) obj;
+                return other.method == method && other.context == context && other.impl == impl;
+            }
+            return false;
+        }
+    }
+
+    /**
+     * An assumption that specified that a method was used during the compilation.
+     */
+    public static final class MethodContents extends Assumption {
+
+        private static final long serialVersionUID = -4821594103928571659L;
+
+        public final ResolvedJavaMethod method;
+
+        public MethodContents(ResolvedJavaMethod method) {
+            this.method = method;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + method.hashCode();
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj instanceof ConcreteMethod) {
+                ConcreteMethod other = (ConcreteMethod) obj;
+                return other.method == method;
+            }
+            return false;
+        }
+    }
+
+    /**
+     * Array with the assumptions. This field is directly accessed from C++ code in the Graal/HotSpot implementation.
+     */
+    private Assumption[] list;
+
+    private int count;
+
+    /**
+     * Returns whether any assumptions have been registered.
+     * @return {@code true} if at least one assumption has been registered, {@code false} otherwise.
+     */
+    public boolean isEmpty() {
+        return count == 0;
+    }
+
+    @Override
+    public Iterator<Assumption> iterator() {
+        return new Iterator<Assumptions.Assumption>() {
+            int index;
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+            public Assumption next() {
+                if (index >= count) {
+                    throw new NoSuchElementException();
+                }
+                return list[index++];
+            }
+            public boolean hasNext() {
+                return index < count;
+            }
+        };
+    }
+
+    /**
+     * Records an assumption that the specified type has no finalizable subclasses.
+     *
+     * @param receiverType the type that is assumed to have no finalizable subclasses
+     * @return {@code true} if the assumption was recorded and can be assumed; {@code false} otherwise
+     */
+    @SuppressWarnings("static-method")
+    public boolean recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType) {
+        // TODO (thomaswue): Record that assumption correctly.
+        return false;
+    }
+
+    /**
+     * Records that {@code subtype} is the only concrete subtype in the class hierarchy below {@code context}.
+     * @param context the root of the subtree of the class hierarchy that this assumptions is about
+     * @param subtype the one concrete subtype
+     */
+    public void recordConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) {
+        record(new ConcreteSubtype(context, subtype));
+    }
+
+    /**
+     * Records that {@code impl} is the only possible concrete target for a virtual call to
+     * {@code method} with a receiver of type {@code context}.
+     *
+     * @param method a method that is the target of a virtual call
+     * @param context the receiver type of a call to {@code method}
+     * @param impl the concrete method that is the only possible target for the virtual call
+     */
+    public void recordConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) {
+        record(new ConcreteMethod(method, context, impl));
+    }
+
+    /**
+     * Records that {@code method} was used during the compilation.
+     *
+     * @param method a method whose contents were used
+     */
+    public void recordMethodContents(ResolvedJavaMethod method) {
+        record(new MethodContents(method));
+    }
+
+    private void record(Assumption assumption) {
+        if (list == null) {
+            list = new Assumption[4];
+        } else {
+            for (int i = 0; i < count; ++i) {
+                if (assumption.equals(list[i])) {
+                    return;
+                }
+            }
+        }
+        if (list.length == count) {
+            Assumption[] newList = new Assumption[list.length * 2];
+            for (int i = 0; i < list.length; ++i) {
+                newList[i] = list[i];
+            }
+            list = newList;
+        }
+        list[count] = assumption;
+        count++;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BailoutException.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,62 @@
+/*
+ * 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.graal.api.code;
+
+import java.util.*;
+
+/**
+ * {@code CiBailout} is thrown when the compiler refuses to compile a method because of problems with the method.
+ * e.g. bytecode wouldn't verify, too big, JSR/ret too complicated, etc. This exception is <i>not</i>
+ * meant to indicate problems with the compiler itself.
+ */
+public class BailoutException extends RuntimeException {
+
+    public static final long serialVersionUID = 8974598793458772L;
+
+    /**
+     * Create a new {@code CiBailout}.
+     * @param reason a message indicating the reason
+     */
+    public BailoutException(String reason) {
+        super(reason);
+    }
+
+    /**
+     * Create a new {@code CiBailout}.
+     * @param reason a message indicating the reason with a String.format - syntax
+     * @param args parameters to the formatter
+     */
+    public BailoutException(String format, Object... args) {
+        this(String.format(Locale.ENGLISH, format, args));
+    }
+
+    /**
+     * Create a new {@code CiBailout} t due to an internal exception being thrown.
+     * @param reason a message indicating the reason
+     * @param cause the throwable that was the cause of the bailout
+     */
+    public BailoutException(String reason, Throwable cause) {
+        super(reason);
+        initCause(cause);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodeFrame.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,143 @@
+/*
+ * 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.graal.api.code;
+
+import java.io.*;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Represents the Java bytecode frame state(s) at a given position
+ * including {@link Value locations} where to find the local variables,
+ * operand stack values and locked objects of the bytecode frame(s).
+ */
+public class BytecodeFrame extends BytecodePosition implements Serializable {
+    private static final long serialVersionUID = -345025397165977565L;
+
+    /**
+     * An array of values representing how to reconstruct the state of the Java frame.
+     * This is array is partitioned as follows:
+     * <p>
+     * <table border="1" cellpadding="5" frame="void", rules="all">
+     * <tr><th>Start index (inclusive)</th><th>End index (exclusive)</th><th>Description</th></tr>
+     * <tr><td>0</td>                   <td>numLocals</td>           <td>Local variables</td></tr>
+     * <tr><td>numLocals</td>           <td>numLocals + numStack</td><td>Operand stack</td></tr>
+     * <tr><td>numLocals + numStack</td><td>values.length</td>       <td>Locked objects</td></tr>
+     * </table>
+     * <p>
+     * Note that the number of locals and the number of stack slots may be smaller than the
+     * maximum number of locals and stack slots as specified in the compiled method.
+     */
+    public final Value[] values;
+
+    /**
+     * The number of locals in the values array.
+     */
+    public final int numLocals;
+
+    /**
+     * The number of stack slots in the values array.
+     */
+    public final int numStack;
+
+    /**
+     * The number of locks in the values array.
+     */
+    public final int numLocks;
+
+    /**
+     * In case this frame state belongs to a deoptimization, the leafGraphId will contain the StructuredGraph.graphId() of the graph that originally introduced this deoptimization point.
+     * This id is later on used by the runtime system to evict graphs from the graph cache when deoptimizations originating from them have been hit.
+     */
+    public final long leafGraphId;
+
+    public final boolean rethrowException;
+
+    public final boolean duringCall;
+
+    /**
+     * Creates a new frame object.
+     *
+     * @param caller the caller frame (which may be {@code null})
+     * @param method the method
+     * @param bci a BCI within the method
+     * @param rethrowException specifies if the VM should re-throw the pending exception when deopt'ing using this frame
+     * @param values the frame state {@link #values}
+     * @param numLocals the number of local variables
+     * @param numStack the depth of the stack
+     * @param numLocks the number of locked objects
+     */
+    public BytecodeFrame(BytecodeFrame caller, ResolvedJavaMethod method, int bci, boolean rethrowException, boolean duringCall, Value[] values, int numLocals, int numStack, int numLocks, long leafGraphId) {
+        super(caller, method, bci);
+        assert values != null;
+        this.rethrowException = rethrowException;
+        this.duringCall = duringCall;
+        this.values = values;
+        this.numLocals = numLocals;
+        this.numStack = numStack;
+        this.numLocks = numLocks;
+        this.leafGraphId = leafGraphId;
+        assert !rethrowException || numStack == 1 : "must have exception on top of the stack";
+    }
+
+    /**
+     * Gets the value representing the specified local variable.
+     * @param i the local variable index
+     * @return the value that can be used to reconstruct the local's current value
+     */
+    public Value getLocalValue(int i) {
+        return values[i];
+    }
+
+    /**
+     * Gets the value representing the specified stack slot.
+     * @param i the stack index
+     * @return the value that can be used to reconstruct the stack slot's current value
+     */
+    public Value getStackValue(int i) {
+        return values[i + numLocals];
+    }
+
+    /**
+     * Gets the value representing the specified lock.
+     * @param i the lock index
+     * @return the value that can be used to reconstruct the lock's current value
+     */
+    public Value getLockValue(int i) {
+        return values[i + numLocals + numStack];
+    }
+
+    /**
+     * Gets the caller of this frame.
+     *
+     * @return {@code null} if this frame has no caller
+     */
+    public BytecodeFrame caller() {
+        return (BytecodeFrame) caller;
+    }
+
+    @Override
+    public String toString() {
+        return CodeUtil.append(new StringBuilder(100), this).toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodePosition.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,103 @@
+/*
+ * 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.graal.api.code;
+
+import java.io.*;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Represents a code position, that is, a chain of inlined methods with bytecode
+ * locations, that is communicated from the compiler to the runtime system. A code position
+ * can be used by the runtime system to reconstruct a source-level stack trace
+ * for exceptions and to create {@linkplain BytecodeFrame frames} for deoptimization.
+ */
+public abstract class BytecodePosition implements Serializable {
+
+    private static final long serialVersionUID = 8633885274526033515L;
+
+    /**
+     * The position where this position has been called, {@code null} if none.
+     */
+    public final BytecodePosition caller;
+
+    /**
+     * The runtime interface method for this position.
+     */
+    public final ResolvedJavaMethod method;
+
+    /**
+     * The location within the method, as a bytecode index. The constant
+     * {@code -1} may be used to indicate the location is unknown, for example
+     * within code synthesized by the compiler.
+     */
+    public final int bci;
+
+    /**
+     * Constructs a new object representing a given parent/caller, a given method, and a given BCI.
+     *
+     * @param caller the parent position
+     * @param method the method
+     * @param bci a BCI within the method
+     */
+    public BytecodePosition(BytecodePosition caller, ResolvedJavaMethod method, int bci) {
+        assert method != null;
+        this.caller = caller;
+        this.method = method;
+        this.bci = bci;
+    }
+
+    /**
+     * Converts this code position to a string representation.
+     * @return a string representation of this code position
+     */
+    @Override
+    public String toString() {
+        return CodeUtil.append(new StringBuilder(100), this).toString();
+    }
+
+    /**
+     * Deep equality test.
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof BytecodePosition) {
+            BytecodePosition other = (BytecodePosition) obj;
+            if (other.method.equals(method) && other.bci == bci) {
+                if (caller == null) {
+                    return other.caller == null;
+                }
+                return caller.equals(other.caller);
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return bci;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CalleeSaveLayout.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2010, 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.graal.api.code;
+
+import java.util.*;
+
+
+/**
+ * The callee save area (CSA) is a contiguous space in a stack frame
+ * used to save (and restore) the values of the caller's registers.
+ * This class describes the layout of a CSA in terms of its
+ * {@linkplain #size size}, {@linkplain #slotSize slot size} and
+ * the {@linkplain #registers callee save registers} covered by the CSA.
+ */
+public class CalleeSaveLayout {
+
+    /**
+     * The size (in bytes) of the CSA.
+     */
+    public final int size;
+
+    /**
+     * The size (in bytes) of an {@linkplain #registerAtIndex(int) indexable} slot in the CSA.
+     */
+    public final int slotSize;
+
+    /**
+     * Map from {@linkplain Register#number register numbers} to slot indexes in the CSA.
+     */
+    private final int[] regNumToIndex;
+
+    private final Register[] indexToReg;
+
+    /**
+     * The list of registers {@linkplain #contains(Register) contained} by this CSA.
+     */
+    public final Register[] registers;
+
+    /**
+     * The offset from the frame pointer to the CSA. If this is not known, then this field
+     * will have the value {@link Integer#MAX_VALUE}.
+     */
+    public final int frameOffsetToCSA;
+
+    /**
+     * Creates a CSA layout.
+     *
+     * @param size size (in bytes) of the CSA. If this is {@code -1}, then the CSA size will be computed from {@code registers}.
+     * @param slotSize the size (in bytes) of an {@linkplain #registerAtIndex(int) indexable} slot in the CSA
+     * @param registers the registers that can be saved in the CSA
+     */
+    public CalleeSaveLayout(int frameOffsetToCSA, int size, int slotSize, Register... registers) {
+        this.frameOffsetToCSA = frameOffsetToCSA;
+        assert slotSize == 0 || CodeUtil.isPowerOf2(slotSize);
+        this.slotSize = slotSize;
+        int maxRegNum = -1;
+        int maxOffset = 0;
+        this.registers = registers;
+        int offset = 0;
+        for (Register reg : registers) {
+            assert offset % slotSize == 0;
+            assert reg.number >= 0;
+            if (reg.number > maxRegNum) {
+                maxRegNum = reg.number;
+            }
+            if (offset > maxOffset) {
+                maxOffset = offset;
+            }
+            offset += reg.spillSlotSize;
+        }
+        if (size == -1) {
+            this.size = offset;
+        } else {
+            assert offset <= size;
+            this.size = size;
+        }
+
+        this.regNumToIndex = new int[maxRegNum + 1];
+        this.indexToReg = offset == 0 ? new Register[0] : new Register[offset / slotSize];
+        Arrays.fill(regNumToIndex, -1);
+        offset = 0;
+        for (Register reg : registers) {
+            int index = offset / slotSize;
+            regNumToIndex[reg.number] = index;
+            indexToReg[index] = reg;
+            offset += reg.spillSlotSize;
+        }
+    }
+
+    /**
+     * Gets the offset of a given register in the CSA.
+     *
+     * @return the offset (in bytes) of {@code reg} in the CSA
+     * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA
+     */
+    public int offsetOf(int reg) {
+        return indexOf(reg) * slotSize;
+    }
+
+    /**
+     * Gets the index of a given register in the CSA.
+     *
+     * @return the index of {@code reg} in the CSA
+     * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA
+     */
+    public int indexOf(int reg) {
+        if (!contains(reg)) {
+            throw new IllegalArgumentException(String.valueOf(reg));
+        }
+        return regNumToIndex[reg];
+    }
+
+    /**
+     * Gets the offset of a given register in the CSA.
+     *
+     * @return the offset (in bytes) of {@code reg} in the CSA
+     * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA
+     */
+    public int offsetOf(Register reg) {
+        return offsetOf(reg.number);
+    }
+
+    /**
+     * Determines if the CSA includes a slot for a given register.
+     *
+     * @param reg the register to test
+     * @return true if the CSA contains a slot for {@code reg}
+     */
+    public boolean contains(int reg) {
+        return reg >= 0 && reg < regNumToIndex.length && regNumToIndex[reg] != -1;
+    }
+
+    /**
+     * Gets the register whose slot in the CSA is at a given index.
+     *
+     * @param index an index of a slot in the CSA
+     * @return the register whose slot in the CSA is at  {@code index} or {@code null} if {@code index} does not denote a
+     *         slot in the CSA aligned with a register
+     */
+    public Register registerAt(int index) {
+        if (index < 0 || index >= indexToReg.length) {
+            return null;
+        }
+        return indexToReg[index];
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder("[");
+        for (Register reg : registers) {
+            if (sb.length() != 1) {
+                sb.append(", ");
+            }
+            sb.append(reg).append("{+").append(offsetOf(reg)).append('}');
+        }
+        return sb.append("] size=").append(size).toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CallingConvention.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,107 @@
+/*
+ * 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.graal.api.code;
+
+import static com.oracle.graal.api.code.ValueUtil.*;
+
+import com.oracle.graal.api.meta.*;
+
+
+/**
+ * A calling convention describes the locations in which the arguments for a call are placed.
+ */
+public class CallingConvention {
+
+    /**
+     * Constants denoting the type of a call for which a calling convention is
+     * {@linkplain RegisterConfig#getCallingConvention(Type, CiKind[], CiTarget, boolean) requested}.
+     */
+    public enum Type {
+        /**
+         * A request for the outgoing argument locations at a call site to Java code.
+         */
+        JavaCall(true),
+
+        /**
+         * A request for the incoming argument locations.
+         */
+        JavaCallee(false),
+
+        /**
+         * A request for the outgoing argument locations at a call site to the runtime (which may be Java or native code).
+         */
+        RuntimeCall(true),
+
+        /**
+         * A request for the outgoing argument locations at a call site to
+         * external native code that complies with the platform ABI.
+         */
+        NativeCall(true);
+
+        /**
+         * Determines if this is a request for the outgoing argument locations at a call site.
+         */
+        public final boolean out;
+
+        public static final Type[] VALUES = values();
+
+        private Type(boolean out) {
+            this.out = out;
+        }
+    }
+
+    /**
+     * The amount of stack space (in bytes) required for the stack-based arguments of the call.
+     */
+    public final int stackSize;
+
+    /**
+     * The locations in which the arguments are placed. This array ordered by argument index.
+     */
+    public final Value[] locations;
+
+    public CallingConvention(Value[] locations, int stackSize) {
+        this.locations = locations;
+        this.stackSize = stackSize;
+        assert verify();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder result = new StringBuilder();
+        result.append("CallingConvention[");
+        for (Value op : locations) {
+            result.append(op.toString()).append(" ");
+        }
+        result.append("]");
+        return result.toString();
+    }
+
+    private boolean verify() {
+        for (int i = 0; i < locations.length; i++) {
+            Value location = locations[i];
+            assert isStackSlot(location) || isRegister(location);
+        }
+        return true;
+    }
+}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiAddress.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2010, 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.graal.api.code;
-
-import static com.oracle.graal.api.code.CiValueUtil.*;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Represents an address in target machine memory, specified via some combination of a base register, an index register,
- * a displacement and a scale. Note that the base and index registers may be a variable that will get a register assigned
- * later by the register allocator.
- */
-public final class CiAddress extends Value {
-    private static final long serialVersionUID = -1003772042519945089L;
-
-    /**
-     * A sentinel value used as a place holder in an instruction stream for an address that will be patched.
-     */
-    public static final CiAddress Placeholder = new CiAddress(Kind.Illegal, Value.IllegalValue);
-
-    /**
-     * Base register that defines the start of the address computation.
-     * If not present, is denoted by {@link Value#IllegalValue}.
-     */
-    public Value base;
-
-    /**
-     * Index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}.
-     * If not present, is denoted by {@link Value#IllegalValue}.
-     */
-    public Value index;
-
-    /**
-     * Scaling factor for indexing, dependent on target operand size.
-     */
-    public final Scale scale;
-
-    /**
-     * Optional additive displacement.
-     */
-    public final int displacement;
-
-    /**
-     * Creates a {@code CiAddress} with given base register, no scaling and no displacement.
-     * @param kind the kind of the value being addressed
-     * @param base the base register
-     */
-    public CiAddress(Kind kind, Value base) {
-        this(kind, base, IllegalValue, Scale.Times1, 0);
-    }
-
-    /**
-     * Creates a {@code CiAddress} with given base register, no scaling and a given displacement.
-     * @param kind the kind of the value being addressed
-     * @param base the base register
-     * @param displacement the displacement
-     */
-    public CiAddress(Kind kind, Value base, int displacement) {
-        this(kind, base, IllegalValue, Scale.Times1, displacement);
-    }
-
-    /**
-     * Creates a {@code CiAddress} with given base and index registers, scaling and displacement.
-     * This is the most general constructor..
-     * @param kind the kind of the value being addressed
-     * @param base the base register
-     * @param index the index register
-     * @param scale the scaling factor
-     * @param displacement the displacement
-     */
-    public CiAddress(Kind kind, Value base, Value index, Scale scale, int displacement) {
-        super(kind);
-        this.base = base;
-        this.index = index;
-        this.scale = scale;
-        this.displacement = displacement;
-
-        assert !isConstant(base) && !isStackSlot(base);
-        assert !isConstant(index) && !isStackSlot(index);
-    }
-
-    /**
-     * A scaling factor used in complex addressing modes such as those supported by x86 platforms.
-     */
-    public enum Scale {
-        Times1(1, 0),
-        Times2(2, 1),
-        Times4(4, 2),
-        Times8(8, 3);
-
-        private Scale(int value, int log2) {
-            this.value = value;
-            this.log2 = log2;
-        }
-
-        /**
-         * The value (or multiplier) of this scale.
-         */
-        public final int value;
-
-        /**
-         * The {@linkplain #value value} of this scale log 2.
-         */
-        public final int log2;
-
-        public static Scale fromInt(int scale) {
-            switch (scale) {
-                case 1:  return Times1;
-                case 2:  return Times2;
-                case 4:  return Times4;
-                case 8:  return Times8;
-                default: throw new IllegalArgumentException(String.valueOf(scale));
-            }
-        }
-    }
-
-    @Override
-    public String toString() {
-        if (this == Placeholder) {
-            return "[<placeholder>]";
-        }
-
-        StringBuilder s = new StringBuilder();
-        s.append(kind.javaName).append("[");
-        String sep = "";
-        if (isLegal(base)) {
-            s.append(base);
-            sep = " + ";
-        }
-        if (isLegal(index)) {
-            s.append(sep).append(index).append(" * ").append(scale.value);
-            sep = " + ";
-        }
-        if (displacement < 0) {
-            s.append(" - ").append(-displacement);
-        } else if (displacement > 0) {
-            s.append(sep).append(displacement);
-        }
-        s.append("]");
-        return s.toString();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof CiAddress) {
-            CiAddress addr = (CiAddress) obj;
-            return kind == addr.kind && displacement == addr.displacement && base.equals(addr.base) && scale == addr.scale && index.equals(addr.index);
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return base.hashCode() ^ index.hashCode() ^ (displacement << 4) ^ (scale.value << 8) ^ (kind.ordinal() << 12);
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiArchitecture.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +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.graal.api.code;
-
-import java.util.*;
-
-import com.oracle.graal.api.code.CiRegister.*;
-
-
-/**
- * Represents a CPU architecture, including information such as its endianness, CPU
- * registers, word width, etc.
- */
-public abstract class CiArchitecture {
-
-    /**
-     * The endianness of the architecture.
-     */
-    public static enum ByteOrder {
-        LittleEndian,
-        BigEndian
-    }
-
-    /**
-     * The number of bits required in a bit map covering all the registers that may store references.
-     * The bit position of a register in the map is the register's {@linkplain CiRegister#number number}.
-     */
-    public final int registerReferenceMapBitCount;
-
-    /**
-     * Represents the natural size of words (typically registers and pointers) of this architecture, in bytes.
-     */
-    public final int wordSize;
-
-    /**
-     * The name of this architecture (e.g. "AMD64", "SPARCv9").
-     */
-    public final String name;
-
-    /**
-     * Array of all available registers on this architecture. The index of each register in this
-     * array is equal to its {@linkplain CiRegister#number number}.
-     */
-    public final CiRegister[] registers;
-
-    /**
-     * Map of all registers keyed by their {@linkplain CiRegister#name names}.
-     */
-    public final HashMap<String, CiRegister> registersByName;
-
-    /**
-     * The byte ordering can be either little or big endian.
-     */
-    public final ByteOrder byteOrder;
-
-    /**
-     * Mask of the barrier constants defined in {@link MemoryBarriers} denoting the barriers that
-     * are not required to be explicitly inserted under this architecture.
-     */
-    public final int implicitMemoryBarriers;
-
-    /**
-     * Determines the barriers in a given barrier mask that are explicitly required on this architecture.
-     *
-     * @param barriers a mask of the barrier constants defined in {@link MemoryBarriers}
-     * @return the value of {@code barriers} minus the barriers unnecessary on this architecture
-     */
-    public final int requiredBarriers(int barriers) {
-        return barriers & ~implicitMemoryBarriers;
-    }
-
-    /**
-     * Offset in bytes from the beginning of a call instruction to the displacement.
-     */
-    public final int machineCodeCallDisplacementOffset;
-
-    /**
-     * The size of the return address pushed to the stack by a call instruction.
-     * A value of 0 denotes that call linkage uses registers instead (e.g. SPARC).
-     */
-    public final int returnAddressSize;
-
-    private final EnumMap<RegisterFlag, CiRegister[]> registersByTypeAndEncoding;
-
-    /**
-     * Gets the register for a given {@linkplain CiRegister#encoding encoding} and type.
-     *
-     * @param encoding a register value as used in a machine instruction
-     * @param type the type of the register
-     */
-    public CiRegister registerFor(int encoding, RegisterFlag type) {
-        CiRegister[] regs = registersByTypeAndEncoding.get(type);
-        assert encoding >= 0 && encoding < regs.length;
-        CiRegister reg = regs[encoding];
-        assert reg != null;
-        return reg;
-    }
-
-    protected CiArchitecture(String name,
-                    int wordSize,
-                    ByteOrder byteOrder,
-                    CiRegister[] registers,
-                    int implicitMemoryBarriers,
-                    int nativeCallDisplacementOffset,
-                    int registerReferenceMapBitCount,
-                    int returnAddressSize) {
-        this.name = name;
-        this.registers = registers;
-        this.wordSize = wordSize;
-        this.byteOrder = byteOrder;
-        this.implicitMemoryBarriers = implicitMemoryBarriers;
-        this.machineCodeCallDisplacementOffset = nativeCallDisplacementOffset;
-        this.registerReferenceMapBitCount = registerReferenceMapBitCount;
-        this.returnAddressSize = returnAddressSize;
-
-        registersByName = new HashMap<>(registers.length);
-        for (CiRegister register : registers) {
-            registersByName.put(register.name, register);
-            assert registers[register.number] == register;
-        }
-
-        registersByTypeAndEncoding = new EnumMap<>(RegisterFlag.class);
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = CiRegister.categorize(registers);
-        for (RegisterFlag type : RegisterFlag.values()) {
-            CiRegister[] regs = categorizedRegs.get(type);
-            int max = CiRegister.maxRegisterEncoding(regs);
-            CiRegister[] regsByEnc = new CiRegister[max + 1];
-            for (CiRegister reg : regs) {
-                regsByEnc[reg.encoding] = reg;
-            }
-            registersByTypeAndEncoding.put(type, regsByEnc);
-        }
-    }
-
-    /**
-     * Converts this architecture to a string.
-     * @return the string representation of this architecture
-     */
-    @Override
-    public final String toString() {
-        return name.toLowerCase();
-    }
-
-    /**
-     * Checks whether this is a 32-bit architecture.
-     * @return {@code true} if this architecture is 32-bit
-     */
-    public final boolean is32bit() {
-        return wordSize == 4;
-    }
-
-    /**
-     * Checks whether this is a 64-bit architecture.
-     * @return {@code true} if this architecture is 64-bit
-     */
-    public final boolean is64bit() {
-        return wordSize == 8;
-    }
-
-    // The following methods are architecture specific and not dependent on state
-    // stored in this class. They have convenient default implementations.
-
-    /**
-     * Checks whether this architecture's normal arithmetic instructions use a two-operand form
-     * (e.g. x86 which overwrites one operand register with the result when adding).
-     * @return {@code true} if this architecture uses two-operand mode
-     */
-    public boolean twoOperandMode() {
-        return false;
-    }
-
-    // TODO: Why enumerate the concrete subclasses here rather
-    // than use instanceof comparisons in code that cares?
-
-    /**
-     * Checks whether the architecture is x86.
-     * @return {@code true} if the architecture is x86
-     */
-    public boolean isX86() {
-        return false;
-    }
-
-    /**
-     * Checks whether the architecture is SPARC.
-     * @return {@code true} if the architecture is SPARC
-     */
-    public boolean isSPARC() {
-        return false;
-    }
-
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiAssumptions.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +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.graal.api.code;
-
-import java.io.*;
-import java.util.*;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Class for recording optimistic assumptions made during compilation.
- * Recorded assumption can be visited for subsequent processing using
- * an implementation of the {@link CiAssumptionProcessor} interface.
- */
-public final class CiAssumptions implements Serializable, Iterable<CiAssumptions.Assumption> {
-
-    private static final long serialVersionUID = 5152062717588239131L;
-
-    public abstract static class Assumption implements Serializable {
-
-        private static final long serialVersionUID = -1936652569665112915L;
-    }
-
-    /**
-     * An assumption about a unique subtype of a given type.
-     */
-    public static final class ConcreteSubtype extends Assumption {
-
-        private static final long serialVersionUID = -1457173265437676252L;
-
-        /**
-         * Type the assumption is made about.
-         */
-        public final ResolvedJavaType context;
-
-        /**
-         * Assumed unique concrete sub-type of the context type.
-         */
-        public final ResolvedJavaType subtype;
-
-        public ConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) {
-            this.context = context;
-            this.subtype = subtype;
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + context.hashCode();
-            result = prime * result + subtype.hashCode();
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof ConcreteSubtype) {
-                ConcreteSubtype other = (ConcreteSubtype) obj;
-                return other.context == context && other.subtype == subtype;
-            }
-            return false;
-        }
-    }
-
-    /**
-     * An assumption about a unique implementation of a virtual method.
-     */
-    public static final class ConcreteMethod extends Assumption {
-
-        private static final long serialVersionUID = -7636746737947390059L;
-
-        /**
-         * A virtual (or interface) method whose unique implementation for the receiver type
-         * in {@link #context} is {@link #impl}.
-         */
-        public final ResolvedJavaMethod method;
-
-        /**
-         * A receiver type.
-         */
-        public final ResolvedJavaType context;
-
-        /**
-         * The unique implementation of {@link #method} for {@link #context}.
-         */
-        public final ResolvedJavaMethod impl;
-
-        public ConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) {
-            this.method = method;
-            this.context = context;
-            this.impl = impl;
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + method.hashCode();
-            result = prime * result + context.hashCode();
-            result = prime * result + impl.hashCode();
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof ConcreteMethod) {
-                ConcreteMethod other = (ConcreteMethod) obj;
-                return other.method == method && other.context == context && other.impl == impl;
-            }
-            return false;
-        }
-    }
-
-    /**
-     * An assumption that specified that a method was used during the compilation.
-     */
-    public static final class MethodContents extends Assumption {
-
-        private static final long serialVersionUID = -4821594103928571659L;
-
-        public final ResolvedJavaMethod method;
-
-        public MethodContents(ResolvedJavaMethod method) {
-            this.method = method;
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + method.hashCode();
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof ConcreteMethod) {
-                ConcreteMethod other = (ConcreteMethod) obj;
-                return other.method == method;
-            }
-            return false;
-        }
-    }
-
-    /**
-     * Array with the assumptions. This field is directly accessed from C++ code in the Graal/HotSpot implementation.
-     */
-    private Assumption[] list;
-
-    private int count;
-
-    /**
-     * Returns whether any assumptions have been registered.
-     * @return {@code true} if at least one assumption has been registered, {@code false} otherwise.
-     */
-    public boolean isEmpty() {
-        return count == 0;
-    }
-
-    @Override
-    public Iterator<Assumption> iterator() {
-        return new Iterator<CiAssumptions.Assumption>() {
-            int index;
-            public void remove() {
-                throw new UnsupportedOperationException();
-            }
-            public Assumption next() {
-                if (index >= count) {
-                    throw new NoSuchElementException();
-                }
-                return list[index++];
-            }
-            public boolean hasNext() {
-                return index < count;
-            }
-        };
-    }
-
-    /**
-     * Records an assumption that the specified type has no finalizable subclasses.
-     *
-     * @param receiverType the type that is assumed to have no finalizable subclasses
-     * @return {@code true} if the assumption was recorded and can be assumed; {@code false} otherwise
-     */
-    @SuppressWarnings("static-method")
-    public boolean recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType) {
-        // TODO (thomaswue): Record that assumption correctly.
-        return false;
-    }
-
-    /**
-     * Records that {@code subtype} is the only concrete subtype in the class hierarchy below {@code context}.
-     * @param context the root of the subtree of the class hierarchy that this assumptions is about
-     * @param subtype the one concrete subtype
-     */
-    public void recordConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) {
-        record(new ConcreteSubtype(context, subtype));
-    }
-
-    /**
-     * Records that {@code impl} is the only possible concrete target for a virtual call to
-     * {@code method} with a receiver of type {@code context}.
-     *
-     * @param method a method that is the target of a virtual call
-     * @param context the receiver type of a call to {@code method}
-     * @param impl the concrete method that is the only possible target for the virtual call
-     */
-    public void recordConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) {
-        record(new ConcreteMethod(method, context, impl));
-    }
-
-    /**
-     * Records that {@code method} was used during the compilation.
-     *
-     * @param method a method whose contents were used
-     */
-    public void recordMethodContents(ResolvedJavaMethod method) {
-        record(new MethodContents(method));
-    }
-
-    private void record(Assumption assumption) {
-        if (list == null) {
-            list = new Assumption[4];
-        } else {
-            for (int i = 0; i < count; ++i) {
-                if (assumption.equals(list[i])) {
-                    return;
-                }
-            }
-        }
-        if (list.length == count) {
-            Assumption[] newList = new Assumption[list.length * 2];
-            for (int i = 0; i < list.length; ++i) {
-                newList[i] = list[i];
-            }
-            list = newList;
-        }
-        list[count] = assumption;
-        count++;
-    }
-
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiBailout.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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.graal.api.code;
-
-import java.util.*;
-
-/**
- * {@code CiBailout} is thrown when the compiler refuses to compile a method because of problems with the method.
- * e.g. bytecode wouldn't verify, too big, JSR/ret too complicated, etc. This exception is <i>not</i>
- * meant to indicate problems with the compiler itself.
- */
-public class CiBailout extends RuntimeException {
-
-    public static final long serialVersionUID = 8974598793458772L;
-
-    /**
-     * Create a new {@code CiBailout}.
-     * @param reason a message indicating the reason
-     */
-    public CiBailout(String reason) {
-        super(reason);
-    }
-
-    /**
-     * Create a new {@code CiBailout}.
-     * @param reason a message indicating the reason with a String.format - syntax
-     * @param args parameters to the formatter
-     */
-    public CiBailout(String format, Object... args) {
-        this(String.format(Locale.ENGLISH, format, args));
-    }
-
-    /**
-     * Create a new {@code CiBailout} t due to an internal exception being thrown.
-     * @param reason a message indicating the reason
-     * @param cause the throwable that was the cause of the bailout
-     */
-    public CiBailout(String reason, Throwable cause) {
-        super(reason);
-        initCause(cause);
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCalleeSaveLayout.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2010, 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.graal.api.code;
-
-import java.util.*;
-
-
-/**
- * The callee save area (CSA) is a contiguous space in a stack frame
- * used to save (and restore) the values of the caller's registers.
- * This class describes the layout of a CSA in terms of its
- * {@linkplain #size size}, {@linkplain #slotSize slot size} and
- * the {@linkplain #registers callee save registers} covered by the CSA.
- */
-public class CiCalleeSaveLayout {
-
-    /**
-     * The size (in bytes) of the CSA.
-     */
-    public final int size;
-
-    /**
-     * The size (in bytes) of an {@linkplain #registerAtIndex(int) indexable} slot in the CSA.
-     */
-    public final int slotSize;
-
-    /**
-     * Map from {@linkplain CiRegister#number register numbers} to slot indexes in the CSA.
-     */
-    private final int[] regNumToIndex;
-
-    private final CiRegister[] indexToReg;
-
-    /**
-     * The list of registers {@linkplain #contains(CiRegister) contained} by this CSA.
-     */
-    public final CiRegister[] registers;
-
-    /**
-     * The offset from the frame pointer to the CSA. If this is not known, then this field
-     * will have the value {@link Integer#MAX_VALUE}.
-     */
-    public final int frameOffsetToCSA;
-
-    /**
-     * Creates a CSA layout.
-     *
-     * @param size size (in bytes) of the CSA. If this is {@code -1}, then the CSA size will be computed from {@code registers}.
-     * @param slotSize the size (in bytes) of an {@linkplain #registerAtIndex(int) indexable} slot in the CSA
-     * @param registers the registers that can be saved in the CSA
-     */
-    public CiCalleeSaveLayout(int frameOffsetToCSA, int size, int slotSize, CiRegister... registers) {
-        this.frameOffsetToCSA = frameOffsetToCSA;
-        assert slotSize == 0 || CiUtil.isPowerOf2(slotSize);
-        this.slotSize = slotSize;
-        int maxRegNum = -1;
-        int maxOffset = 0;
-        this.registers = registers;
-        int offset = 0;
-        for (CiRegister reg : registers) {
-            assert offset % slotSize == 0;
-            assert reg.number >= 0;
-            if (reg.number > maxRegNum) {
-                maxRegNum = reg.number;
-            }
-            if (offset > maxOffset) {
-                maxOffset = offset;
-            }
-            offset += reg.spillSlotSize;
-        }
-        if (size == -1) {
-            this.size = offset;
-        } else {
-            assert offset <= size;
-            this.size = size;
-        }
-
-        this.regNumToIndex = new int[maxRegNum + 1];
-        this.indexToReg = offset == 0 ? new CiRegister[0] : new CiRegister[offset / slotSize];
-        Arrays.fill(regNumToIndex, -1);
-        offset = 0;
-        for (CiRegister reg : registers) {
-            int index = offset / slotSize;
-            regNumToIndex[reg.number] = index;
-            indexToReg[index] = reg;
-            offset += reg.spillSlotSize;
-        }
-    }
-
-    /**
-     * Gets the offset of a given register in the CSA.
-     *
-     * @return the offset (in bytes) of {@code reg} in the CSA
-     * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA
-     */
-    public int offsetOf(int reg) {
-        return indexOf(reg) * slotSize;
-    }
-
-    /**
-     * Gets the index of a given register in the CSA.
-     *
-     * @return the index of {@code reg} in the CSA
-     * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA
-     */
-    public int indexOf(int reg) {
-        if (!contains(reg)) {
-            throw new IllegalArgumentException(String.valueOf(reg));
-        }
-        return regNumToIndex[reg];
-    }
-
-    /**
-     * Gets the offset of a given register in the CSA.
-     *
-     * @return the offset (in bytes) of {@code reg} in the CSA
-     * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA
-     */
-    public int offsetOf(CiRegister reg) {
-        return offsetOf(reg.number);
-    }
-
-    /**
-     * Determines if the CSA includes a slot for a given register.
-     *
-     * @param reg the register to test
-     * @return true if the CSA contains a slot for {@code reg}
-     */
-    public boolean contains(int reg) {
-        return reg >= 0 && reg < regNumToIndex.length && regNumToIndex[reg] != -1;
-    }
-
-    /**
-     * Gets the register whose slot in the CSA is at a given index.
-     *
-     * @param index an index of a slot in the CSA
-     * @return the register whose slot in the CSA is at  {@code index} or {@code null} if {@code index} does not denote a
-     *         slot in the CSA aligned with a register
-     */
-    public CiRegister registerAt(int index) {
-        if (index < 0 || index >= indexToReg.length) {
-            return null;
-        }
-        return indexToReg[index];
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder("[");
-        for (CiRegister reg : registers) {
-            if (sb.length() != 1) {
-                sb.append(", ");
-            }
-            sb.append(reg).append("{+").append(offsetOf(reg)).append('}');
-        }
-        return sb.append("] size=").append(size).toString();
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCallingConvention.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +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.graal.api.code;
-
-import static com.oracle.graal.api.code.CiValueUtil.*;
-
-import com.oracle.graal.api.meta.*;
-
-
-/**
- * A calling convention describes the locations in which the arguments for a call are placed.
- */
-public class CiCallingConvention {
-
-    /**
-     * Constants denoting the type of a call for which a calling convention is
-     * {@linkplain CiRegisterConfig#getCallingConvention(Type, CiKind[], CiTarget, boolean) requested}.
-     */
-    public enum Type {
-        /**
-         * A request for the outgoing argument locations at a call site to Java code.
-         */
-        JavaCall(true),
-
-        /**
-         * A request for the incoming argument locations.
-         */
-        JavaCallee(false),
-
-        /**
-         * A request for the outgoing argument locations at a call site to the runtime (which may be Java or native code).
-         */
-        RuntimeCall(true),
-
-        /**
-         * A request for the outgoing argument locations at a call site to
-         * external native code that complies with the platform ABI.
-         */
-        NativeCall(true);
-
-        /**
-         * Determines if this is a request for the outgoing argument locations at a call site.
-         */
-        public final boolean out;
-
-        public static final Type[] VALUES = values();
-
-        private Type(boolean out) {
-            this.out = out;
-        }
-    }
-
-    /**
-     * The amount of stack space (in bytes) required for the stack-based arguments of the call.
-     */
-    public final int stackSize;
-
-    /**
-     * The locations in which the arguments are placed. This array ordered by argument index.
-     */
-    public final Value[] locations;
-
-    public CiCallingConvention(Value[] locations, int stackSize) {
-        this.locations = locations;
-        this.stackSize = stackSize;
-        assert verify();
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder result = new StringBuilder();
-        result.append("CallingConvention[");
-        for (Value op : locations) {
-            result.append(op.toString()).append(" ");
-        }
-        result.append("]");
-        return result.toString();
-    }
-
-    private boolean verify() {
-        for (int i = 0; i < locations.length; i++) {
-            Value location = locations[i];
-            assert isStackSlot(location) || isRegister(location);
-        }
-        return true;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCodePos.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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.graal.api.code;
-
-import java.io.*;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Represents a code position, that is, a chain of inlined methods with bytecode
- * locations, that is communicated from the compiler to the runtime system. A code position
- * can be used by the runtime system to reconstruct a source-level stack trace
- * for exceptions and to create {@linkplain CiFrame frames} for deoptimization.
- */
-public abstract class CiCodePos implements Serializable {
-
-    private static final long serialVersionUID = 8633885274526033515L;
-
-    /**
-     * The position where this position has been called, {@code null} if none.
-     */
-    public final CiCodePos caller;
-
-    /**
-     * The runtime interface method for this position.
-     */
-    public final ResolvedJavaMethod method;
-
-    /**
-     * The location within the method, as a bytecode index. The constant
-     * {@code -1} may be used to indicate the location is unknown, for example
-     * within code synthesized by the compiler.
-     */
-    public final int bci;
-
-    /**
-     * Constructs a new object representing a given parent/caller, a given method, and a given BCI.
-     *
-     * @param caller the parent position
-     * @param method the method
-     * @param bci a BCI within the method
-     */
-    public CiCodePos(CiCodePos caller, ResolvedJavaMethod method, int bci) {
-        assert method != null;
-        this.caller = caller;
-        this.method = method;
-        this.bci = bci;
-    }
-
-    /**
-     * Converts this code position to a string representation.
-     * @return a string representation of this code position
-     */
-    @Override
-    public String toString() {
-        return CiUtil.append(new StringBuilder(100), this).toString();
-    }
-
-    /**
-     * Deep equality test.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == this) {
-            return true;
-        }
-        if (obj instanceof CiCodePos) {
-            CiCodePos other = (CiCodePos) obj;
-            if (other.method.equals(method) && other.bci == bci) {
-                if (caller == null) {
-                    return other.caller == null;
-                }
-                return caller.equals(other.caller);
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return bci;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCompilationStatistics.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
- * 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
- * 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.graal.api.code;
-
-import java.io.*;
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import com.oracle.graal.api.meta.*;
-
-@SuppressWarnings("unused")
-public final class CiCompilationStatistics {
-
-    private static final long RESOLUTION = 100000000;
-    private static final boolean TIMELINE_ENABLED = System.getProperty("stats.timeline.file") != null;
-    private static final boolean COMPILATIONSTATS_ENABLED = System.getProperty("stats.compilations.file") != null;
-    private static final boolean ENABLED = TIMELINE_ENABLED || COMPILATIONSTATS_ENABLED;
-
-    private static final CiCompilationStatistics DUMMY = new CiCompilationStatistics(null);
-
-    private static ConcurrentLinkedDeque<CiCompilationStatistics> list = new ConcurrentLinkedDeque<>();
-
-    private static final ThreadLocal<Deque<CiCompilationStatistics>> current = new ThreadLocal<Deque<CiCompilationStatistics>>() {
-
-        @Override
-        protected Deque<CiCompilationStatistics> initialValue() {
-            return new ArrayDeque<>();
-        }
-    };
-
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.FIELD)
-    private static @interface AbsoluteTimeValue {
-    }
-
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.FIELD)
-    private static @interface TimeValue {
-    }
-
-    private static long zeroTime = System.nanoTime();
-
-    private final String holder;
-    private final String name;
-    private final String signature;
-    @AbsoluteTimeValue
-    private final long startTime;
-    @TimeValue
-    private long duration;
-    private int startInvCount;
-    private int endInvCount;
-    private int bytecodeCount;
-    private int codeSize;
-    private int deoptCount;
-
-    private CiCompilationStatistics(ResolvedJavaMethod method) {
-        if (method != null) {
-            holder = CiUtil.format("%H", method);
-            name = method.name();
-            signature = CiUtil.format("%p", method);
-            startTime = System.nanoTime();
-            startInvCount = method.invocationCount();
-            bytecodeCount = method.codeSize();
-        } else {
-            holder = "";
-            name = "";
-            signature = "";
-            startTime = 0;
-        }
-    }
-
-    public void finish(ResolvedJavaMethod method) {
-        if (ENABLED) {
-            duration = System.nanoTime() - startTime;
-            endInvCount = method.invocationCount();
-            codeSize = method.compiledCodeSize();
-            if (current.get().getLast() != this) {
-                throw new RuntimeException("mismatch in finish()");
-            }
-            current.get().removeLast();
-        }
-    }
-
-    public static CiCompilationStatistics current() {
-        return current.get().isEmpty() ? null : current.get().getLast();
-    }
-
-    public static CiCompilationStatistics create(ResolvedJavaMethod method) {
-        if (ENABLED) {
-            CiCompilationStatistics stats = new CiCompilationStatistics(method);
-            list.add(stats);
-            current.get().addLast(stats);
-            return stats;
-        } else {
-            return DUMMY;
-        }
-    }
-
-    @SuppressWarnings("deprecation")
-    public static void clear(String dumpName) {
-        if (!ENABLED) {
-            return;
-        }
-        try {
-            ConcurrentLinkedDeque<CiCompilationStatistics> snapshot = list;
-            long snapshotZeroTime = zeroTime;
-
-            list = new ConcurrentLinkedDeque<>();
-            zeroTime = System.nanoTime();
-
-            Date now = new Date();
-            String dateString = (now.getYear() + 1900) + "_" + (now.getMonth() + 1) + "_" + now.getDate() + " " + now.getHours() + "_" + now.getMinutes() + "_" + now.getSeconds();
-            try (PrintStream out = new PrintStream("compilations " + dateString + " " + dumpName + ".csv")) {
-                // output the list of all compilations
-
-                Field[] declaredFields = CiCompilationStatistics.class.getDeclaredFields();
-                ArrayList<Field> fields = new ArrayList<>();
-                for (Field field : declaredFields) {
-                    if (!Modifier.isStatic(field.getModifiers())) {
-                        fields.add(field);
-                    }
-                }
-                for (Field field : fields) {
-                    out.print(field.getName() + ";");
-                }
-                out.println();
-                for (CiCompilationStatistics stats : snapshot) {
-                    for (Field field : fields) {
-                        if (field.isAnnotationPresent(AbsoluteTimeValue.class)) {
-                            double value = (field.getLong(stats) - snapshotZeroTime) / 1000000d;
-                            out.print(String.format(Locale.ENGLISH, "%.3f", value) + ";");
-                        } else if (field.isAnnotationPresent(TimeValue.class)) {
-                            double value = field.getLong(stats) / 1000000d;
-                            out.print(String.format(Locale.ENGLISH, "%.3f", value) + ";");
-                        } else {
-                            out.print(field.get(stats) + ";");
-                        }
-                    }
-                    out.println();
-                }
-            }
-
-            String timelineFile = System.getProperty("stats.timeline.file");
-            if (timelineFile == null || timelineFile.isEmpty()) {
-                timelineFile = "timeline " + dateString;
-            }
-            try (FileOutputStream fos = new FileOutputStream(timelineFile + " " + dumpName + ".csv", true); PrintStream out = new PrintStream(fos)) {
-
-                long[] timeSpent = new long[10000];
-                int maxTick = 0;
-                for (CiCompilationStatistics stats : snapshot) {
-                    long start = stats.startTime - snapshotZeroTime;
-                    long duration = stats.duration;
-                    if (start < 0) {
-                        duration -= -start;
-                        start = 0;
-                    }
-
-                    int tick = (int) (start / RESOLUTION);
-                    long timeLeft = RESOLUTION - (start % RESOLUTION);
-
-                    while (tick < timeSpent.length && duration > 0) {
-                        if (tick > maxTick) {
-                            maxTick = tick;
-                        }
-                        timeSpent[tick] += Math.min(timeLeft, duration);
-                        duration -= timeLeft;
-                        tick++;
-                        timeLeft = RESOLUTION;
-                    }
-                }
-                String timelineName = System.getProperty("stats.timeline.name");
-                if (timelineName != null && !timelineName.isEmpty()) {
-                    out.print(timelineName + ";");
-                }
-                for (int i = 0; i <= maxTick; i++) {
-                    out.print((timeSpent[i] * 100 / RESOLUTION) + ";");
-                }
-                out.println();
-            }
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public void setDeoptCount(int count) {
-        this.deoptCount = count;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiDebugInfo.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +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.graal.api.code;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Represents the debugging information for a particular place in the code,
- * which includes the code position, a reference map, and deoptimization information.
- */
-public class CiDebugInfo implements Serializable {
-
-    private static final long serialVersionUID = -6047206624915812516L;
-
-    /**
-     * The code position (including all inlined methods) of this debug info.
-     * If this is a {@link CiFrame} instance, then it is also the deoptimization information for each inlined frame.
-     */
-    public final CiCodePos codePos;
-
-    /**
-     * The reference map for the registers at this point. The reference map is <i>packed</i> in that
-     * for bit {@code k} in byte {@code n}, it refers to the register whose
-     * {@linkplain CiRegister#number number} is {@code (k + n * 8)}.
-     */
-    public final BitSet registerRefMap;
-
-    /**
-     * The reference map for the stack frame at this point. A set bit at {@code k} in the map
-     * represents stack slot number {@code k}.
-     */
-    public final BitSet frameRefMap;
-
-    /**
-     * Creates a new {@code CiDebugInfo} from the given values.
-     *
-     * @param codePos the {@linkplain CiCodePos code position} or {@linkplain CiFrame frame} info
-     * @param registerRefMap the register map
-     * @param frameRefMap the reference map for {@code frame}, which may be {@code null}
-     */
-    public CiDebugInfo(CiCodePos codePos, BitSet registerRefMap, BitSet frameRefMap) {
-        this.codePos = codePos;
-        this.registerRefMap = registerRefMap;
-        this.frameRefMap = frameRefMap;
-    }
-
-    /**
-     * @return {@code true} if this debug information has a frame
-     */
-    public boolean hasFrame() {
-        return codePos instanceof CiFrame;
-    }
-
-    /**
-     * @return {@code true} if this debug info has a reference map for the registers
-     */
-    public boolean hasRegisterRefMap() {
-        return registerRefMap != null && registerRefMap.size() > 0;
-    }
-
-    /**
-     * @return {@code true} if this debug info has a reference map for the stack
-     */
-    public boolean hasStackRefMap() {
-        return frameRefMap != null && frameRefMap.size() > 0;
-    }
-
-
-    /**
-     * Gets the deoptimization information for each inlined frame (if available).
-     *
-     * @return {@code null} if no frame de-opt info is {@linkplain #hasDebugFrame available}
-     */
-    public CiFrame frame() {
-        if (hasFrame()) {
-            return (CiFrame) codePos;
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return CiUtil.append(new StringBuilder(100), this, null).toString();
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiDeoptAction.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * 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
- * 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.graal.api.code;
-
-
-public enum CiDeoptAction {
-    None,                           // just interpret, do not invalidate nmethod
-    RecompileIfTooManyDeopts,       // recompile the nmethod; need not invalidate
-    InvalidateReprofile,            // invalidate the nmethod, reset IC, maybe recompile
-    InvalidateRecompile,            // invalidate the nmethod, recompile (probably)
-    InvalidateStopCompiling;        // invalidate the nmethod and do not compile
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiFrame.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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.graal.api.code;
-
-import java.io.*;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Represents the Java bytecode frame state(s) at a given position
- * including {@link Value locations} where to find the local variables,
- * operand stack values and locked objects of the bytecode frame(s).
- */
-public class CiFrame extends CiCodePos implements Serializable {
-    private static final long serialVersionUID = -345025397165977565L;
-
-    /**
-     * An array of values representing how to reconstruct the state of the Java frame.
-     * This is array is partitioned as follows:
-     * <p>
-     * <table border="1" cellpadding="5" frame="void", rules="all">
-     * <tr><th>Start index (inclusive)</th><th>End index (exclusive)</th><th>Description</th></tr>
-     * <tr><td>0</td>                   <td>numLocals</td>           <td>Local variables</td></tr>
-     * <tr><td>numLocals</td>           <td>numLocals + numStack</td><td>Operand stack</td></tr>
-     * <tr><td>numLocals + numStack</td><td>values.length</td>       <td>Locked objects</td></tr>
-     * </table>
-     * <p>
-     * Note that the number of locals and the number of stack slots may be smaller than the
-     * maximum number of locals and stack slots as specified in the compiled method.
-     */
-    public final Value[] values;
-
-    /**
-     * The number of locals in the values array.
-     */
-    public final int numLocals;
-
-    /**
-     * The number of stack slots in the values array.
-     */
-    public final int numStack;
-
-    /**
-     * The number of locks in the values array.
-     */
-    public final int numLocks;
-
-    /**
-     * In case this frame state belongs to a deoptimization, the leafGraphId will contain the StructuredGraph.graphId() of the graph that originally introduced this deoptimization point.
-     * This id is later on used by the runtime system to evict graphs from the graph cache when deoptimizations originating from them have been hit.
-     */
-    public final long leafGraphId;
-
-    public final boolean rethrowException;
-
-    public final boolean duringCall;
-
-    /**
-     * Creates a new frame object.
-     *
-     * @param caller the caller frame (which may be {@code null})
-     * @param method the method
-     * @param bci a BCI within the method
-     * @param rethrowException specifies if the VM should re-throw the pending exception when deopt'ing using this frame
-     * @param values the frame state {@link #values}
-     * @param numLocals the number of local variables
-     * @param numStack the depth of the stack
-     * @param numLocks the number of locked objects
-     */
-    public CiFrame(CiFrame caller, ResolvedJavaMethod method, int bci, boolean rethrowException, boolean duringCall, Value[] values, int numLocals, int numStack, int numLocks, long leafGraphId) {
-        super(caller, method, bci);
-        assert values != null;
-        this.rethrowException = rethrowException;
-        this.duringCall = duringCall;
-        this.values = values;
-        this.numLocals = numLocals;
-        this.numStack = numStack;
-        this.numLocks = numLocks;
-        this.leafGraphId = leafGraphId;
-        assert !rethrowException || numStack == 1 : "must have exception on top of the stack";
-    }
-
-    /**
-     * Gets the value representing the specified local variable.
-     * @param i the local variable index
-     * @return the value that can be used to reconstruct the local's current value
-     */
-    public Value getLocalValue(int i) {
-        return values[i];
-    }
-
-    /**
-     * Gets the value representing the specified stack slot.
-     * @param i the stack index
-     * @return the value that can be used to reconstruct the stack slot's current value
-     */
-    public Value getStackValue(int i) {
-        return values[i + numLocals];
-    }
-
-    /**
-     * Gets the value representing the specified lock.
-     * @param i the lock index
-     * @return the value that can be used to reconstruct the lock's current value
-     */
-    public Value getLockValue(int i) {
-        return values[i + numLocals + numStack];
-    }
-
-    /**
-     * Gets the caller of this frame.
-     *
-     * @return {@code null} if this frame has no caller
-     */
-    public CiFrame caller() {
-        return (CiFrame) caller;
-    }
-
-    @Override
-    public String toString() {
-        return CiUtil.append(new StringBuilder(100), this).toString();
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiMonitorValue.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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.graal.api.code;
-
-import com.oracle.graal.api.meta.*;
-
-public final class CiMonitorValue extends Value {
-    private static final long serialVersionUID = 8241681800464483691L;
-
-    public Value owner;
-    public final Value lockData;
-    public final boolean eliminated;
-
-    public CiMonitorValue(Value owner, Value lockData, boolean eliminated) {
-        super(Kind.Illegal);
-        this.owner = owner;
-        this.lockData = lockData;
-        this.eliminated = eliminated;
-    }
-
-    @Override
-    public String toString() {
-        return "monitor[" + owner + (lockData != null ? ", " + lockData : "") + (eliminated ? ", eliminated" : "") + "]";
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegister.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,256 +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.graal.api.code;
-
-import java.io.*;
-import java.util.*;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Represents a target machine register.
- */
-public final class CiRegister implements Comparable<CiRegister>, Serializable {
-
-    private static final long serialVersionUID = -7213269157816016300L;
-
-    /**
-     * Invalid register.
-     */
-    public static final CiRegister None = new CiRegister(-1, -1, 0, "noreg");
-
-    /**
-     * Frame pointer of the current method. All spill slots and outgoing stack-based arguments
-     * are addressed relative to this register.
-     */
-    public static final CiRegister Frame = new CiRegister(-2, -2, 0, "framereg", RegisterFlag.CPU);
-
-    public static final CiRegister CallerFrame = new CiRegister(-3, -3, 0, "callerframereg", RegisterFlag.CPU);
-
-    /**
-     * The identifier for this register that is unique across all the registers in a {@link CiArchitecture}.
-     * A valid register has {@code number > 0}.
-     */
-    public final int number;
-
-    /**
-     * The mnemonic of this register.
-     */
-    public final String name;
-
-    /**
-     * The actual encoding in a target machine instruction for this register, which may or
-     * may not be the same as {@link #number}.
-     */
-    public final int encoding;
-
-    /**
-     * The size of the stack slot used to spill the value of this register.
-     */
-    public final int spillSlotSize;
-
-    /**
-     * The set of {@link RegisterFlag} values associated with this register.
-     */
-    private final int flags;
-
-    /**
-     * An array of {@link CiRegisterValue} objects, for this register, with one entry
-     * per {@link Kind}, indexed by {@link Kind#ordinal}.
-     */
-    private final CiRegisterValue[] values;
-
-    /**
-     * Attributes that characterize a register in a useful way.
-     *
-     */
-    public enum RegisterFlag {
-        /**
-         * Denotes an integral (i.e. non floating point) register.
-         */
-        CPU,
-
-        /**
-         * Denotes a register whose lowest order byte can be addressed separately.
-         */
-        Byte,
-
-        /**
-         * Denotes a floating point register.
-         */
-        FPU;
-
-        public final int mask = 1 << (ordinal() + 1);
-    }
-
-    /**
-     * Creates a {@code CiRegister} instance.
-     *
-     * @param number unique identifier for the register
-     * @param encoding the target machine encoding for the register
-     * @param spillSlotSize the size of the stack slot used to spill the value of the register
-     * @param name the mnemonic name for the register
-     * @param flags the set of {@link RegisterFlag} values for the register
-     */
-    public CiRegister(int number, int encoding, int spillSlotSize, String name, RegisterFlag... flags) {
-        this.number = number;
-        this.name = name;
-        this.spillSlotSize = spillSlotSize;
-        this.flags = createMask(flags);
-        this.encoding = encoding;
-
-        values = new CiRegisterValue[Kind.VALUES.length];
-        for (Kind kind : Kind.VALUES) {
-            values[kind.ordinal()] = new CiRegisterValue(kind, this);
-        }
-    }
-
-    private static int createMask(RegisterFlag... flags) {
-        int result = 0;
-        for (RegisterFlag f : flags) {
-            result |= f.mask;
-        }
-        return result;
-    }
-
-    public boolean isSet(RegisterFlag f) {
-        return (flags & f.mask) != 0;
-    }
-
-    /**
-     * Gets this register as a {@linkplain CiRegisterValue value} with a specified kind.
-     * @param kind the specified kind
-     * @return the {@link CiRegisterValue}
-     */
-    public CiRegisterValue asValue(Kind kind) {
-        return values[kind.ordinal()];
-    }
-
-    /**
-     * Gets this register as a {@linkplain CiRegisterValue value} with no particular kind.
-     * @return a {@link CiRegisterValue} with {@link Kind#Illegal} kind.
-     */
-    public CiRegisterValue asValue() {
-        return asValue(Kind.Illegal);
-    }
-
-    /**
-     * Determines if this is a valid register.
-     * @return {@code true} iff this register is valid
-     */
-    public boolean isValid() {
-        return number >= 0;
-    }
-
-    /**
-     * Determines if this a floating point register.
-     */
-    public boolean isFpu() {
-        return isSet(RegisterFlag.FPU);
-    }
-
-    /**
-     * Determines if this a general purpose register.
-     */
-    public boolean isCpu() {
-        return isSet(RegisterFlag.CPU);
-    }
-
-    /**
-     * Determines if this register has the {@link RegisterFlag#Byte} attribute set.
-     * @return {@code true} iff this register has the {@link RegisterFlag#Byte} attribute set.
-     */
-    public boolean isByte() {
-        return isSet(RegisterFlag.Byte);
-    }
-
-    /**
-     * Categorizes a set of registers by {@link RegisterFlag}.
-     *
-     * @param registers a list of registers to be categorized
-     * @return a map from each {@link RegisterFlag} constant to the list of registers for which the flag is
-     *         {@linkplain #isSet(RegisterFlag) set}
-     */
-    public static EnumMap<RegisterFlag, CiRegister[]> categorize(CiRegister[] registers) {
-        EnumMap<RegisterFlag, CiRegister[]> result = new EnumMap<>(RegisterFlag.class);
-        for (RegisterFlag flag : RegisterFlag.values()) {
-            ArrayList<CiRegister> list = new ArrayList<>();
-            for (CiRegister r : registers) {
-                if (r.isSet(flag)) {
-                    list.add(r);
-                }
-            }
-            result.put(flag, list.toArray(new CiRegister[list.size()]));
-        }
-        return result;
-    }
-
-    /**
-     * Gets the maximum register {@linkplain #number number} in a given set of registers.
-     *
-     * @param registers the set of registers to process
-     * @return the maximum register number for any register in {@code registers}
-     */
-    public static int maxRegisterNumber(CiRegister[] registers) {
-        int max = Integer.MIN_VALUE;
-        for (CiRegister r : registers) {
-            if (r.number > max) {
-                max = r.number;
-            }
-        }
-        return max;
-    }
-
-    /**
-     * Gets the maximum register {@linkplain #encoding encoding} in a given set of registers.
-     *
-     * @param registers the set of registers to process
-     * @return the maximum register encoding for any register in {@code registers}
-     */
-    public static int maxRegisterEncoding(CiRegister[] registers) {
-        int max = Integer.MIN_VALUE;
-        for (CiRegister r : registers) {
-            if (r.encoding > max) {
-                max = r.encoding;
-            }
-        }
-        return max;
-    }
-
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    @Override
-    public int compareTo(CiRegister o) {
-        if (number < o.number) {
-            return -1;
-        }
-        if (number > o.number) {
-            return 1;
-        }
-        return 0;
-    }
-
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterAttributes.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2010, 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.graal.api.code;
-
-import java.util.*;
-
-/**
- * A collection of register attributes. The specific attribute values for a register may be
- * local to a compilation context. For example, a {@link CiRegisterConfig} in use during
- * a compilation will determine which registers are callee saved.
- */
-public class CiRegisterAttributes {
-
-    /**
-     * Denotes a register whose value preservation (if required) across a call is the responsibility of the caller.
-     */
-    public final boolean isCallerSave;
-
-    /**
-     * Denotes a register whose value preservation (if required) across a call is the responsibility of the callee.
-     */
-    public final boolean isCalleeSave;
-
-    /**
-     * Denotes a register that is available for use by a register allocator.
-     */
-    public final boolean isAllocatable;
-
-    /**
-     * Denotes a register guaranteed to be non-zero if read in compiled Java code.
-     * For example, a register dedicated to holding the current thread.
-     */
-    public boolean isNonZero;
-
-    public CiRegisterAttributes(boolean isCallerSave, boolean isCalleeSave, boolean isAllocatable) {
-        this.isCallerSave = isCallerSave;
-        this.isCalleeSave = isCalleeSave;
-        this.isAllocatable = isAllocatable;
-    }
-
-    public static final CiRegisterAttributes NONE = new CiRegisterAttributes(false, false, false);
-
-    /**
-     * Creates a map from register {@linkplain CiRegister#number numbers} to register
-     * {@linkplain CiRegisterAttributes attributes} for a given register configuration and set of
-     * registers.
-     *
-     * @param registerConfig a register configuration
-     * @param registers a set of registers
-     * @return an array whose length is the max register number in {@code registers} plus 1. An element at index i holds
-     *         the attributes of the register whose number is i.
-     */
-    public static CiRegisterAttributes[] createMap(CiRegisterConfig registerConfig, CiRegister[] registers) {
-        CiRegisterAttributes[] map = new CiRegisterAttributes[registers.length];
-        for (CiRegister reg : registers) {
-            if (reg != null) {
-                CiCalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
-                CiRegisterAttributes attr = new CiRegisterAttributes(
-                                Arrays.asList(registerConfig.getCallerSaveRegisters()).contains(reg),
-                                csl == null ? false : Arrays.asList(csl.registers).contains(reg),
-                                Arrays.asList(registerConfig.getAllocatableRegisters()).contains(reg));
-                if (map.length <= reg.number) {
-                    map = Arrays.copyOf(map, reg.number + 1);
-                }
-                map[reg.number] = attr;
-            }
-        }
-        for (int i = 0; i < map.length; i++) {
-            if (map[i] == null) {
-                map[i] = NONE;
-            }
-        }
-        return map;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterConfig.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +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.graal.api.code;
-
-import java.util.*;
-
-import com.oracle.graal.api.code.CiCallingConvention.*;
-import com.oracle.graal.api.code.CiRegister.*;
-import com.oracle.graal.api.meta.*;
-
-/**
- * A register configuration binds roles and {@linkplain CiRegisterAttributes attributes}
- * to physical registers.
- */
-public interface CiRegisterConfig {
-
-    /**
-     * Gets the register to be used for returning a value of a given kind.
-     */
-    CiRegister getReturnRegister(Kind kind);
-
-    /**
-     * Gets the register to which {@link CiRegister#Frame} and {@link CiRegister#CallerFrame} are bound.
-     */
-    CiRegister getFrameRegister();
-
-    CiRegister getScratchRegister();
-
-    /**
-     * Gets the calling convention describing how arguments are passed.
-     *
-     * @param type the type of calling convention being requested
-     * @param parameters the types of the arguments of the call
-     * @param target the target platform
-     * @param stackOnly ignore registers
-     */
-    CiCallingConvention getCallingConvention(Type type, Kind[] parameters, CiTarget target, boolean stackOnly);
-
-    /**
-     * Gets the ordered set of registers that are can be used to pass parameters
-     * according to a given calling convention.
-     *
-     * @param type the type of calling convention
-     * @param flag specifies whether registers for {@linkplain RegisterFlag#CPU integral} or
-     *             {@linkplain} RegisterFlag#FPU floating point} parameters are being requested
-     * @return the ordered set of registers that may be used to pass parameters in a call conforming to {@code type}
-     */
-    CiRegister[] getCallingConventionRegisters(Type type, RegisterFlag flag);
-
-    /**
-     * Gets the set of registers that can be used by the register allocator.
-     */
-    CiRegister[] getAllocatableRegisters();
-
-    /**
-     * Gets the set of registers that can be used by the register allocator,
-     * {@linkplain CiRegister#categorize(CiRegister[]) categorized} by register {@linkplain RegisterFlag flags}.
-     *
-     * @return a map from each {@link RegisterFlag} constant to the list of {@linkplain #getAllocatableRegisters()
-     *         allocatable} registers for which the flag is {@linkplain #isSet(RegisterFlag) set}
-     *
-     */
-    EnumMap<RegisterFlag, CiRegister[]> getCategorizedAllocatableRegisters();
-
-    /**
-     * Gets the registers whose values must be preserved by a method across any call it makes.
-     */
-    CiRegister[] getCallerSaveRegisters();
-
-    /**
-     * Gets the layout of the callee save area of this register configuration.
-     *
-     * @return {@code null} if there is no callee save area
-     */
-    CiCalleeSaveLayout getCalleeSaveLayout();
-
-    /**
-     * Gets a map from register {@linkplain CiRegister#number numbers} to register
-     * {@linkplain CiRegisterAttributes attributes} for this register configuration.
-     *
-     * @return an array where an element at index i holds the attributes of the register whose number is i
-     * @see CiRegister#categorize(CiRegister[])
-     */
-    CiRegisterAttributes[] getAttributesMap();
-
-    /**
-     * Gets the register corresponding to a runtime-defined role.
-     *
-     * @param id the identifier of a runtime-defined register role
-     * @return the register playing the role specified by {@code id}
-     */
-    CiRegister getRegisterForRole(int id);
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterConfigImpl.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,298 +0,0 @@
-/*
- * Copyright (c) 2010, 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.graal.api.code;
-
-import java.util.*;
-
-import com.oracle.graal.api.code.CiCallingConvention.*;
-import com.oracle.graal.api.code.CiRegister.*;
-import com.oracle.graal.api.meta.*;
-
-/**
- * A default implementation of {@link CiRegisterConfig}.
- */
-public class CiRegisterConfigImpl implements CiRegisterConfig {
-
-    /**
-     * The object describing the callee save area of this register configuration.
-     */
-    public CiCalleeSaveLayout csl;
-
-    /**
-     * The minimum register role identifier.
-     */
-    public final int minRole;
-
-    /**
-     * The map from register role IDs to registers.
-     */
-    public final CiRegister[] registersRoleMap;
-
-    /**
-     * The set of registers that can be used by the register allocator.
-     */
-    public final CiRegister[] allocatable;
-
-    /**
-     * The set of registers that can be used by the register allocator,
-     * {@linkplain CiRegister#categorize(CiRegister[]) categorized} by register
-     * {@linkplain RegisterFlag flags}.
-     */
-    public final EnumMap<RegisterFlag, CiRegister[]> categorized;
-
-    /**
-     * The ordered set of registers used to pass integral arguments.
-     */
-    public final CiRegister[] cpuParameters;
-
-    /**
-     * The ordered set of registers used to pass floating point arguments.
-     */
-    public final CiRegister[] fpuParameters;
-
-    /**
-     * The caller saved registers.
-     */
-    public final CiRegister[] callerSave;
-
-    /**
-     * The register to which {@link CiRegister#Frame} and {@link CiRegister#CallerFrame} are bound.
-     */
-    public final CiRegister frame;
-
-    /**
-     * Register for returning an integral value.
-     */
-    public final CiRegister integralReturn;
-
-    /**
-     * Register for returning a floating point value.
-     */
-    public final CiRegister floatingPointReturn;
-
-    /**
-     * The map from register {@linkplain CiRegister#number numbers} to register
-     * {@linkplain CiRegisterAttributes attributes} for this register configuration.
-     */
-    public final CiRegisterAttributes[] attributesMap;
-
-    /**
-     * The scratch register.
-     */
-    public final CiRegister scratch;
-
-    /**
-     * The frame offset of the first stack argument for each calling convention {@link CiCallingConvention.Type}.
-     */
-    public final int[] stackArg0Offsets = new int[CiCallingConvention.Type.VALUES.length];
-
-    public CiRegisterConfigImpl(
-                    CiRegister frame,
-                    CiRegister integralReturn,
-                    CiRegister floatingPointReturn,
-                    CiRegister scratch,
-                    CiRegister[] allocatable,
-                    CiRegister[] callerSave,
-                    CiRegister[] parameters,
-                    CiCalleeSaveLayout csl,
-                    CiRegister[] allRegisters,
-                    Map<Integer, CiRegister> roles) {
-        this.frame = frame;
-        this.csl = csl;
-        this.allocatable = allocatable;
-        this.callerSave = callerSave;
-        assert !Arrays.asList(allocatable).contains(scratch);
-        this.scratch = scratch;
-        EnumMap<RegisterFlag, CiRegister[]> categorizedParameters = CiRegister.categorize(parameters);
-        this.cpuParameters = categorizedParameters.get(RegisterFlag.CPU);
-        this.fpuParameters = categorizedParameters.get(RegisterFlag.FPU);
-        categorized = CiRegister.categorize(allocatable);
-        attributesMap = CiRegisterAttributes.createMap(this, allRegisters);
-        this.floatingPointReturn = floatingPointReturn;
-        this.integralReturn = integralReturn;
-        int minRoleId = Integer.MAX_VALUE;
-        int maxRoleId = Integer.MIN_VALUE;
-        for (Map.Entry<Integer, CiRegister> e : roles.entrySet()) {
-            int id = e.getKey();
-            assert id >= 0;
-            if (minRoleId > id) {
-                minRoleId = id;
-            }
-            if (maxRoleId < id) {
-                maxRoleId = id;
-            }
-        }
-        registersRoleMap = new CiRegister[(maxRoleId - minRoleId) + 1];
-        for (Map.Entry<Integer, CiRegister> e : roles.entrySet()) {
-            int id = e.getKey();
-            registersRoleMap[id] = e.getValue();
-        }
-        minRole = minRoleId;
-    }
-
-    public CiRegisterConfigImpl(CiRegisterConfigImpl src, CiCalleeSaveLayout csl) {
-        this.frame = src.frame;
-        this.csl = csl;
-        this.allocatable = src.allocatable;
-        this.callerSave = src.callerSave;
-        this.scratch = src.scratch;
-        this.cpuParameters = src.cpuParameters;
-        this.fpuParameters = src.fpuParameters;
-        this.categorized = src.categorized;
-        this.attributesMap = src.attributesMap;
-        this.floatingPointReturn = src.floatingPointReturn;
-        this.integralReturn = src.integralReturn;
-        this.registersRoleMap = src.registersRoleMap;
-        this.minRole = src.minRole;
-        System.arraycopy(src.stackArg0Offsets, 0, stackArg0Offsets, 0, stackArg0Offsets.length);
-    }
-
-    public CiRegister getReturnRegister(Kind kind) {
-        if (kind.isDouble() || kind.isFloat()) {
-            return floatingPointReturn;
-        }
-        return integralReturn;
-    }
-
-    public CiRegister getFrameRegister() {
-        return frame;
-    }
-
-    public CiRegister getScratchRegister() {
-        return scratch;
-    }
-
-    /**
-     * {@inheritDoc}
-     *
-     * This implementation assigns all available registers to parameters before assigning
-     * any stack slots to parameters.
-     */
-    public CiCallingConvention getCallingConvention(Type type, Kind[] parameters, CiTarget target, boolean stackOnly) {
-        Value[] locations = new Value[parameters.length];
-
-        int currentGeneral = 0;
-        int currentXMM = 0;
-        int currentStackOffset = stackArg0Offsets[type.ordinal()];
-
-        for (int i = 0; i < parameters.length; i++) {
-            final Kind kind = parameters[i];
-
-            switch (kind) {
-                case Byte:
-                case Boolean:
-                case Short:
-                case Char:
-                case Int:
-                case Long:
-                case Object:
-                    if (!stackOnly && currentGeneral < cpuParameters.length) {
-                        CiRegister register = cpuParameters[currentGeneral++];
-                        locations[i] = register.asValue(kind);
-                    }
-                    break;
-
-                case Float:
-                case Double:
-                    if (!stackOnly && currentXMM < fpuParameters.length) {
-                        CiRegister register = fpuParameters[currentXMM++];
-                        locations[i] = register.asValue(kind);
-                    }
-                    break;
-
-                default:
-                    throw new InternalError("Unexpected parameter kind: " + kind);
-            }
-
-            if (locations[i] == null) {
-                locations[i] = CiStackSlot.get(kind.stackKind(), currentStackOffset, !type.out);
-                currentStackOffset += Math.max(target.sizeInBytes(kind), target.wordSize);
-            }
-        }
-
-        return new CiCallingConvention(locations, currentStackOffset);
-    }
-
-    public CiRegister[] getCallingConventionRegisters(Type type, RegisterFlag flag) {
-        if (flag == RegisterFlag.CPU) {
-            return cpuParameters;
-        }
-        assert flag == RegisterFlag.FPU;
-        return fpuParameters;
-    }
-
-    public CiRegister[] getAllocatableRegisters() {
-        return allocatable;
-    }
-
-    public EnumMap<RegisterFlag, CiRegister[]> getCategorizedAllocatableRegisters() {
-        return categorized;
-    }
-
-    public CiRegister[] getCallerSaveRegisters() {
-        return callerSave;
-    }
-
-    public CiCalleeSaveLayout getCalleeSaveLayout() {
-        return csl;
-    }
-
-    public CiRegisterAttributes[] getAttributesMap() {
-        return attributesMap;
-    }
-
-    public CiRegister getRegisterForRole(int id) {
-        return registersRoleMap[id - minRole];
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder roleMap = new StringBuilder();
-        for (int i = 0; i < registersRoleMap.length; ++i) {
-            CiRegister reg = registersRoleMap[i];
-            if (reg != null) {
-                if (roleMap.length() != 0) {
-                    roleMap.append(", ");
-                }
-                roleMap.append(i + minRole).append(" -> ").append(reg);
-            }
-        }
-        StringBuilder stackArg0OffsetsMap = new StringBuilder();
-        for (Type t : Type.VALUES) {
-            if (stackArg0OffsetsMap.length() != 0) {
-                stackArg0OffsetsMap.append(", ");
-            }
-            stackArg0OffsetsMap.append(t).append(" -> ").append(stackArg0Offsets[t.ordinal()]);
-        }
-        String res = String.format(
-             "Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" +
-             "CallerSave:  " + Arrays.toString(getCallerSaveRegisters()) + "%n" +
-             "CalleeSave:  " + getCalleeSaveLayout() + "%n" +
-             "CPU Params:  " + Arrays.toString(cpuParameters) + "%n" +
-             "FPU Params:  " + Arrays.toString(fpuParameters) + "%n" +
-             "VMRoles:     " + roleMap + "%n" +
-             "stackArg0:   " + stackArg0OffsetsMap + "%n" +
-             "Scratch:     " + getScratchRegister() + "%n");
-        return res;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRegisterValue.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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.graal.api.code;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Denotes a register that stores a value of a fixed kind. There is exactly one (canonical) instance of {@code
- * CiRegisterValue} for each ({@link CiRegister}, {@link Kind}) pair. Use {@link CiRegister#asValue(Kind)} to
- * retrieve the canonical {@link CiRegisterValue} instance for a given (register,kind) pair.
- */
-public final class CiRegisterValue extends Value {
-    private static final long serialVersionUID = 7999341472196897163L;
-
-    /**
-     * The register.
-     */
-    public final CiRegister reg;
-
-    /**
-     * Should only be called from {@link CiRegister#CiRegister} to ensure canonicalization.
-     */
-    protected CiRegisterValue(Kind kind, CiRegister register) {
-        super(kind);
-        this.reg = register;
-    }
-
-    @Override
-    public int hashCode() {
-        return (reg.number << 4) ^ kind.ordinal();
-    }
-
-    @Override
-    public String toString() {
-        return reg.name + kindSuffix();
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiRuntimeCall.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +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.graal.api.code;
-
-import static com.oracle.graal.api.meta.Kind.*;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Enumerates the calls that must be provided by the runtime system. The compiler
- * may generate code that calls the runtime services for unresolved and slow cases of some
- * bytecodes.
- */
-public enum CiRuntimeCall {
-    UnwindException(Void, Object),
-    Deoptimize(Void),
-    RegisterFinalizer(Void, Object),
-    SetDeoptInfo(Void, Object),
-    CreateNullPointerException(Object),
-    CreateOutOfBoundsException(Object, Int),
-    JavaTimeMillis(Long),
-    JavaTimeNanos(Long),
-    Debug(Void),
-    ArithmeticFrem(Float, Float, Float),
-    ArithmeticDrem(Double, Double, Double),
-    ArithmeticCos(Double, Double),
-    ArithmeticTan(Double, Double),
-    ArithmeticSin(Double, Double),
-    GenericCallback(Object, Object, Object);
-
-    public final Kind resultKind;
-    public final Kind[] arguments;
-
-    private CiRuntimeCall(Kind resultKind, Kind... args) {
-        this.resultKind = resultKind;
-        this.arguments = args;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiStackSlot.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2010, 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.graal.api.code;
-
-import static com.oracle.graal.api.meta.Kind.*;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Represents a compiler spill slot or an outgoing stack-based argument in a method's frame
- * or an incoming stack-based argument in a method's {@linkplain #inCallerFrame() caller's frame}.
- */
-public final class CiStackSlot extends Value {
-    private static final long serialVersionUID = -7725071921307318433L;
-
-    private final int offset;
-    private final boolean addFrameSize;
-
-    /**
-     * Gets a {@link CiStackSlot} instance representing a stack slot at a given index
-     * holding a value of a given kind.
-     *
-     * @param kind The kind of the value stored in the stack slot.
-     * @param offset The offset of the stack slot (in bytes)
-     * @param inCallerFrame Specifies if the offset is relative to the stack pointer,
-     *        or the beginning of the frame (stack pointer + total frame size).
-     */
-    public static CiStackSlot get(Kind kind, int offset, boolean addFrameSize) {
-        assert kind.stackKind() == kind;
-        assert addFrameSize || offset >= 0;
-
-        if (offset % CACHE_GRANULARITY == 0) {
-            CiStackSlot[][] cache;
-            int index = offset / CACHE_GRANULARITY;
-            if (!addFrameSize) {
-                cache = OUT_CACHE;
-            } else if (offset >= 0) {
-                cache = IN_CACHE;
-            } else {
-                cache = SPILL_CACHE;
-                index = -index;
-            }
-            CiStackSlot[] slots = cache[kind.ordinal()];
-            if (index < slots.length) {
-                CiStackSlot slot = slots[index];
-                assert slot.kind == kind && slot.offset == offset && slot.addFrameSize == addFrameSize;
-                return slot;
-            }
-        }
-        return new CiStackSlot(kind, offset, addFrameSize);
-    }
-
-    /**
-     * Private constructor to enforce use of {@link #get()} so that a cache can be used.
-     */
-    private CiStackSlot(Kind kind, int offset, boolean addFrameSize) {
-        super(kind);
-        this.offset = offset;
-        this.addFrameSize = addFrameSize;
-    }
-
-    /**
-     * Gets the offset of this stack slot, relative to the stack pointer.
-     * @return The offset of this slot (in bytes).
-     */
-    public int offset(int totalFrameSize) {
-        assert totalFrameSize > 0 || !addFrameSize;
-        int result = offset + (addFrameSize ? totalFrameSize : 0);
-        assert result >= 0;
-        return result;
-    }
-
-    public boolean inCallerFrame() {
-        return addFrameSize && offset >= 0;
-    }
-
-    public int rawOffset() {
-        return offset;
-    }
-
-    public boolean rawAddFrameSize() {
-        return addFrameSize;
-    }
-
-    @Override
-    public int hashCode() {
-        return kind.ordinal() ^ (offset << 4) ^ (addFrameSize ? 15 : 0);
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (o instanceof CiStackSlot) {
-            CiStackSlot l = (CiStackSlot) o;
-            return l.kind == kind && l.offset == offset && l.addFrameSize == addFrameSize;
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        if (!addFrameSize) {
-            return "out:" + offset + kindSuffix();
-        } else if (offset >= 0) {
-            return "in:" + offset + kindSuffix();
-        } else {
-            return "stack:" + (-offset) + kindSuffix();
-        }
-    }
-
-    /**
-     * Gets this stack slot used to pass an argument from the perspective of a caller.
-     */
-    public CiStackSlot asOutArg() {
-        assert offset >= 0;
-        if (addFrameSize) {
-            return get(kind, offset, false);
-        }
-        return this;
-    }
-
-    /**
-     * Gets this stack slot used to pass an argument from the perspective of a callee.
-     */
-    public CiStackSlot asInArg() {
-        assert offset >= 0;
-        if (!addFrameSize) {
-            return get(kind, offset, true);
-        }
-        return this;
-    }
-
-
-    private static final int CACHE_GRANULARITY = 8;
-    private static final int SPILL_CACHE_PER_KIND_SIZE = 100;
-    private static final int PARAM_CACHE_PER_KIND_SIZE = 10;
-
-    private static final CiStackSlot[][] SPILL_CACHE = makeCache(SPILL_CACHE_PER_KIND_SIZE, -1, true);
-    private static final CiStackSlot[][] IN_CACHE = makeCache(PARAM_CACHE_PER_KIND_SIZE, 1, true);
-    private static final CiStackSlot[][] OUT_CACHE = makeCache(PARAM_CACHE_PER_KIND_SIZE, 1, false);
-
-    private static CiStackSlot[][] makeCache(int cachePerKindSize, int sign, boolean addFrameSize) {
-        CiStackSlot[][] cache = new CiStackSlot[Kind.VALUES.length][];
-        for (Kind kind : new Kind[] {Illegal, Int, Long, Float, Double, Object, Jsr}) {
-            CiStackSlot[] slots = new CiStackSlot[cachePerKindSize];
-            for (int i = 0; i < cachePerKindSize; i++) {
-                slots[i] = new CiStackSlot(kind, sign * i * CACHE_GRANULARITY, addFrameSize);
-            }
-            cache[kind.ordinal()] = slots;
-        }
-        return cache;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTarget.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +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.graal.api.code;
-
-import com.oracle.graal.api.meta.*;
-
-
-/**
- * Represents the target machine for a compiler, including the CPU architecture, the size of pointers and references,
- * alignment of stacks, caches, etc.
- */
-public class CiTarget {
-    public final CiArchitecture arch;
-
-    /**
-     * The OS page size.
-     */
-    public final int pageSize;
-
-    /**
-     * Specifies if this is a multi-processor system.
-     */
-    public final boolean isMP;
-
-    /**
-     * Specifies if this target supports encoding objects inline in the machine code.
-     */
-    public final boolean inlineObjects;
-
-    /**
-     * The machine word size on this target.
-     */
-    public final int wordSize;
-
-    /**
-     * The CiKind to be used for representing raw pointers and CPU registers.
-     */
-    public final Kind wordKind;
-
-    /**
-     * The stack alignment requirement of the platform. For example,
-     * from Appendix D of <a href="http://www.intel.com/Assets/PDF/manual/248966.pdf">Intel 64 and IA-32 Architectures Optimization Reference Manual</a>:
-     * <pre>
-     *     "It is important to ensure that the stack frame is aligned to a
-     *      16-byte boundary upon function entry to keep local __m128 data,
-     *      parameters, and XMM register spill locations aligned throughout
-     *      a function invocation."
-     * </pre>
-     */
-    public final int stackAlignment;
-
-    /**
-     * @see http://docs.sun.com/app/docs/doc/806-0477/6j9r2e2b9?a=view
-     */
-    public final int stackBias;
-
-    /**
-     * The cache alignment.
-     */
-    public final int cacheAlignment;
-
-    /**
-     * Specifies how {@code long} and {@code double} constants are to be stored
-     * in {@linkplain CiFrame frames}. This is useful for VMs such as HotSpot
-     * where convention the interpreter uses is that the second local
-     * holds the first raw word of the native long or double representation.
-     * This is actually reasonable, since locals and stack arrays
-     * grow downwards in all implementations.
-     * If, on some machine, the interpreter's Java locals or stack
-     * were to grow upwards, the embedded doubles would be word-swapped.)
-     */
-    public final boolean debugInfoDoubleWordsInSecondSlot;
-
-    /**
-     * Temporary flag to distinguish between the semantics necessary for HotSpot and Maxine.
-     */
-    // TODO This should go away when XIR goes away, and the logic be part of the VM-specific lowering.
-    public final boolean invokeSnippetAfterArguments;
-
-    public CiTarget(CiArchitecture arch,
-             boolean isMP,
-             int stackAlignment,
-             int pageSize,
-             int cacheAlignment,
-             boolean inlineObjects,
-             boolean debugInfoDoubleWordsInSecondSlot,
-             boolean invokeSnippetAfterArguments) {
-        this.arch = arch;
-        this.pageSize = pageSize;
-        this.isMP = isMP;
-        this.wordSize = arch.wordSize;
-        if (wordSize == 8) {
-            this.wordKind = Kind.Long;
-        } else {
-            this.wordKind = Kind.Int;
-        }
-        this.stackAlignment = stackAlignment;
-        this.stackBias = 0; // TODO: configure with param once SPARC port exists
-        this.cacheAlignment = cacheAlignment;
-        this.inlineObjects = inlineObjects;
-        this.debugInfoDoubleWordsInSecondSlot = debugInfoDoubleWordsInSecondSlot;
-        this.invokeSnippetAfterArguments = invokeSnippetAfterArguments;
-    }
-
-    /**
-     * Gets the size in bytes of the specified kind for this target.
-     *
-     * @param kind the kind for which to get the size
-     * @return the size in bytes of {@code kind}
-     */
-    public int sizeInBytes(Kind kind) {
-        // Checkstyle: stop
-        switch (kind) {
-            case Boolean: return 1;
-            case Byte: return 1;
-            case Char: return 2;
-            case Short: return 2;
-            case Int: return 4;
-            case Long: return 8;
-            case Float: return 4;
-            case Double: return 8;
-            case Object: return wordSize;
-            case Jsr: return 4;
-            default: return 0;
-        }
-        // Checkstyle: resume
-    }
-
-    /**
-     * Aligns the given frame size (without return instruction pointer) to the stack
-     * alignment size and return the aligned size (without return instruction pointer).
-     * @param frameSize the initial frame size to be aligned
-     * @return the aligned frame size
-     */
-    public int alignFrameSize(int frameSize) {
-        int x = frameSize + arch.returnAddressSize + (stackAlignment - 1);
-        return (x / stackAlignment) * stackAlignment - arch.returnAddressSize;
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiUtil.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,705 +0,0 @@
-/*
- * Copyright (c) 2010, 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.graal.api.code;
-
-import static java.lang.reflect.Modifier.*;
-
-import java.lang.annotation.*;
-import java.util.*;
-
-import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.JavaTypeProfile.*;
-
-/**
- * Miscellaneous collection of utility methods used in the {@code CRI} project.
- */
-public class CiUtil {
-
-    public static final String NEW_LINE = String.format("%n");
-
-    /**
-     * Gets the annotation of a particular type for a formal parameter of a given method.
-     *
-     * @param annotationClass the Class object corresponding to the annotation type
-     * @param parameterIndex the index of a formal parameter of {@code method}
-     * @param method the method for which a parameter annotation is being requested
-     * @return the annotation of type {@code annotationClass} for the formal parameter present, else null
-     * @throws IndexOutOfBoundsException if {@code parameterIndex} does not denote a formal parameter
-     */
-    public static <T extends Annotation> T getParameterAnnotation(Class<T> annotationClass, int parameterIndex, ResolvedJavaMethod method) {
-        if (parameterIndex >= 0) {
-            Annotation[][] parameterAnnotations = method.getParameterAnnotations();
-            for (Annotation a : parameterAnnotations[parameterIndex]) {
-                if (a.annotationType() == annotationClass) {
-                    return annotationClass.cast(a);
-                }
-            }
-        }
-        return null;
-    }
-
-    public static final int K = 1024;
-    public static final int M = 1024 * 1024;
-
-    public static boolean isOdd(int n) {
-        return (n & 1) == 1;
-    }
-
-    public static boolean isEven(int n) {
-        return (n & 1) == 0;
-    }
-
-    /**
-     * Checks whether the specified integer is a power of two.
-     *
-     * @param val the value to check
-     * @return {@code true} if the value is a power of two; {@code false} otherwise
-     */
-    public static boolean isPowerOf2(int val) {
-        return val != 0 && (val & val - 1) == 0;
-    }
-
-    /**
-     * Checks whether the specified long is a power of two.
-     *
-     * @param val the value to check
-     * @return {@code true} if the value is a power of two; {@code false} otherwise
-     */
-    public static boolean isPowerOf2(long val) {
-        return val != 0 && (val & val - 1) == 0;
-    }
-
-    /**
-     * Computes the log (base 2) of the specified integer, rounding down. (E.g {@code log2(8) = 3}, {@code log2(21) = 4}
-     * )
-     *
-     * @param val the value
-     * @return the log base 2 of the value
-     */
-    public static int log2(int val) {
-        assert val > 0 && isPowerOf2(val);
-        return 31 - Integer.numberOfLeadingZeros(val);
-    }
-
-    /**
-     * Computes the log (base 2) of the specified long, rounding down. (E.g {@code log2(8) = 3}, {@code log2(21) = 4})
-     *
-     * @param val the value
-     * @return the log base 2 of the value
-     */
-    public static int log2(long val) {
-        assert val > 0 && isPowerOf2(val);
-        return 63 - Long.numberOfLeadingZeros(val);
-    }
-
-    public static int align(int size, int align) {
-        assert isPowerOf2(align);
-        return (size + align - 1) & ~(align - 1);
-    }
-
-    /**
-     * Gets a word with the nth bit set.
-     *
-     * @param n the nth bit to set
-     * @return an integer value with the nth bit set
-     */
-    public static int nthBit(int n) {
-        return n >= Integer.SIZE ? 0 : 1 << n;
-    }
-
-    /**
-     * Gets a word with the right-most n bits set.
-     *
-     * @param n the number of right most bits to set
-     * @return an integer value with the right-most n bits set
-     */
-    public static int rightNBits(int n) {
-        return nthBit(n) - 1;
-    }
-
-    /**
-     * Gets a string for a given method formatted according to a given format specification. A format specification is
-     * composed of characters that are to be copied verbatim to the result and specifiers that denote an attribute of
-     * the method that is to be copied to the result. A specifier is a single character preceded by a '%' character. The
-     * accepted specifiers and the method attributes they denote are described below:
-     *
-     * <pre>
-     *     Specifier | Description                                          | Example(s)
-     *     ----------+------------------------------------------------------------------------------------------
-     *     'R'       | Qualified return type                                | "int" "java.lang.String"
-     *     'r'       | Unqualified return type                              | "int" "String"
-     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
-     *     'h'       | Unqualified holder                                   | "Entry"
-     *     'n'       | Method name                                          | "add"
-     *     'P'       | Qualified parameter types, separated by ', '         | "int, java.lang.String"
-     *     'p'       | Unqualified parameter types, separated by ', '       | "int, String"
-     *     'f'       | Indicator if method is unresolved, static or virtual | "unresolved" "static" "virtual"
-     *     '%'       | A '%' character                                      | "%"
-     * </pre>
-     *
-     * @param format a format specification
-     * @param method the method to be formatted
-     * @param kinds if {@code true} then the types in {@code method}'s signature are printed in the
-     *            {@linkplain Kind#jniName JNI} form of their {@linkplain Kind kind}
-     * @return the result of formatting this method according to {@code format}
-     * @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
-     */
-    public static String format(String format, JavaMethod method) throws IllegalFormatException {
-        final StringBuilder sb = new StringBuilder();
-        int index = 0;
-        Signature sig = null;
-        while (index < format.length()) {
-            final char ch = format.charAt(index++);
-            if (ch == '%') {
-                if (index >= format.length()) {
-                    throw new UnknownFormatConversionException("An unquoted '%' character cannot terminate a method format specification");
-                }
-                final char specifier = format.charAt(index++);
-                boolean qualified = false;
-                switch (specifier) {
-                    case 'R':
-                        qualified = true;
-                        // fall through
-                    case 'r': {
-                        if (sig == null) {
-                            sig = method.signature();
-                        }
-                        sb.append(MetaUtil.toJavaName(sig.returnType(null), qualified));
-                        break;
-                    }
-                    case 'H':
-                        qualified = true;
-                        // fall through
-                    case 'h': {
-                        sb.append(MetaUtil.toJavaName(method.holder(), qualified));
-                        break;
-                    }
-                    case 'n': {
-                        sb.append(method.name());
-                        break;
-                    }
-                    case 'P':
-                        qualified = true;
-                        // fall through
-                    case 'p': {
-                        if (sig == null) {
-                            sig = method.signature();
-                        }
-                        for (int i = 0; i < sig.argumentCount(false); i++) {
-                            if (i != 0) {
-                                sb.append(", ");
-                            }
-                            sb.append(MetaUtil.toJavaName(sig.argumentTypeAt(i, null), qualified));
-                        }
-                        break;
-                    }
-                    case 'f': {
-                        sb.append(!(method instanceof ResolvedJavaMethod) ? "unresolved" : isStatic(((ResolvedJavaMethod) method).accessFlags()) ? "static" : "virtual");
-                        break;
-                    }
-                    case '%': {
-                        sb.append('%');
-                        break;
-                    }
-                    default: {
-                        throw new UnknownFormatConversionException(String.valueOf(specifier));
-                    }
-                }
-            } else {
-                sb.append(ch);
-            }
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Gets a string for a given field formatted according to a given format specification. A format specification is
-     * composed of characters that are to be copied verbatim to the result and specifiers that denote an attribute of
-     * the field that is to be copied to the result. A specifier is a single character preceded by a '%' character. The
-     * accepted specifiers and the field attributes they denote are described below:
-     *
-     * <pre>
-     *     Specifier | Description                                          | Example(s)
-     *     ----------+------------------------------------------------------------------------------------------
-     *     'T'       | Qualified type                                       | "int" "java.lang.String"
-     *     't'       | Unqualified type                                     | "int" "String"
-     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
-     *     'h'       | Unqualified holder                                   | "Entry"
-     *     'n'       | Field name                                           | "age"
-     *     'f'       | Indicator if field is unresolved, static or instance | "unresolved" "static" "instance"
-     *     '%'       | A '%' character                                      | "%"
-     * </pre>
-     *
-     * @param format a format specification
-     * @param field the field to be formatted
-     * @param kinds if {@code true} then {@code field}'s type is printed in the {@linkplain Kind#jniName JNI} form of
-     *            its {@linkplain Kind kind}
-     * @return the result of formatting this field according to {@code format}
-     * @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
-     */
-    public static String format(String format, JavaField field) throws IllegalFormatException {
-        final StringBuilder sb = new StringBuilder();
-        int index = 0;
-        JavaType type = field.type();
-        while (index < format.length()) {
-            final char ch = format.charAt(index++);
-            if (ch == '%') {
-                if (index >= format.length()) {
-                    throw new UnknownFormatConversionException("An unquoted '%' character cannot terminate a field format specification");
-                }
-                final char specifier = format.charAt(index++);
-                boolean qualified = false;
-                switch (specifier) {
-                    case 'T':
-                        qualified = true;
-                        // fall through
-                    case 't': {
-                        sb.append(MetaUtil.toJavaName(type, qualified));
-                        break;
-                    }
-                    case 'H':
-                        qualified = true;
-                        // fall through
-                    case 'h': {
-                        sb.append(MetaUtil.toJavaName(field.holder(), qualified));
-                        break;
-                    }
-                    case 'n': {
-                        sb.append(field.name());
-                        break;
-                    }
-                    case 'f': {
-                        sb.append(!(field instanceof ResolvedJavaField) ? "unresolved" : isStatic(((ResolvedJavaField) field).accessFlags()) ? "static" : "instance");
-                        break;
-                    }
-                    case '%': {
-                        sb.append('%');
-                        break;
-                    }
-                    default: {
-                        throw new UnknownFormatConversionException(String.valueOf(specifier));
-                    }
-                }
-            } else {
-                sb.append(ch);
-            }
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Converts a Java source-language class name into the internal form.
-     *
-     * @param className the class name
-     * @return the internal name form of the class name
-     */
-    public static String toInternalName(String className) {
-        return "L" + className.replace('.', '/') + ";";
-    }
-
-    /**
-     * Creates a set that uses reference-equality instead of {@link Object#equals(Object)} when comparing values.
-     *
-     * @param <T> the type of elements in the set
-     * @return a set based on reference-equality
-     */
-    public static <T> Set<T> newIdentityHashSet() {
-        return Collections.newSetFromMap(new IdentityHashMap<T, Boolean>());
-    }
-
-    /**
-     * Prepends the String {@code indentation} to every line in String {@code lines}, including a possibly non-empty
-     * line following the final newline.
-     */
-    public static String indent(String lines, String indentation) {
-        if (lines.length() == 0) {
-            return lines;
-        }
-        final String newLine = "\n";
-        if (lines.endsWith(newLine)) {
-            return indentation + (lines.substring(0, lines.length() - 1)).replace(newLine, newLine + indentation) + newLine;
-        }
-        return indentation + lines.replace(newLine, newLine + indentation);
-    }
-
-    /**
-     * Formats the values in a frame as a tabulated string.
-     *
-     * @param frame
-     * @return the values in {@code frame} as a tabulated string
-     */
-    public static String tabulateValues(CiFrame frame) {
-        int cols = Math.max(frame.numLocals, Math.max(frame.numStack, frame.numLocks));
-        assert cols > 0;
-        ArrayList<Object> cells = new ArrayList<>();
-        cells.add("");
-        for (int i = 0; i < cols; i++) {
-            cells.add(i);
-        }
-        cols++;
-        if (frame.numLocals != 0) {
-            cells.add("locals:");
-            cells.addAll(Arrays.asList(frame.values).subList(0, frame.numLocals));
-            cells.addAll(Collections.nCopies(cols - frame.numLocals - 1, ""));
-        }
-        if (frame.numStack != 0) {
-            cells.add("stack:");
-            cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals, frame.numLocals + frame.numStack));
-            cells.addAll(Collections.nCopies(cols - frame.numStack - 1, ""));
-        }
-        if (frame.numLocks != 0) {
-            cells.add("locks:");
-            cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals + frame.numStack, frame.values.length));
-            cells.addAll(Collections.nCopies(cols - frame.numLocks - 1, ""));
-        }
-        Object[] cellArray = cells.toArray();
-        for (int i = 0; i < cellArray.length; i++) {
-            if ((i % cols) != 0) {
-                cellArray[i] = "|" + cellArray[i];
-            }
-        }
-        return CiUtil.tabulate(cellArray, cols, 1, 1);
-    }
-
-    /**
-     * Formats a given table as a string. The value of each cell is produced by {@link String#valueOf(Object)}.
-     *
-     * @param cells the cells of the table in row-major order
-     * @param cols the number of columns per row
-     * @param lpad the number of space padding inserted before each formatted cell value
-     * @param rpad the number of space padding inserted after each formatted cell value
-     * @return a string with one line per row and each column left-aligned
-     */
-    public static String tabulate(Object[] cells, int cols, int lpad, int rpad) {
-        int rows = (cells.length + (cols - 1)) / cols;
-        int[] colWidths = new int[cols];
-        for (int col = 0; col < cols; col++) {
-            for (int row = 0; row < rows; row++) {
-                int index = col + (row * cols);
-                if (index < cells.length) {
-                    Object cell = cells[index];
-                    colWidths[col] = Math.max(colWidths[col], String.valueOf(cell).length());
-                }
-            }
-        }
-        StringBuilder sb = new StringBuilder();
-        String nl = NEW_LINE;
-        for (int row = 0; row < rows; row++) {
-            for (int col = 0; col < cols; col++) {
-                int index = col + (row * cols);
-                if (index < cells.length) {
-                    for (int i = 0; i < lpad; i++) {
-                        sb.append(' ');
-                    }
-                    Object cell = cells[index];
-                    String s = String.valueOf(cell);
-                    int w = s.length();
-                    sb.append(s);
-                    while (w < colWidths[col]) {
-                        sb.append(' ');
-                        w++;
-                    }
-                    for (int i = 0; i < rpad; i++) {
-                        sb.append(' ');
-                    }
-                }
-            }
-            sb.append(nl);
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Convenient shortcut for calling {@link #appendLocation(StringBuilder, JavaMethod, int)} without having to supply a
-     * a {@link StringBuilder} instance and convert the result to a string.
-     */
-    public static String toLocation(ResolvedJavaMethod method, int bci) {
-        return appendLocation(new StringBuilder(), method, bci).toString();
-    }
-
-    /**
-     * Appends a string representation of a location specified by a given method and bci to a given
-     * {@link StringBuilder}. If a stack trace element with a non-null file name and non-negative line number is
-     * {@linkplain JavaMethod#toStackTraceElement(int) available} for the given method, then the string returned is the
-     * {@link StackTraceElement#toString()} value of the stack trace element, suffixed by the bci location. For example:
-     *
-     * <pre>
-     *     java.lang.String.valueOf(String.java:2930) [bci: 12]
-     * </pre>
-     *
-     * Otherwise, the string returned is the value of {@code CiUtil.format("%H.%n(%p)"}, suffixed by the bci location.
-     * For example:
-     *
-     * <pre>
-     *     java.lang.String.valueOf(int) [bci: 12]
-     * </pre>
-     *
-     * @param sb
-     * @param method
-     * @param bci
-     * @return
-     */
-    public static StringBuilder appendLocation(StringBuilder sb, ResolvedJavaMethod method, int bci) {
-        if (method != null) {
-            StackTraceElement ste = method.toStackTraceElement(bci);
-            if (ste.getFileName() != null && ste.getLineNumber() > 0) {
-                sb.append(ste);
-            } else {
-                sb.append(CiUtil.format("%H.%n(%p)", method));
-            }
-        } else {
-            sb.append("Null method");
-        }
-        return sb.append(" [bci: ").append(bci).append(']');
-    }
-
-    /**
-     * Appends a formatted code position to a {@link StringBuilder}.
-     *
-     * @param sb the {@link StringBuilder} to append to
-     * @param pos the code position to format and append to {@code sb}
-     * @return the value of {@code sb}
-     */
-    public static StringBuilder append(StringBuilder sb, CiCodePos pos) {
-        appendLocation(sb.append("at "), pos.method, pos.bci);
-        if (pos.caller != null) {
-            sb.append(NEW_LINE);
-            append(sb, pos.caller);
-        }
-        return sb;
-    }
-
-    /**
-     * Appends a formatted frame to a {@link StringBuilder}.
-     *
-     * @param sb the {@link StringBuilder} to append to
-     * @param frame the frame to format and append to {@code sb}
-     * @return the value of {@code sb}
-     */
-    public static StringBuilder append(StringBuilder sb, CiFrame frame) {
-        appendLocation(sb.append("at "), frame.method, frame.bci);
-        if (frame.values != null && frame.values.length > 0) {
-            sb.append(NEW_LINE);
-            String table = tabulateValues(frame);
-            String[] rows = table.split(NEW_LINE);
-            for (int i = 0; i < rows.length; i++) {
-                String row = rows[i];
-                if (!row.trim().isEmpty()) {
-                    sb.append("  ").append(row);
-                    if (i != rows.length - 1) {
-                        sb.append(NEW_LINE);
-                    }
-                }
-            }
-        }
-        if (frame.caller() != null) {
-            sb.append(NEW_LINE);
-            append(sb, frame.caller());
-        } else if (frame.caller != null) {
-            sb.append(NEW_LINE);
-            append(sb, frame.caller);
-        }
-        return sb;
-    }
-
-    /**
-     * Formats a location present in a register or frame reference map.
-     */
-    public static class RefMapFormatter {
-
-        /**
-         * The size of a stack slot.
-         */
-        public final int slotSize;
-
-        /**
-         * The register used as the frame pointer.
-         */
-        public final CiRegister fp;
-
-        public final CiArchitecture arch;
-
-        /**
-         * The offset (in bytes) from the slot pointed to by {@link #fp} to the slot corresponding to bit 0 in the frame
-         * reference map.
-         */
-        public final int refMapToFPOffset;
-
-        public RefMapFormatter(CiArchitecture arch, int slotSize, CiRegister fp, int refMapToFPOffset) {
-            this.arch = arch;
-            this.slotSize = slotSize;
-            this.fp = fp;
-            this.refMapToFPOffset = refMapToFPOffset;
-        }
-
-        public String formatStackSlot(int frameRefMapIndex) {
-            int refMapOffset = frameRefMapIndex * slotSize;
-            int fpOffset = refMapOffset + refMapToFPOffset;
-            if (fpOffset >= 0) {
-                return fp + "+" + fpOffset;
-            }
-            return fp.name + fpOffset;
-        }
-
-        public String formatRegister(int regRefMapIndex) {
-            return arch.registers[regRefMapIndex].toString();
-        }
-    }
-
-    /**
-     * Appends a formatted debug info to a {@link StringBuilder}.
-     *
-     * @param sb the {@link StringBuilder} to append to
-     * @param info the debug info to format and append to {@code sb}
-     * @return the value of {@code sb}
-     */
-    public static StringBuilder append(StringBuilder sb, CiDebugInfo info, RefMapFormatter formatter) {
-        String nl = NEW_LINE;
-        if (info.hasRegisterRefMap()) {
-            sb.append("  reg-ref-map:");
-            BitSet bm = info.registerRefMap;
-            if (formatter != null) {
-                for (int reg = bm.nextSetBit(0); reg >= 0; reg = bm.nextSetBit(reg + 1)) {
-                    sb.append(" " + formatter.formatRegister(reg));
-                }
-            }
-            sb.append(' ').append(bm).append(nl);
-        }
-        if (info.hasStackRefMap()) {
-            sb.append("frame-ref-map:");
-            BitSet bm = info.frameRefMap;
-            if (formatter != null) {
-                for (int i = bm.nextSetBit(0); i >= 0; i = bm.nextSetBit(i + 1)) {
-                    sb.append(" " + formatter.formatStackSlot(i));
-                }
-            }
-            sb.append(' ').append(bm).append(nl);
-        }
-        CiFrame frame = info.frame();
-        if (frame != null) {
-            append(sb, frame);
-        } else if (info.codePos != null) {
-            append(sb, info.codePos);
-        }
-        return sb;
-    }
-
-    public static Kind[] signatureToKinds(ResolvedJavaMethod method) {
-        Kind receiver = isStatic(method.accessFlags()) ? null : method.holder().kind();
-        return signatureToKinds(method.signature(), receiver);
-    }
-
-    public static Kind[] signatureToKinds(Signature signature, Kind receiverKind) {
-        int args = signature.argumentCount(false);
-        Kind[] result;
-        int i = 0;
-        if (receiverKind != null) {
-            result = new Kind[args + 1];
-            result[0] = receiverKind;
-            i = 1;
-        } else {
-            result = new Kind[args];
-        }
-        for (int j = 0; j < args; j++) {
-            result[i + j] = signature.argumentKindAt(j);
-        }
-        return result;
-    }
-
-    public static Class< ? >[] signatureToTypes(Signature signature, ResolvedJavaType accessingClass) {
-        int count = signature.argumentCount(false);
-        Class< ? >[] result = new Class< ? >[count];
-        for (int i = 0; i < result.length; ++i) {
-            result[i] = signature.argumentTypeAt(i, accessingClass).resolve(accessingClass).toJava();
-        }
-        return result;
-    }
-
-    /**
-     * Formats some profiling information associated as a string.
-     *
-     * @param info the profiling info to format
-     * @param method an optional method that augments the profile string returned
-     * @param sep the separator to use for each separate profile record
-     */
-    public static String profileToString(ProfilingInfo info, ResolvedJavaMethod method, String sep) {
-        StringBuilder buf = new StringBuilder(100);
-        if (method != null) {
-            buf.append(String.format("canBeStaticallyBound: %b%s", method.canBeStaticallyBound(), sep)).
-            append(String.format("invocationCount: %d%s", method.invocationCount(), sep));
-        }
-        for (int i = 0; i < info.codeSize(); i++) {
-            if (info.getExecutionCount(i) != -1) {
-                buf.append(String.format("executionCount@%d: %d%s", i, info.getExecutionCount(i), sep));
-            }
-
-            if (info.getBranchTakenProbability(i) != -1) {
-                buf.append(String.format("branchProbability@%d: %.3f%s", i, info.getBranchTakenProbability(i), sep));
-            }
-
-            double[] switchProbabilities = info.getSwitchProbabilities(i);
-            if (switchProbabilities != null) {
-                buf.append(String.format("switchProbabilities@%d:", i));
-                for (int j = 0; j < switchProbabilities.length; j++) {
-                    buf.append(String.format(" %.3f", switchProbabilities[j]));
-                }
-                buf.append(sep);
-            }
-
-            if (info.getExceptionSeen(i) != ExceptionSeen.FALSE) {
-                buf.append(String.format("exceptionSeen@%d: %s%s", i, info.getExceptionSeen(i).name(), sep));
-            }
-
-            JavaTypeProfile typeProfile = info.getTypeProfile(i);
-            if (typeProfile != null) {
-                ProfiledType[] ptypes = typeProfile.getTypes();
-                if (ptypes != null) {
-                    buf.append(String.format("types@%d:", i));
-                    for (int j = 0; j < ptypes.length; j++) {
-                        ProfiledType ptype = ptypes[j];
-                        buf.append(String.format(" %.3f (%s)%s", ptype.probability, ptype.type, sep));
-                    }
-                    buf.append(String.format(" %.3f <not recorded>%s", typeProfile.getNotRecordedProbability(), sep));
-                }
-            }
-        }
-
-        boolean firstDeoptReason = true;
-        for (DeoptimizationReason reason: DeoptimizationReason.values()) {
-            int count = info.getDeoptimizationCount(reason);
-            if (count > 0) {
-                if (firstDeoptReason) {
-                    buf.append("deoptimization history").append(sep);
-                    firstDeoptReason = false;
-                }
-                buf.append(String.format(" %s: %d%s", reason.name(), count, sep));
-            }
-        }
-        if (buf.length() == 0) {
-            return "";
-        }
-        String s = buf.toString();
-        assert s.endsWith(sep);
-        return s.substring(0, s.length() - sep.length());
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiValueUtil.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * 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.graal.api.code;
-
-import com.oracle.graal.api.meta.*;
-
-public class CiValueUtil {
-    public static boolean isIllegal(Value value) {
-        assert value != null;
-        return value == Value.IllegalValue;
-    }
-
-    public static boolean isLegal(Value value) {
-        return !isIllegal(value);
-    }
-
-    public static boolean isVirtualObject(Value value) {
-        assert value != null;
-        return value instanceof CiVirtualObject;
-    }
-
-    public static CiVirtualObject asVirtualObject(Value value) {
-        assert value != null;
-        return (CiVirtualObject) value;
-    }
-
-    public static boolean isConstant(Value value) {
-        assert value != null;
-        return value instanceof Constant;
-    }
-
-    public static Constant asConstant(Value value) {
-        assert value != null;
-        return (Constant) value;
-    }
-
-
-    public static boolean isStackSlot(Value value) {
-        assert value != null;
-        return value instanceof CiStackSlot;
-    }
-
-    public static CiStackSlot asStackSlot(Value value) {
-        assert value != null;
-        return (CiStackSlot) value;
-    }
-
-    public static boolean isAddress(Value value) {
-        assert value != null;
-        return value instanceof CiAddress;
-    }
-
-    public static CiAddress asAddress(Value value) {
-        assert value != null;
-        return (CiAddress) value;
-    }
-
-
-    public static boolean isRegister(Value value) {
-        assert value != null;
-        return value instanceof CiRegisterValue;
-    }
-
-    public static CiRegister asRegister(Value value) {
-        assert value != null;
-        return ((CiRegisterValue) value).reg;
-    }
-
-    public static CiRegister asIntReg(Value value) {
-        assert value.kind == Kind.Int || value.kind == Kind.Jsr;
-        return asRegister(value);
-    }
-
-    public static CiRegister asLongReg(Value value) {
-        assert value.kind == Kind.Long : value.kind;
-        return asRegister(value);
-    }
-
-    public static CiRegister asObjectReg(Value value) {
-        assert value.kind == Kind.Object;
-        return asRegister(value);
-    }
-
-    public static CiRegister asFloatReg(Value value) {
-        assert value.kind == Kind.Float;
-        return asRegister(value);
-    }
-
-    public static CiRegister asDoubleReg(Value value) {
-        assert value.kind == Kind.Double;
-        return asRegister(value);
-    }
-
-
-    public static boolean sameRegister(Value v1, Value v2) {
-        return isRegister(v1) && isRegister(v2) && asRegister(v1) == asRegister(v2);
-    }
-
-    public static boolean sameRegister(Value v1, Value v2, Value v3) {
-        return sameRegister(v1, v2) && sameRegister(v1, v3);
-    }
-
-    public static boolean differentRegisters(Value v1, Value v2) {
-        return !isRegister(v1) || !isRegister(v2) || asRegister(v1) != asRegister(v2);
-    }
-
-    public static boolean differentRegisters(Value v1, Value v2, Value v3) {
-        return differentRegisters(v1, v2) && differentRegisters(v1, v3) && differentRegisters(v2, v3);
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2010, 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.graal.api.code;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * An instance of this class represents an object whose allocation was removed by escape analysis. The information stored in the {@link CiVirtualObject} is used during
- * deoptimization to recreate the object.
- */
-public final class CiVirtualObject extends Value {
-    private static final long serialVersionUID = -2907197776426346021L;
-
-    private final JavaType type;
-    private Value[] values;
-    private final int id;
-
-    /**
-     * Creates a new CiVirtualObject for the given type, with the given fields. If the type is an instance class then the values array needs to have one entry for each field, ordered in
-     * like the fields returned by {@link ResolvedJavaType#declaredFields()}. If the type is an array then the length of the values array determines the reallocated array length.
-     * @param type the type of the object whose allocation was removed during compilation. This can be either an instance of an array type.
-     * @param values an array containing all the values to be stored into the object when it is recreated.
-     * @param id a unique id that identifies the object within the debug information for one position in the compiled code.
-     * @return a new CiVirtualObject instance.
-     */
-    public static CiVirtualObject get(JavaType type, Value[] values, int id) {
-        return new CiVirtualObject(type, values, id);
-    }
-
-    private CiVirtualObject(JavaType type, Value[] values, int id) {
-        super(Kind.Object);
-        this.type = type;
-        this.values = values;
-        this.id = id;
-    }
-
-    @Override
-    public String toString() {
-        return "vobject:" + id;
-    }
-
-    /**
-     * @return the type of the object whose allocation was removed during compilation. This can be either an instance of an array type.
-     */
-    public JavaType type() {
-        return type;
-    }
-
-    /**
-     * @return an array containing all the values to be stored into the object when it is recreated.
-     */
-    public Value[] values() {
-        return values;
-    }
-
-    /**
-     * @return the unique id that identifies the object within the debug information for one position in the compiled code.
-     */
-    public int id() {
-        return id;
-    }
-
-    /**
-     * Overwrites the current set of values with a new one.
-     * @param values an array containing all the values to be stored into the object when it is recreated.
-     */
-    public void setValues(Value[] values) {
-        this.values = values;
-    }
-
-    @Override
-    public int hashCode() {
-        return kind.ordinal() + type.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (o instanceof CiVirtualObject) {
-            CiVirtualObject l = (CiVirtualObject) o;
-            if (l.type != type || l.values.length != values.length) {
-                return false;
-            }
-            for (int i = 0; i < values.length; i++) {
-                if (values[i] != l.values[i]) {
-                    return false;
-                }
-            }
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * This is a helper class used to create virtual objects for a number of different JDK classes.
-     */
-    public static class CiVirtualObjectFactory {
-        private int nextId = 0;
-        private final CodeCacheProvider runtime;
-
-        public CiVirtualObjectFactory(CodeCacheProvider runtime) {
-            this.runtime = runtime;
-        }
-
-        public CiVirtualObject constantProxy(Kind kind, Value objectValue, Value primitiveValue) {
-            Constant cKind = Constant.forObject(kind);
-            // TODO: here the ordering is hard coded... we should query RiType.fields() and act accordingly
-            return new CiVirtualObject(runtime.getResolvedJavaType(Constant.class), new Value[] {cKind, primitiveValue, Value.IllegalValue, objectValue}, nextId++);
-        }
-
-        public Value proxy(Value ciValue) {
-            switch (ciValue.kind) {
-                case Boolean:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Boolean.class), new Value[] {ciValue}, nextId++);
-                case Byte:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Byte.class), new Value[] {ciValue}, nextId++);
-                case Char:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Character.class), new Value[] {ciValue}, nextId++);
-                case Double:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Double.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
-                case Float:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Float.class), new Value[] {ciValue}, nextId++);
-                case Int:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Integer.class), new Value[] {ciValue}, nextId++);
-                case Long:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Long.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
-                case Object:
-                    return ciValue;
-                case Short:
-                    return new CiVirtualObject(runtime.getResolvedJavaType(Short.class), new Value[] {ciValue}, nextId++);
-                default:
-                    assert false : ciValue.kind;
-                    return null;
-            }
-        }
-
-        public CiVirtualObject arrayProxy(JavaType arrayType, Value[] values) {
-            return new CiVirtualObject(arrayType, values, nextId++);
-        }
-
-    }
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Sat Jun 09 20:10:05 2012 +0200
@@ -56,9 +56,9 @@
      *
      * @param method the top level method of a compilation
      */
-    CiRegisterConfig getRegisterConfig(JavaMethod method);
+    RegisterConfig getRegisterConfig(JavaMethod method);
 
-    CiRegisterConfig getGlobalStubRegisterConfig();
+    RegisterConfig getGlobalStubRegisterConfig();
 
     /**
      * Custom area on the stack of each compiled method that the VM can use for its own purposes.
@@ -82,7 +82,7 @@
      * Returns the maximum absolute offset of a runtime call target from any position in the code cache or -1
      * when not known or not applicable. Intended for determining the required size of address/offset fields.
      */
-    long getMaxCallTargetOffset(CiRuntimeCall rtcall);
+    long getMaxCallTargetOffset(RuntimeCall rtcall);
 
     /**
      * Adds the given machine code as an implementation of the given method without making it the default implementation.
@@ -98,7 +98,7 @@
      * Encodes a deoptimization action and a deoptimization reason in an integer value.
      * @return the encoded value as an integer
      */
-    int encodeDeoptActionAndReason(CiDeoptAction action, DeoptimizationReason reason);
+    int encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason);
 
     /**
      * Converts a RiDeoptReason into an integer value.
@@ -110,5 +110,5 @@
      * Converts a RiDeoptAction into an integer value.
      * @return An integer value representing the given RiDeoptAction.
      */
-    int convertDeoptAction(CiDeoptAction action);
+    int convertDeoptAction(DeoptimizationAction action);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,705 @@
+/*
+ * Copyright (c) 2010, 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.graal.api.code;
+
+import static java.lang.reflect.Modifier.*;
+
+import java.lang.annotation.*;
+import java.util.*;
+
+import com.oracle.graal.api.meta.*;
+import com.oracle.graal.api.meta.JavaTypeProfile.*;
+
+/**
+ * Miscellaneous collection of utility methods used in the {@code CRI} project.
+ */
+public class CodeUtil {
+
+    public static final String NEW_LINE = String.format("%n");
+
+    /**
+     * Gets the annotation of a particular type for a formal parameter of a given method.
+     *
+     * @param annotationClass the Class object corresponding to the annotation type
+     * @param parameterIndex the index of a formal parameter of {@code method}
+     * @param method the method for which a parameter annotation is being requested
+     * @return the annotation of type {@code annotationClass} for the formal parameter present, else null
+     * @throws IndexOutOfBoundsException if {@code parameterIndex} does not denote a formal parameter
+     */
+    public static <T extends Annotation> T getParameterAnnotation(Class<T> annotationClass, int parameterIndex, ResolvedJavaMethod method) {
+        if (parameterIndex >= 0) {
+            Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+            for (Annotation a : parameterAnnotations[parameterIndex]) {
+                if (a.annotationType() == annotationClass) {
+                    return annotationClass.cast(a);
+                }
+            }
+        }
+        return null;
+    }
+
+    public static final int K = 1024;
+    public static final int M = 1024 * 1024;
+
+    public static boolean isOdd(int n) {
+        return (n & 1) == 1;
+    }
+
+    public static boolean isEven(int n) {
+        return (n & 1) == 0;
+    }
+
+    /**
+     * Checks whether the specified integer is a power of two.
+     *
+     * @param val the value to check
+     * @return {@code true} if the value is a power of two; {@code false} otherwise
+     */
+    public static boolean isPowerOf2(int val) {
+        return val != 0 && (val & val - 1) == 0;
+    }
+
+    /**
+     * Checks whether the specified long is a power of two.
+     *
+     * @param val the value to check
+     * @return {@code true} if the value is a power of two; {@code false} otherwise
+     */
+    public static boolean isPowerOf2(long val) {
+        return val != 0 && (val & val - 1) == 0;
+    }
+
+    /**
+     * Computes the log (base 2) of the specified integer, rounding down. (E.g {@code log2(8) = 3}, {@code log2(21) = 4}
+     * )
+     *
+     * @param val the value
+     * @return the log base 2 of the value
+     */
+    public static int log2(int val) {
+        assert val > 0 && isPowerOf2(val);
+        return 31 - Integer.numberOfLeadingZeros(val);
+    }
+
+    /**
+     * Computes the log (base 2) of the specified long, rounding down. (E.g {@code log2(8) = 3}, {@code log2(21) = 4})
+     *
+     * @param val the value
+     * @return the log base 2 of the value
+     */
+    public static int log2(long val) {
+        assert val > 0 && isPowerOf2(val);
+        return 63 - Long.numberOfLeadingZeros(val);
+    }
+
+    public static int align(int size, int align) {
+        assert isPowerOf2(align);
+        return (size + align - 1) & ~(align - 1);
+    }
+
+    /**
+     * Gets a word with the nth bit set.
+     *
+     * @param n the nth bit to set
+     * @return an integer value with the nth bit set
+     */
+    public static int nthBit(int n) {
+        return n >= Integer.SIZE ? 0 : 1 << n;
+    }
+
+    /**
+     * Gets a word with the right-most n bits set.
+     *
+     * @param n the number of right most bits to set
+     * @return an integer value with the right-most n bits set
+     */
+    public static int rightNBits(int n) {
+        return nthBit(n) - 1;
+    }
+
+    /**
+     * Gets a string for a given method formatted according to a given format specification. A format specification is
+     * composed of characters that are to be copied verbatim to the result and specifiers that denote an attribute of
+     * the method that is to be copied to the result. A specifier is a single character preceded by a '%' character. The
+     * accepted specifiers and the method attributes they denote are described below:
+     *
+     * <pre>
+     *     Specifier | Description                                          | Example(s)
+     *     ----------+------------------------------------------------------------------------------------------
+     *     'R'       | Qualified return type                                | "int" "java.lang.String"
+     *     'r'       | Unqualified return type                              | "int" "String"
+     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
+     *     'h'       | Unqualified holder                                   | "Entry"
+     *     'n'       | Method name                                          | "add"
+     *     'P'       | Qualified parameter types, separated by ', '         | "int, java.lang.String"
+     *     'p'       | Unqualified parameter types, separated by ', '       | "int, String"
+     *     'f'       | Indicator if method is unresolved, static or virtual | "unresolved" "static" "virtual"
+     *     '%'       | A '%' character                                      | "%"
+     * </pre>
+     *
+     * @param format a format specification
+     * @param method the method to be formatted
+     * @param kinds if {@code true} then the types in {@code method}'s signature are printed in the
+     *            {@linkplain Kind#jniName JNI} form of their {@linkplain Kind kind}
+     * @return the result of formatting this method according to {@code format}
+     * @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
+     */
+    public static String format(String format, JavaMethod method) throws IllegalFormatException {
+        final StringBuilder sb = new StringBuilder();
+        int index = 0;
+        Signature sig = null;
+        while (index < format.length()) {
+            final char ch = format.charAt(index++);
+            if (ch == '%') {
+                if (index >= format.length()) {
+                    throw new UnknownFormatConversionException("An unquoted '%' character cannot terminate a method format specification");
+                }
+                final char specifier = format.charAt(index++);
+                boolean qualified = false;
+                switch (specifier) {
+                    case 'R':
+                        qualified = true;
+                        // fall through
+                    case 'r': {
+                        if (sig == null) {
+                            sig = method.signature();
+                        }
+                        sb.append(MetaUtil.toJavaName(sig.returnType(null), qualified));
+                        break;
+                    }
+                    case 'H':
+                        qualified = true;
+                        // fall through
+                    case 'h': {
+                        sb.append(MetaUtil.toJavaName(method.holder(), qualified));
+                        break;
+                    }
+                    case 'n': {
+                        sb.append(method.name());
+                        break;
+                    }
+                    case 'P':
+                        qualified = true;
+                        // fall through
+                    case 'p': {
+                        if (sig == null) {
+                            sig = method.signature();
+                        }
+                        for (int i = 0; i < sig.argumentCount(false); i++) {
+                            if (i != 0) {
+                                sb.append(", ");
+                            }
+                            sb.append(MetaUtil.toJavaName(sig.argumentTypeAt(i, null), qualified));
+                        }
+                        break;
+                    }
+                    case 'f': {
+                        sb.append(!(method instanceof ResolvedJavaMethod) ? "unresolved" : isStatic(((ResolvedJavaMethod) method).accessFlags()) ? "static" : "virtual");
+                        break;
+                    }
+                    case '%': {
+                        sb.append('%');
+                        break;
+                    }
+                    default: {
+                        throw new UnknownFormatConversionException(String.valueOf(specifier));
+                    }
+                }
+            } else {
+                sb.append(ch);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Gets a string for a given field formatted according to a given format specification. A format specification is
+     * composed of characters that are to be copied verbatim to the result and specifiers that denote an attribute of
+     * the field that is to be copied to the result. A specifier is a single character preceded by a '%' character. The
+     * accepted specifiers and the field attributes they denote are described below:
+     *
+     * <pre>
+     *     Specifier | Description                                          | Example(s)
+     *     ----------+------------------------------------------------------------------------------------------
+     *     'T'       | Qualified type                                       | "int" "java.lang.String"
+     *     't'       | Unqualified type                                     | "int" "String"
+     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
+     *     'h'       | Unqualified holder                                   | "Entry"
+     *     'n'       | Field name                                           | "age"
+     *     'f'       | Indicator if field is unresolved, static or instance | "unresolved" "static" "instance"
+     *     '%'       | A '%' character                                      | "%"
+     * </pre>
+     *
+     * @param format a format specification
+     * @param field the field to be formatted
+     * @param kinds if {@code true} then {@code field}'s type is printed in the {@linkplain Kind#jniName JNI} form of
+     *            its {@linkplain Kind kind}
+     * @return the result of formatting this field according to {@code format}
+     * @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
+     */
+    public static String format(String format, JavaField field) throws IllegalFormatException {
+        final StringBuilder sb = new StringBuilder();
+        int index = 0;
+        JavaType type = field.type();
+        while (index < format.length()) {
+            final char ch = format.charAt(index++);
+            if (ch == '%') {
+                if (index >= format.length()) {
+                    throw new UnknownFormatConversionException("An unquoted '%' character cannot terminate a field format specification");
+                }
+                final char specifier = format.charAt(index++);
+                boolean qualified = false;
+                switch (specifier) {
+                    case 'T':
+                        qualified = true;
+                        // fall through
+                    case 't': {
+                        sb.append(MetaUtil.toJavaName(type, qualified));
+                        break;
+                    }
+                    case 'H':
+                        qualified = true;
+                        // fall through
+                    case 'h': {
+                        sb.append(MetaUtil.toJavaName(field.holder(), qualified));
+                        break;
+                    }
+                    case 'n': {
+                        sb.append(field.name());
+                        break;
+                    }
+                    case 'f': {
+                        sb.append(!(field instanceof ResolvedJavaField) ? "unresolved" : isStatic(((ResolvedJavaField) field).accessFlags()) ? "static" : "instance");
+                        break;
+                    }
+                    case '%': {
+                        sb.append('%');
+                        break;
+                    }
+                    default: {
+                        throw new UnknownFormatConversionException(String.valueOf(specifier));
+                    }
+                }
+            } else {
+                sb.append(ch);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Converts a Java source-language class name into the internal form.
+     *
+     * @param className the class name
+     * @return the internal name form of the class name
+     */
+    public static String toInternalName(String className) {
+        return "L" + className.replace('.', '/') + ";";
+    }
+
+    /**
+     * Creates a set that uses reference-equality instead of {@link Object#equals(Object)} when comparing values.
+     *
+     * @param <T> the type of elements in the set
+     * @return a set based on reference-equality
+     */
+    public static <T> Set<T> newIdentityHashSet() {
+        return Collections.newSetFromMap(new IdentityHashMap<T, Boolean>());
+    }
+
+    /**
+     * Prepends the String {@code indentation} to every line in String {@code lines}, including a possibly non-empty
+     * line following the final newline.
+     */
+    public static String indent(String lines, String indentation) {
+        if (lines.length() == 0) {
+            return lines;
+        }
+        final String newLine = "\n";
+        if (lines.endsWith(newLine)) {
+            return indentation + (lines.substring(0, lines.length() - 1)).replace(newLine, newLine + indentation) + newLine;
+        }
+        return indentation + lines.replace(newLine, newLine + indentation);
+    }
+
+    /**
+     * Formats the values in a frame as a tabulated string.
+     *
+     * @param frame
+     * @return the values in {@code frame} as a tabulated string
+     */
+    public static String tabulateValues(BytecodeFrame frame) {
+        int cols = Math.max(frame.numLocals, Math.max(frame.numStack, frame.numLocks));
+        assert cols > 0;
+        ArrayList<Object> cells = new ArrayList<>();
+        cells.add("");
+        for (int i = 0; i < cols; i++) {
+            cells.add(i);
+        }
+        cols++;
+        if (frame.numLocals != 0) {
+            cells.add("locals:");
+            cells.addAll(Arrays.asList(frame.values).subList(0, frame.numLocals));
+            cells.addAll(Collections.nCopies(cols - frame.numLocals - 1, ""));
+        }
+        if (frame.numStack != 0) {
+            cells.add("stack:");
+            cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals, frame.numLocals + frame.numStack));
+            cells.addAll(Collections.nCopies(cols - frame.numStack - 1, ""));
+        }
+        if (frame.numLocks != 0) {
+            cells.add("locks:");
+            cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals + frame.numStack, frame.values.length));
+            cells.addAll(Collections.nCopies(cols - frame.numLocks - 1, ""));
+        }
+        Object[] cellArray = cells.toArray();
+        for (int i = 0; i < cellArray.length; i++) {
+            if ((i % cols) != 0) {
+                cellArray[i] = "|" + cellArray[i];
+            }
+        }
+        return CodeUtil.tabulate(cellArray, cols, 1, 1);
+    }
+
+    /**
+     * Formats a given table as a string. The value of each cell is produced by {@link String#valueOf(Object)}.
+     *
+     * @param cells the cells of the table in row-major order
+     * @param cols the number of columns per row
+     * @param lpad the number of space padding inserted before each formatted cell value
+     * @param rpad the number of space padding inserted after each formatted cell value
+     * @return a string with one line per row and each column left-aligned
+     */
+    public static String tabulate(Object[] cells, int cols, int lpad, int rpad) {
+        int rows = (cells.length + (cols - 1)) / cols;
+        int[] colWidths = new int[cols];
+        for (int col = 0; col < cols; col++) {
+            for (int row = 0; row < rows; row++) {
+                int index = col + (row * cols);
+                if (index < cells.length) {
+                    Object cell = cells[index];
+                    colWidths[col] = Math.max(colWidths[col], String.valueOf(cell).length());
+                }
+            }
+        }
+        StringBuilder sb = new StringBuilder();
+        String nl = NEW_LINE;
+        for (int row = 0; row < rows; row++) {
+            for (int col = 0; col < cols; col++) {
+                int index = col + (row * cols);
+                if (index < cells.length) {
+                    for (int i = 0; i < lpad; i++) {
+                        sb.append(' ');
+                    }
+                    Object cell = cells[index];
+                    String s = String.valueOf(cell);
+                    int w = s.length();
+                    sb.append(s);
+                    while (w < colWidths[col]) {
+                        sb.append(' ');
+                        w++;
+                    }
+                    for (int i = 0; i < rpad; i++) {
+                        sb.append(' ');
+                    }
+                }
+            }
+            sb.append(nl);
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Convenient shortcut for calling {@link #appendLocation(StringBuilder, JavaMethod, int)} without having to supply a
+     * a {@link StringBuilder} instance and convert the result to a string.
+     */
+    public static String toLocation(ResolvedJavaMethod method, int bci) {
+        return appendLocation(new StringBuilder(), method, bci).toString();
+    }
+
+    /**
+     * Appends a string representation of a location specified by a given method and bci to a given
+     * {@link StringBuilder}. If a stack trace element with a non-null file name and non-negative line number is
+     * {@linkplain JavaMethod#toStackTraceElement(int) available} for the given method, then the string returned is the
+     * {@link StackTraceElement#toString()} value of the stack trace element, suffixed by the bci location. For example:
+     *
+     * <pre>
+     *     java.lang.String.valueOf(String.java:2930) [bci: 12]
+     * </pre>
+     *
+     * Otherwise, the string returned is the value of {@code CiUtil.format("%H.%n(%p)"}, suffixed by the bci location.
+     * For example:
+     *
+     * <pre>
+     *     java.lang.String.valueOf(int) [bci: 12]
+     * </pre>
+     *
+     * @param sb
+     * @param method
+     * @param bci
+     * @return
+     */
+    public static StringBuilder appendLocation(StringBuilder sb, ResolvedJavaMethod method, int bci) {
+        if (method != null) {
+            StackTraceElement ste = method.toStackTraceElement(bci);
+            if (ste.getFileName() != null && ste.getLineNumber() > 0) {
+                sb.append(ste);
+            } else {
+                sb.append(CodeUtil.format("%H.%n(%p)", method));
+            }
+        } else {
+            sb.append("Null method");
+        }
+        return sb.append(" [bci: ").append(bci).append(']');
+    }
+
+    /**
+     * Appends a formatted code position to a {@link StringBuilder}.
+     *
+     * @param sb the {@link StringBuilder} to append to
+     * @param pos the code position to format and append to {@code sb}
+     * @return the value of {@code sb}
+     */
+    public static StringBuilder append(StringBuilder sb, BytecodePosition pos) {
+        appendLocation(sb.append("at "), pos.method, pos.bci);
+        if (pos.caller != null) {
+            sb.append(NEW_LINE);
+            append(sb, pos.caller);
+        }
+        return sb;
+    }
+
+    /**
+     * Appends a formatted frame to a {@link StringBuilder}.
+     *
+     * @param sb the {@link StringBuilder} to append to
+     * @param frame the frame to format and append to {@code sb}
+     * @return the value of {@code sb}
+     */
+    public static StringBuilder append(StringBuilder sb, BytecodeFrame frame) {
+        appendLocation(sb.append("at "), frame.method, frame.bci);
+        if (frame.values != null && frame.values.length > 0) {
+            sb.append(NEW_LINE);
+            String table = tabulateValues(frame);
+            String[] rows = table.split(NEW_LINE);
+            for (int i = 0; i < rows.length; i++) {
+                String row = rows[i];
+                if (!row.trim().isEmpty()) {
+                    sb.append("  ").append(row);
+                    if (i != rows.length - 1) {
+                        sb.append(NEW_LINE);
+                    }
+                }
+            }
+        }
+        if (frame.caller() != null) {
+            sb.append(NEW_LINE);
+            append(sb, frame.caller());
+        } else if (frame.caller != null) {
+            sb.append(NEW_LINE);
+            append(sb, frame.caller);
+        }
+        return sb;
+    }
+
+    /**
+     * Formats a location present in a register or frame reference map.
+     */
+    public static class RefMapFormatter {
+
+        /**
+         * The size of a stack slot.
+         */
+        public final int slotSize;
+
+        /**
+         * The register used as the frame pointer.
+         */
+        public final Register fp;
+
+        public final Architecture arch;
+
+        /**
+         * The offset (in bytes) from the slot pointed to by {@link #fp} to the slot corresponding to bit 0 in the frame
+         * reference map.
+         */
+        public final int refMapToFPOffset;
+
+        public RefMapFormatter(Architecture arch, int slotSize, Register fp, int refMapToFPOffset) {
+            this.arch = arch;
+            this.slotSize = slotSize;
+            this.fp = fp;
+            this.refMapToFPOffset = refMapToFPOffset;
+        }
+
+        public String formatStackSlot(int frameRefMapIndex) {
+            int refMapOffset = frameRefMapIndex * slotSize;
+            int fpOffset = refMapOffset + refMapToFPOffset;
+            if (fpOffset >= 0) {
+                return fp + "+" + fpOffset;
+            }
+            return fp.name + fpOffset;
+        }
+
+        public String formatRegister(int regRefMapIndex) {
+            return arch.registers[regRefMapIndex].toString();
+        }
+    }
+
+    /**
+     * Appends a formatted debug info to a {@link StringBuilder}.
+     *
+     * @param sb the {@link StringBuilder} to append to
+     * @param info the debug info to format and append to {@code sb}
+     * @return the value of {@code sb}
+     */
+    public static StringBuilder append(StringBuilder sb, DebugInfo info, RefMapFormatter formatter) {
+        String nl = NEW_LINE;
+        if (info.hasRegisterRefMap()) {
+            sb.append("  reg-ref-map:");
+            BitSet bm = info.registerRefMap;
+            if (formatter != null) {
+                for (int reg = bm.nextSetBit(0); reg >= 0; reg = bm.nextSetBit(reg + 1)) {
+                    sb.append(" " + formatter.formatRegister(reg));
+                }
+            }
+            sb.append(' ').append(bm).append(nl);
+        }
+        if (info.hasStackRefMap()) {
+            sb.append("frame-ref-map:");
+            BitSet bm = info.frameRefMap;
+            if (formatter != null) {
+                for (int i = bm.nextSetBit(0); i >= 0; i = bm.nextSetBit(i + 1)) {
+                    sb.append(" " + formatter.formatStackSlot(i));
+                }
+            }
+            sb.append(' ').append(bm).append(nl);
+        }
+        BytecodeFrame frame = info.frame();
+        if (frame != null) {
+            append(sb, frame);
+        } else if (info.codePos != null) {
+            append(sb, info.codePos);
+        }
+        return sb;
+    }
+
+    public static Kind[] signatureToKinds(ResolvedJavaMethod method) {
+        Kind receiver = isStatic(method.accessFlags()) ? null : method.holder().kind();
+        return signatureToKinds(method.signature(), receiver);
+    }
+
+    public static Kind[] signatureToKinds(Signature signature, Kind receiverKind) {
+        int args = signature.argumentCount(false);
+        Kind[] result;
+        int i = 0;
+        if (receiverKind != null) {
+            result = new Kind[args + 1];
+            result[0] = receiverKind;
+            i = 1;
+        } else {
+            result = new Kind[args];
+        }
+        for (int j = 0; j < args; j++) {
+            result[i + j] = signature.argumentKindAt(j);
+        }
+        return result;
+    }
+
+    public static Class< ? >[] signatureToTypes(Signature signature, ResolvedJavaType accessingClass) {
+        int count = signature.argumentCount(false);
+        Class< ? >[] result = new Class< ? >[count];
+        for (int i = 0; i < result.length; ++i) {
+            result[i] = signature.argumentTypeAt(i, accessingClass).resolve(accessingClass).toJava();
+        }
+        return result;
+    }
+
+    /**
+     * Formats some profiling information associated as a string.
+     *
+     * @param info the profiling info to format
+     * @param method an optional method that augments the profile string returned
+     * @param sep the separator to use for each separate profile record
+     */
+    public static String profileToString(ProfilingInfo info, ResolvedJavaMethod method, String sep) {
+        StringBuilder buf = new StringBuilder(100);
+        if (method != null) {
+            buf.append(String.format("canBeStaticallyBound: %b%s", method.canBeStaticallyBound(), sep)).
+            append(String.format("invocationCount: %d%s", method.invocationCount(), sep));
+        }
+        for (int i = 0; i < info.codeSize(); i++) {
+            if (info.getExecutionCount(i) != -1) {
+                buf.append(String.format("executionCount@%d: %d%s", i, info.getExecutionCount(i), sep));
+            }
+
+            if (info.getBranchTakenProbability(i) != -1) {
+                buf.append(String.format("branchProbability@%d: %.3f%s", i, info.getBranchTakenProbability(i), sep));
+            }
+
+            double[] switchProbabilities = info.getSwitchProbabilities(i);
+            if (switchProbabilities != null) {
+                buf.append(String.format("switchProbabilities@%d:", i));
+                for (int j = 0; j < switchProbabilities.length; j++) {
+                    buf.append(String.format(" %.3f", switchProbabilities[j]));
+                }
+                buf.append(sep);
+            }
+
+            if (info.getExceptionSeen(i) != ExceptionSeen.FALSE) {
+                buf.append(String.format("exceptionSeen@%d: %s%s", i, info.getExceptionSeen(i).name(), sep));
+            }
+
+            JavaTypeProfile typeProfile = info.getTypeProfile(i);
+            if (typeProfile != null) {
+                ProfiledType[] ptypes = typeProfile.getTypes();
+                if (ptypes != null) {
+                    buf.append(String.format("types@%d:", i));
+                    for (int j = 0; j < ptypes.length; j++) {
+                        ProfiledType ptype = ptypes[j];
+                        buf.append(String.format(" %.3f (%s)%s", ptype.probability, ptype.type, sep));
+                    }
+                    buf.append(String.format(" %.3f <not recorded>%s", typeProfile.getNotRecordedProbability(), sep));
+                }
+            }
+        }
+
+        boolean firstDeoptReason = true;
+        for (DeoptimizationReason reason: DeoptimizationReason.values()) {
+            int count = info.getDeoptimizationCount(reason);
+            if (count > 0) {
+                if (firstDeoptReason) {
+                    buf.append("deoptimization history").append(sep);
+                    firstDeoptReason = false;
+                }
+                buf.append(String.format(" %s: %d%s", reason.name(), count, sep));
+            }
+        }
+        if (buf.length() == 0) {
+            return "";
+        }
+        String s = buf.toString();
+        assert s.endsWith(sep);
+        return s.substring(0, s.length() - sep.length());
+    }
+}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java	Sat Jun 09 20:10:05 2012 +0200
@@ -30,7 +30,7 @@
 /**
  * Represents the output from compiling a method, including the compiled machine code, associated data and references,
  * relocation information, deoptimization information, etc. It is the essential component of a {@link CiResult}, which also includes
- * {@linkplain CiStatistics compilation statistics} and {@linkplain CiBailout failure information}.
+ * {@linkplain CiStatistics compilation statistics} and {@linkplain BailoutException failure information}.
  */
 public class CompilationResult implements Serializable {
 
@@ -56,9 +56,9 @@
      */
     public static class Safepoint extends Site implements Comparable<Safepoint> {
         private static final long serialVersionUID = 2479806696381720162L;
-        public final CiDebugInfo debugInfo;
+        public final DebugInfo debugInfo;
 
-        Safepoint(int pcOffset, CiDebugInfo debugInfo) {
+        Safepoint(int pcOffset, DebugInfo debugInfo) {
             super(pcOffset);
             this.debugInfo = debugInfo;
         }
@@ -106,7 +106,7 @@
          */
         public final boolean direct;
 
-        Call(Object target, int pcOffset, int size, boolean direct, CiDebugInfo debugInfo) {
+        Call(Object target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) {
             super(pcOffset, debugInfo);
             this.size = size;
             this.target = target;
@@ -350,7 +350,7 @@
 
     private ArrayList<CodeAnnotation> annotations;
 
-    private CiAssumptions assumptions;
+    private Assumptions assumptions;
 
     /**
      * Constructs a new target method.
@@ -358,11 +358,11 @@
     public CompilationResult() {
     }
 
-    public void setAssumptions(CiAssumptions assumptions) {
+    public void setAssumptions(Assumptions assumptions) {
         this.assumptions = assumptions;
     }
 
-    public CiAssumptions assumptions() {
+    public Assumptions assumptions() {
         return assumptions;
     }
 
@@ -408,7 +408,7 @@
      * @param debugInfo the debug info for the call
      * @param direct specifies if this is a {@linkplain Call#direct direct} call
      */
-    public void recordCall(int codePos, int size, Object target, CiDebugInfo debugInfo, boolean direct) {
+    public void recordCall(int codePos, int size, Object target, DebugInfo debugInfo, boolean direct) {
         final Call call = new Call(target, codePos, size, direct, debugInfo);
         addSafepoint(call);
     }
@@ -430,7 +430,7 @@
      * @param codePos the position of the safepoint in the code array
      * @param debugInfo the debug info for the safepoint
      */
-    public void recordSafepoint(int codePos, CiDebugInfo debugInfo) {
+    public void recordSafepoint(int codePos, DebugInfo debugInfo) {
         addSafepoint(new Safepoint(codePos, debugInfo));
     }
 
@@ -530,13 +530,13 @@
         annotations.add(annotation);
     }
 
-    private static void appendDebugInfo(StringBuilder sb, CiDebugInfo info) {
+    private static void appendDebugInfo(StringBuilder sb, DebugInfo info) {
         if (info != null) {
             appendRefMap(sb, "stackMap", info.frameRefMap);
             appendRefMap(sb, "registerMap", info.registerRefMap);
-            CiCodePos codePos = info.codePos;
+            BytecodePosition codePos = info.codePos;
             if (codePos != null) {
-                CiUtil.appendLocation(sb.append(" "), codePos.method, codePos.bci);
+                CodeUtil.appendLocation(sb.append(" "), codePos.method, codePos.bci);
                 if (info.hasFrame()) {
                     sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack);
                     if (info.frame().numLocks > 0) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DebugInfo.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,106 @@
+/*
+ * 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.graal.api.code;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Represents the debugging information for a particular place in the code,
+ * which includes the code position, a reference map, and deoptimization information.
+ */
+public class DebugInfo implements Serializable {
+
+    private static final long serialVersionUID = -6047206624915812516L;
+
+    /**
+     * The code position (including all inlined methods) of this debug info.
+     * If this is a {@link BytecodeFrame} instance, then it is also the deoptimization information for each inlined frame.
+     */
+    public final BytecodePosition codePos;
+
+    /**
+     * The reference map for the registers at this point. The reference map is <i>packed</i> in that
+     * for bit {@code k} in byte {@code n}, it refers to the register whose
+     * {@linkplain Register#number number} is {@code (k + n * 8)}.
+     */
+    public final BitSet registerRefMap;
+
+    /**
+     * The reference map for the stack frame at this point. A set bit at {@code k} in the map
+     * represents stack slot number {@code k}.
+     */
+    public final BitSet frameRefMap;
+
+    /**
+     * Creates a new {@code CiDebugInfo} from the given values.
+     *
+     * @param codePos the {@linkplain BytecodePosition code position} or {@linkplain BytecodeFrame frame} info
+     * @param registerRefMap the register map
+     * @param frameRefMap the reference map for {@code frame}, which may be {@code null}
+     */
+    public DebugInfo(BytecodePosition codePos, BitSet registerRefMap, BitSet frameRefMap) {
+        this.codePos = codePos;
+        this.registerRefMap = registerRefMap;
+        this.frameRefMap = frameRefMap;
+    }
+
+    /**
+     * @return {@code true} if this debug information has a frame
+     */
+    public boolean hasFrame() {
+        return codePos instanceof BytecodeFrame;
+    }
+
+    /**
+     * @return {@code true} if this debug info has a reference map for the registers
+     */
+    public boolean hasRegisterRefMap() {
+        return registerRefMap != null && registerRefMap.size() > 0;
+    }
+
+    /**
+     * @return {@code true} if this debug info has a reference map for the stack
+     */
+    public boolean hasStackRefMap() {
+        return frameRefMap != null && frameRefMap.size() > 0;
+    }
+
+
+    /**
+     * Gets the deoptimization information for each inlined frame (if available).
+     *
+     * @return {@code null} if no frame de-opt info is {@linkplain #hasDebugFrame available}
+     */
+    public BytecodeFrame frame() {
+        if (hasFrame()) {
+            return (BytecodeFrame) codePos;
+        }
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return CodeUtil.append(new StringBuilder(100), this, null).toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DeoptimizationAction.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,32 @@
+/*
+ * 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
+ * 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.graal.api.code;
+
+
+public enum DeoptimizationAction {
+    None,                           // just interpret, do not invalidate nmethod
+    RecompileIfTooManyDeopts,       // recompile the nmethod; need not invalidate
+    InvalidateReprofile,            // invalidate the nmethod, reset IC, maybe recompile
+    InvalidateRecompile,            // invalidate the nmethod, recompile (probably)
+    InvalidateStopCompiling;        // invalidate the nmethod and do not compile
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,45 @@
+/*
+ * 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.graal.api.code;
+
+import com.oracle.graal.api.meta.*;
+
+public final class MonitorValue extends Value {
+    private static final long serialVersionUID = 8241681800464483691L;
+
+    public Value owner;
+    public final Value lockData;
+    public final boolean eliminated;
+
+    public MonitorValue(Value owner, Value lockData, boolean eliminated) {
+        super(Kind.Illegal);
+        this.owner = owner;
+        this.lockData = lockData;
+        this.eliminated = eliminated;
+    }
+
+    @Override
+    public String toString() {
+        return "monitor[" + owner + (lockData != null ? ", " + lockData : "") + (eliminated ? ", eliminated" : "") + "]";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Register.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,256 @@
+/*
+ * 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.graal.api.code;
+
+import java.io.*;
+import java.util.*;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Represents a target machine register.
+ */
+public final class Register implements Comparable<Register>, Serializable {
+
+    private static final long serialVersionUID = -7213269157816016300L;
+
+    /**
+     * Invalid register.
+     */
+    public static final Register None = new Register(-1, -1, 0, "noreg");
+
+    /**
+     * Frame pointer of the current method. All spill slots and outgoing stack-based arguments
+     * are addressed relative to this register.
+     */
+    public static final Register Frame = new Register(-2, -2, 0, "framereg", RegisterFlag.CPU);
+
+    public static final Register CallerFrame = new Register(-3, -3, 0, "callerframereg", RegisterFlag.CPU);
+
+    /**
+     * The identifier for this register that is unique across all the registers in a {@link Architecture}.
+     * A valid register has {@code number > 0}.
+     */
+    public final int number;
+
+    /**
+     * The mnemonic of this register.
+     */
+    public final String name;
+
+    /**
+     * The actual encoding in a target machine instruction for this register, which may or
+     * may not be the same as {@link #number}.
+     */
+    public final int encoding;
+
+    /**
+     * The size of the stack slot used to spill the value of this register.
+     */
+    public final int spillSlotSize;
+
+    /**
+     * The set of {@link RegisterFlag} values associated with this register.
+     */
+    private final int flags;
+
+    /**
+     * An array of {@link RegisterValue} objects, for this register, with one entry
+     * per {@link Kind}, indexed by {@link Kind#ordinal}.
+     */
+    private final RegisterValue[] values;
+
+    /**
+     * Attributes that characterize a register in a useful way.
+     *
+     */
+    public enum RegisterFlag {
+        /**
+         * Denotes an integral (i.e. non floating point) register.
+         */
+        CPU,
+
+        /**
+         * Denotes a register whose lowest order byte can be addressed separately.
+         */
+        Byte,
+
+        /**
+         * Denotes a floating point register.
+         */
+        FPU;
+
+        public final int mask = 1 << (ordinal() + 1);
+    }
+
+    /**
+     * Creates a {@code CiRegister} instance.
+     *
+     * @param number unique identifier for the register
+     * @param encoding the target machine encoding for the register
+     * @param spillSlotSize the size of the stack slot used to spill the value of the register
+     * @param name the mnemonic name for the register
+     * @param flags the set of {@link RegisterFlag} values for the register
+     */
+    public Register(int number, int encoding, int spillSlotSize, String name, RegisterFlag... flags) {
+        this.number = number;
+        this.name = name;
+        this.spillSlotSize = spillSlotSize;
+        this.flags = createMask(flags);
+        this.encoding = encoding;
+
+        values = new RegisterValue[Kind.VALUES.length];
+        for (Kind kind : Kind.VALUES) {
+            values[kind.ordinal()] = new RegisterValue(kind, this);
+        }
+    }
+
+    private static int createMask(RegisterFlag... flags) {
+        int result = 0;
+        for (RegisterFlag f : flags) {
+            result |= f.mask;
+        }
+        return result;
+    }
+
+    public boolean isSet(RegisterFlag f) {
+        return (flags & f.mask) != 0;
+    }
+
+    /**
+     * Gets this register as a {@linkplain RegisterValue value} with a specified kind.
+     * @param kind the specified kind
+     * @return the {@link RegisterValue}
+     */
+    public RegisterValue asValue(Kind kind) {
+        return values[kind.ordinal()];
+    }
+
+    /**
+     * Gets this register as a {@linkplain RegisterValue value} with no particular kind.
+     * @return a {@link RegisterValue} with {@link Kind#Illegal} kind.
+     */
+    public RegisterValue asValue() {
+        return asValue(Kind.Illegal);
+    }
+
+    /**
+     * Determines if this is a valid register.
+     * @return {@code true} iff this register is valid
+     */
+    public boolean isValid() {
+        return number >= 0;
+    }
+
+    /**
+     * Determines if this a floating point register.
+     */
+    public boolean isFpu() {
+        return isSet(RegisterFlag.FPU);
+    }
+
+    /**
+     * Determines if this a general purpose register.
+     */
+    public boolean isCpu() {
+        return isSet(RegisterFlag.CPU);
+    }
+
+    /**
+     * Determines if this register has the {@link RegisterFlag#Byte} attribute set.
+     * @return {@code true} iff this register has the {@link RegisterFlag#Byte} attribute set.
+     */
+    public boolean isByte() {
+        return isSet(RegisterFlag.Byte);
+    }
+
+    /**
+     * Categorizes a set of registers by {@link RegisterFlag}.
+     *
+     * @param registers a list of registers to be categorized
+     * @return a map from each {@link RegisterFlag} constant to the list of registers for which the flag is
+     *         {@linkplain #isSet(RegisterFlag) set}
+     */
+    public static EnumMap<RegisterFlag, Register[]> categorize(Register[] registers) {
+        EnumMap<RegisterFlag, Register[]> result = new EnumMap<>(RegisterFlag.class);
+        for (RegisterFlag flag : RegisterFlag.values()) {
+            ArrayList<Register> list = new ArrayList<>();
+            for (Register r : registers) {
+                if (r.isSet(flag)) {
+                    list.add(r);
+                }
+            }
+            result.put(flag, list.toArray(new Register[list.size()]));
+        }
+        return result;
+    }
+
+    /**
+     * Gets the maximum register {@linkplain #number number} in a given set of registers.
+     *
+     * @param registers the set of registers to process
+     * @return the maximum register number for any register in {@code registers}
+     */
+    public static int maxRegisterNumber(Register[] registers) {
+        int max = Integer.MIN_VALUE;
+        for (Register r : registers) {
+            if (r.number > max) {
+                max = r.number;
+            }
+        }
+        return max;
+    }
+
+    /**
+     * Gets the maximum register {@linkplain #encoding encoding} in a given set of registers.
+     *
+     * @param registers the set of registers to process
+     * @return the maximum register encoding for any register in {@code registers}
+     */
+    public static int maxRegisterEncoding(Register[] registers) {
+        int max = Integer.MIN_VALUE;
+        for (Register r : registers) {
+            if (r.encoding > max) {
+                max = r.encoding;
+            }
+        }
+        return max;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+    @Override
+    public int compareTo(Register o) {
+        if (number < o.number) {
+            return -1;
+        }
+        if (number > o.number) {
+            return 1;
+        }
+        return 0;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterAttributes.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2010, 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.graal.api.code;
+
+import java.util.*;
+
+/**
+ * A collection of register attributes. The specific attribute values for a register may be
+ * local to a compilation context. For example, a {@link RegisterConfig} in use during
+ * a compilation will determine which registers are callee saved.
+ */
+public class RegisterAttributes {
+
+    /**
+     * Denotes a register whose value preservation (if required) across a call is the responsibility of the caller.
+     */
+    public final boolean isCallerSave;
+
+    /**
+     * Denotes a register whose value preservation (if required) across a call is the responsibility of the callee.
+     */
+    public final boolean isCalleeSave;
+
+    /**
+     * Denotes a register that is available for use by a register allocator.
+     */
+    public final boolean isAllocatable;
+
+    /**
+     * Denotes a register guaranteed to be non-zero if read in compiled Java code.
+     * For example, a register dedicated to holding the current thread.
+     */
+    public boolean isNonZero;
+
+    public RegisterAttributes(boolean isCallerSave, boolean isCalleeSave, boolean isAllocatable) {
+        this.isCallerSave = isCallerSave;
+        this.isCalleeSave = isCalleeSave;
+        this.isAllocatable = isAllocatable;
+    }
+
+    public static final RegisterAttributes NONE = new RegisterAttributes(false, false, false);
+
+    /**
+     * Creates a map from register {@linkplain Register#number numbers} to register
+     * {@linkplain RegisterAttributes attributes} for a given register configuration and set of
+     * registers.
+     *
+     * @param registerConfig a register configuration
+     * @param registers a set of registers
+     * @return an array whose length is the max register number in {@code registers} plus 1. An element at index i holds
+     *         the attributes of the register whose number is i.
+     */
+    public static RegisterAttributes[] createMap(RegisterConfig registerConfig, Register[] registers) {
+        RegisterAttributes[] map = new RegisterAttributes[registers.length];
+        for (Register reg : registers) {
+            if (reg != null) {
+                CalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
+                RegisterAttributes attr = new RegisterAttributes(
+                                Arrays.asList(registerConfig.getCallerSaveRegisters()).contains(reg),
+                                csl == null ? false : Arrays.asList(csl.registers).contains(reg),
+                                Arrays.asList(registerConfig.getAllocatableRegisters()).contains(reg));
+                if (map.length <= reg.number) {
+                    map = Arrays.copyOf(map, reg.number + 1);
+                }
+                map[reg.number] = attr;
+            }
+        }
+        for (int i = 0; i < map.length; i++) {
+            if (map[i] == null) {
+                map[i] = NONE;
+            }
+        }
+        return map;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterConfig.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,113 @@
+/*
+ * 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.graal.api.code;
+
+import java.util.*;
+
+import com.oracle.graal.api.code.CallingConvention.*;
+import com.oracle.graal.api.code.Register.*;
+import com.oracle.graal.api.meta.*;
+
+/**
+ * A register configuration binds roles and {@linkplain RegisterAttributes attributes}
+ * to physical registers.
+ */
+public interface RegisterConfig {
+
+    /**
+     * Gets the register to be used for returning a value of a given kind.
+     */
+    Register getReturnRegister(Kind kind);
+
+    /**
+     * Gets the register to which {@link Register#Frame} and {@link Register#CallerFrame} are bound.
+     */
+    Register getFrameRegister();
+
+    Register getScratchRegister();
+
+    /**
+     * Gets the calling convention describing how arguments are passed.
+     *
+     * @param type the type of calling convention being requested
+     * @param parameters the types of the arguments of the call
+     * @param target the target platform
+     * @param stackOnly ignore registers
+     */
+    CallingConvention getCallingConvention(Type type, Kind[] parameters, TargetDescription target, boolean stackOnly);
+
+    /**
+     * Gets the ordered set of registers that are can be used to pass parameters
+     * according to a given calling convention.
+     *
+     * @param type the type of calling convention
+     * @param flag specifies whether registers for {@linkplain RegisterFlag#CPU integral} or
+     *             {@linkplain} RegisterFlag#FPU floating point} parameters are being requested
+     * @return the ordered set of registers that may be used to pass parameters in a call conforming to {@code type}
+     */
+    Register[] getCallingConventionRegisters(Type type, RegisterFlag flag);
+
+    /**
+     * Gets the set of registers that can be used by the register allocator.
+     */
+    Register[] getAllocatableRegisters();
+
+    /**
+     * Gets the set of registers that can be used by the register allocator,
+     * {@linkplain Register#categorize(Register[]) categorized} by register {@linkplain RegisterFlag flags}.
+     *
+     * @return a map from each {@link RegisterFlag} constant to the list of {@linkplain #getAllocatableRegisters()
+     *         allocatable} registers for which the flag is {@linkplain #isSet(RegisterFlag) set}
+     *
+     */
+    EnumMap<RegisterFlag, Register[]> getCategorizedAllocatableRegisters();
+
+    /**
+     * Gets the registers whose values must be preserved by a method across any call it makes.
+     */
+    Register[] getCallerSaveRegisters();
+
+    /**
+     * Gets the layout of the callee save area of this register configuration.
+     *
+     * @return {@code null} if there is no callee save area
+     */
+    CalleeSaveLayout getCalleeSaveLayout();
+
+    /**
+     * Gets a map from register {@linkplain Register#number numbers} to register
+     * {@linkplain RegisterAttributes attributes} for this register configuration.
+     *
+     * @return an array where an element at index i holds the attributes of the register whose number is i
+     * @see Register#categorize(Register[])
+     */
+    RegisterAttributes[] getAttributesMap();
+
+    /**
+     * Gets the register corresponding to a runtime-defined role.
+     *
+     * @param id the identifier of a runtime-defined register role
+     * @return the register playing the role specified by {@code id}
+     */
+    Register getRegisterForRole(int id);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterConfigImpl.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,298 @@
+/*
+ * Copyright (c) 2010, 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.graal.api.code;
+
+import java.util.*;
+
+import com.oracle.graal.api.code.CallingConvention.*;
+import com.oracle.graal.api.code.Register.*;
+import com.oracle.graal.api.meta.*;
+
+/**
+ * A default implementation of {@link RegisterConfig}.
+ */
+public class RegisterConfigImpl implements RegisterConfig {
+
+    /**
+     * The object describing the callee save area of this register configuration.
+     */
+    public CalleeSaveLayout csl;
+
+    /**
+     * The minimum register role identifier.
+     */
+    public final int minRole;
+
+    /**
+     * The map from register role IDs to registers.
+     */
+    public final Register[] registersRoleMap;
+
+    /**
+     * The set of registers that can be used by the register allocator.
+     */
+    public final Register[] allocatable;
+
+    /**
+     * The set of registers that can be used by the register allocator,
+     * {@linkplain Register#categorize(Register[]) categorized} by register
+     * {@linkplain RegisterFlag flags}.
+     */
+    public final EnumMap<RegisterFlag, Register[]> categorized;
+
+    /**
+     * The ordered set of registers used to pass integral arguments.
+     */
+    public final Register[] cpuParameters;
+
+    /**
+     * The ordered set of registers used to pass floating point arguments.
+     */
+    public final Register[] fpuParameters;
+
+    /**
+     * The caller saved registers.
+     */
+    public final Register[] callerSave;
+
+    /**
+     * The register to which {@link Register#Frame} and {@link Register#CallerFrame} are bound.
+     */
+    public final Register frame;
+
+    /**
+     * Register for returning an integral value.
+     */
+    public final Register integralReturn;
+
+    /**
+     * Register for returning a floating point value.
+     */
+    public final Register floatingPointReturn;
+
+    /**
+     * The map from register {@linkplain Register#number numbers} to register
+     * {@linkplain RegisterAttributes attributes} for this register configuration.
+     */
+    public final RegisterAttributes[] attributesMap;
+
+    /**
+     * The scratch register.
+     */
+    public final Register scratch;
+
+    /**
+     * The frame offset of the first stack argument for each calling convention {@link CallingConvention.Type}.
+     */
+    public final int[] stackArg0Offsets = new int[CallingConvention.Type.VALUES.length];
+
+    public RegisterConfigImpl(
+                    Register frame,
+                    Register integralReturn,
+                    Register floatingPointReturn,
+                    Register scratch,
+                    Register[] allocatable,
+                    Register[] callerSave,
+                    Register[] parameters,
+                    CalleeSaveLayout csl,
+                    Register[] allRegisters,
+                    Map<Integer, Register> roles) {
+        this.frame = frame;
+        this.csl = csl;
+        this.allocatable = allocatable;
+        this.callerSave = callerSave;
+        assert !Arrays.asList(allocatable).contains(scratch);
+        this.scratch = scratch;
+        EnumMap<RegisterFlag, Register[]> categorizedParameters = Register.categorize(parameters);
+        this.cpuParameters = categorizedParameters.get(RegisterFlag.CPU);
+        this.fpuParameters = categorizedParameters.get(RegisterFlag.FPU);
+        categorized = Register.categorize(allocatable);
+        attributesMap = RegisterAttributes.createMap(this, allRegisters);
+        this.floatingPointReturn = floatingPointReturn;
+        this.integralReturn = integralReturn;
+        int minRoleId = Integer.MAX_VALUE;
+        int maxRoleId = Integer.MIN_VALUE;
+        for (Map.Entry<Integer, Register> e : roles.entrySet()) {
+            int id = e.getKey();
+            assert id >= 0;
+            if (minRoleId > id) {
+                minRoleId = id;
+            }
+            if (maxRoleId < id) {
+                maxRoleId = id;
+            }
+        }
+        registersRoleMap = new Register[(maxRoleId - minRoleId) + 1];
+        for (Map.Entry<Integer, Register> e : roles.entrySet()) {
+            int id = e.getKey();
+            registersRoleMap[id] = e.getValue();
+        }
+        minRole = minRoleId;
+    }
+
+    public RegisterConfigImpl(RegisterConfigImpl src, CalleeSaveLayout csl) {
+        this.frame = src.frame;
+        this.csl = csl;
+        this.allocatable = src.allocatable;
+        this.callerSave = src.callerSave;
+        this.scratch = src.scratch;
+        this.cpuParameters = src.cpuParameters;
+        this.fpuParameters = src.fpuParameters;
+        this.categorized = src.categorized;
+        this.attributesMap = src.attributesMap;
+        this.floatingPointReturn = src.floatingPointReturn;
+        this.integralReturn = src.integralReturn;
+        this.registersRoleMap = src.registersRoleMap;
+        this.minRole = src.minRole;
+        System.arraycopy(src.stackArg0Offsets, 0, stackArg0Offsets, 0, stackArg0Offsets.length);
+    }
+
+    public Register getReturnRegister(Kind kind) {
+        if (kind.isDouble() || kind.isFloat()) {
+            return floatingPointReturn;
+        }
+        return integralReturn;
+    }
+
+    public Register getFrameRegister() {
+        return frame;
+    }
+
+    public Register getScratchRegister() {
+        return scratch;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * This implementation assigns all available registers to parameters before assigning
+     * any stack slots to parameters.
+     */
+    public CallingConvention getCallingConvention(Type type, Kind[] parameters, TargetDescription target, boolean stackOnly) {
+        Value[] locations = new Value[parameters.length];
+
+        int currentGeneral = 0;
+        int currentXMM = 0;
+        int currentStackOffset = stackArg0Offsets[type.ordinal()];
+
+        for (int i = 0; i < parameters.length; i++) {
+            final Kind kind = parameters[i];
+
+            switch (kind) {
+                case Byte:
+                case Boolean:
+                case Short:
+                case Char:
+                case Int:
+                case Long:
+                case Object:
+                    if (!stackOnly && currentGeneral < cpuParameters.length) {
+                        Register register = cpuParameters[currentGeneral++];
+                        locations[i] = register.asValue(kind);
+                    }
+                    break;
+
+                case Float:
+                case Double:
+                    if (!stackOnly && currentXMM < fpuParameters.length) {
+                        Register register = fpuParameters[currentXMM++];
+                        locations[i] = register.asValue(kind);
+                    }
+                    break;
+
+                default:
+                    throw new InternalError("Unexpected parameter kind: " + kind);
+            }
+
+            if (locations[i] == null) {
+                locations[i] = StackSlot.get(kind.stackKind(), currentStackOffset, !type.out);
+                currentStackOffset += Math.max(target.sizeInBytes(kind), target.wordSize);
+            }
+        }
+
+        return new CallingConvention(locations, currentStackOffset);
+    }
+
+    public Register[] getCallingConventionRegisters(Type type, RegisterFlag flag) {
+        if (flag == RegisterFlag.CPU) {
+            return cpuParameters;
+        }
+        assert flag == RegisterFlag.FPU;
+        return fpuParameters;
+    }
+
+    public Register[] getAllocatableRegisters() {
+        return allocatable;
+    }
+
+    public EnumMap<RegisterFlag, Register[]> getCategorizedAllocatableRegisters() {
+        return categorized;
+    }
+
+    public Register[] getCallerSaveRegisters() {
+        return callerSave;
+    }
+
+    public CalleeSaveLayout getCalleeSaveLayout() {
+        return csl;
+    }
+
+    public RegisterAttributes[] getAttributesMap() {
+        return attributesMap;
+    }
+
+    public Register getRegisterForRole(int id) {
+        return registersRoleMap[id - minRole];
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder roleMap = new StringBuilder();
+        for (int i = 0; i < registersRoleMap.length; ++i) {
+            Register reg = registersRoleMap[i];
+            if (reg != null) {
+                if (roleMap.length() != 0) {
+                    roleMap.append(", ");
+                }
+                roleMap.append(i + minRole).append(" -> ").append(reg);
+            }
+        }
+        StringBuilder stackArg0OffsetsMap = new StringBuilder();
+        for (Type t : Type.VALUES) {
+            if (stackArg0OffsetsMap.length() != 0) {
+                stackArg0OffsetsMap.append(", ");
+            }
+            stackArg0OffsetsMap.append(t).append(" -> ").append(stackArg0Offsets[t.ordinal()]);
+        }
+        String res = String.format(
+             "Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" +
+             "CallerSave:  " + Arrays.toString(getCallerSaveRegisters()) + "%n" +
+             "CalleeSave:  " + getCalleeSaveLayout() + "%n" +
+             "CPU Params:  " + Arrays.toString(cpuParameters) + "%n" +
+             "FPU Params:  " + Arrays.toString(fpuParameters) + "%n" +
+             "VMRoles:     " + roleMap + "%n" +
+             "stackArg0:   " + stackArg0OffsetsMap + "%n" +
+             "Scratch:     " + getScratchRegister() + "%n");
+        return res;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,57 @@
+/*
+ * 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.graal.api.code;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Denotes a register that stores a value of a fixed kind. There is exactly one (canonical) instance of {@code
+ * CiRegisterValue} for each ({@link Register}, {@link Kind}) pair. Use {@link Register#asValue(Kind)} to
+ * retrieve the canonical {@link RegisterValue} instance for a given (register,kind) pair.
+ */
+public final class RegisterValue extends Value {
+    private static final long serialVersionUID = 7999341472196897163L;
+
+    /**
+     * The register.
+     */
+    public final Register reg;
+
+    /**
+     * Should only be called from {@link Register#CiRegister} to ensure canonicalization.
+     */
+    protected RegisterValue(Kind kind, Register register) {
+        super(kind);
+        this.reg = register;
+    }
+
+    @Override
+    public int hashCode() {
+        return (reg.number << 4) ^ kind.ordinal();
+    }
+
+    @Override
+    public String toString() {
+        return reg.name + kindSuffix();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RuntimeCall.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,58 @@
+/*
+ * 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.graal.api.code;
+
+import static com.oracle.graal.api.meta.Kind.*;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Enumerates the calls that must be provided by the runtime system. The compiler
+ * may generate code that calls the runtime services for unresolved and slow cases of some
+ * bytecodes.
+ */
+public enum RuntimeCall {
+    UnwindException(Void, Object),
+    Deoptimize(Void),
+    RegisterFinalizer(Void, Object),
+    SetDeoptInfo(Void, Object),
+    CreateNullPointerException(Object),
+    CreateOutOfBoundsException(Object, Int),
+    JavaTimeMillis(Long),
+    JavaTimeNanos(Long),
+    Debug(Void),
+    ArithmeticFrem(Float, Float, Float),
+    ArithmeticDrem(Double, Double, Double),
+    ArithmeticCos(Double, Double),
+    ArithmeticTan(Double, Double),
+    ArithmeticSin(Double, Double),
+    GenericCallback(Object, Object, Object);
+
+    public final Kind resultKind;
+    public final Kind[] arguments;
+
+    private RuntimeCall(Kind resultKind, Kind... args) {
+        this.resultKind = resultKind;
+        this.arguments = args;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlot.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2010, 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.graal.api.code;
+
+import static com.oracle.graal.api.meta.Kind.*;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * Represents a compiler spill slot or an outgoing stack-based argument in a method's frame
+ * or an incoming stack-based argument in a method's {@linkplain #inCallerFrame() caller's frame}.
+ */
+public final class StackSlot extends Value {
+    private static final long serialVersionUID = -7725071921307318433L;
+
+    private final int offset;
+    private final boolean addFrameSize;
+
+    /**
+     * Gets a {@link StackSlot} instance representing a stack slot at a given index
+     * holding a value of a given kind.
+     *
+     * @param kind The kind of the value stored in the stack slot.
+     * @param offset The offset of the stack slot (in bytes)
+     * @param inCallerFrame Specifies if the offset is relative to the stack pointer,
+     *        or the beginning of the frame (stack pointer + total frame size).
+     */
+    public static StackSlot get(Kind kind, int offset, boolean addFrameSize) {
+        assert kind.stackKind() == kind;
+        assert addFrameSize || offset >= 0;
+
+        if (offset % CACHE_GRANULARITY == 0) {
+            StackSlot[][] cache;
+            int index = offset / CACHE_GRANULARITY;
+            if (!addFrameSize) {
+                cache = OUT_CACHE;
+            } else if (offset >= 0) {
+                cache = IN_CACHE;
+            } else {
+                cache = SPILL_CACHE;
+                index = -index;
+            }
+            StackSlot[] slots = cache[kind.ordinal()];
+            if (index < slots.length) {
+                StackSlot slot = slots[index];
+                assert slot.kind == kind && slot.offset == offset && slot.addFrameSize == addFrameSize;
+                return slot;
+            }
+        }
+        return new StackSlot(kind, offset, addFrameSize);
+    }
+
+    /**
+     * Private constructor to enforce use of {@link #get()} so that a cache can be used.
+     */
+    private StackSlot(Kind kind, int offset, boolean addFrameSize) {
+        super(kind);
+        this.offset = offset;
+        this.addFrameSize = addFrameSize;
+    }
+
+    /**
+     * Gets the offset of this stack slot, relative to the stack pointer.
+     * @return The offset of this slot (in bytes).
+     */
+    public int offset(int totalFrameSize) {
+        assert totalFrameSize > 0 || !addFrameSize;
+        int result = offset + (addFrameSize ? totalFrameSize : 0);
+        assert result >= 0;
+        return result;
+    }
+
+    public boolean inCallerFrame() {
+        return addFrameSize && offset >= 0;
+    }
+
+    public int rawOffset() {
+        return offset;
+    }
+
+    public boolean rawAddFrameSize() {
+        return addFrameSize;
+    }
+
+    @Override
+    public int hashCode() {
+        return kind.ordinal() ^ (offset << 4) ^ (addFrameSize ? 15 : 0);
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (o instanceof StackSlot) {
+            StackSlot l = (StackSlot) o;
+            return l.kind == kind && l.offset == offset && l.addFrameSize == addFrameSize;
+        }
+        return false;
+    }
+
+    @Override
+    public String toString() {
+        if (!addFrameSize) {
+            return "out:" + offset + kindSuffix();
+        } else if (offset >= 0) {
+            return "in:" + offset + kindSuffix();
+        } else {
+            return "stack:" + (-offset) + kindSuffix();
+        }
+    }
+
+    /**
+     * Gets this stack slot used to pass an argument from the perspective of a caller.
+     */
+    public StackSlot asOutArg() {
+        assert offset >= 0;
+        if (addFrameSize) {
+            return get(kind, offset, false);
+        }
+        return this;
+    }
+
+    /**
+     * Gets this stack slot used to pass an argument from the perspective of a callee.
+     */
+    public StackSlot asInArg() {
+        assert offset >= 0;
+        if (!addFrameSize) {
+            return get(kind, offset, true);
+        }
+        return this;
+    }
+
+
+    private static final int CACHE_GRANULARITY = 8;
+    private static final int SPILL_CACHE_PER_KIND_SIZE = 100;
+    private static final int PARAM_CACHE_PER_KIND_SIZE = 10;
+
+    private static final StackSlot[][] SPILL_CACHE = makeCache(SPILL_CACHE_PER_KIND_SIZE, -1, true);
+    private static final StackSlot[][] IN_CACHE = makeCache(PARAM_CACHE_PER_KIND_SIZE, 1, true);
+    private static final StackSlot[][] OUT_CACHE = makeCache(PARAM_CACHE_PER_KIND_SIZE, 1, false);
+
+    private static StackSlot[][] makeCache(int cachePerKindSize, int sign, boolean addFrameSize) {
+        StackSlot[][] cache = new StackSlot[Kind.VALUES.length][];
+        for (Kind kind : new Kind[] {Illegal, Int, Long, Float, Double, Object, Jsr}) {
+            StackSlot[] slots = new StackSlot[cachePerKindSize];
+            for (int i = 0; i < cachePerKindSize; i++) {
+                slots[i] = new StackSlot(kind, sign * i * CACHE_GRANULARITY, addFrameSize);
+            }
+            cache[kind.ordinal()] = slots;
+        }
+        return cache;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,159 @@
+/*
+ * 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.graal.api.code;
+
+import com.oracle.graal.api.meta.*;
+
+
+/**
+ * Represents the target machine for a compiler, including the CPU architecture, the size of pointers and references,
+ * alignment of stacks, caches, etc.
+ */
+public class TargetDescription {
+    public final Architecture arch;
+
+    /**
+     * The OS page size.
+     */
+    public final int pageSize;
+
+    /**
+     * Specifies if this is a multi-processor system.
+     */
+    public final boolean isMP;
+
+    /**
+     * Specifies if this target supports encoding objects inline in the machine code.
+     */
+    public final boolean inlineObjects;
+
+    /**
+     * The machine word size on this target.
+     */
+    public final int wordSize;
+
+    /**
+     * The CiKind to be used for representing raw pointers and CPU registers.
+     */
+    public final Kind wordKind;
+
+    /**
+     * The stack alignment requirement of the platform. For example,
+     * from Appendix D of <a href="http://www.intel.com/Assets/PDF/manual/248966.pdf">Intel 64 and IA-32 Architectures Optimization Reference Manual</a>:
+     * <pre>
+     *     "It is important to ensure that the stack frame is aligned to a
+     *      16-byte boundary upon function entry to keep local __m128 data,
+     *      parameters, and XMM register spill locations aligned throughout
+     *      a function invocation."
+     * </pre>
+     */
+    public final int stackAlignment;
+
+    /**
+     * @see http://docs.sun.com/app/docs/doc/806-0477/6j9r2e2b9?a=view
+     */
+    public final int stackBias;
+
+    /**
+     * The cache alignment.
+     */
+    public final int cacheAlignment;
+
+    /**
+     * Specifies how {@code long} and {@code double} constants are to be stored
+     * in {@linkplain BytecodeFrame frames}. This is useful for VMs such as HotSpot
+     * where convention the interpreter uses is that the second local
+     * holds the first raw word of the native long or double representation.
+     * This is actually reasonable, since locals and stack arrays
+     * grow downwards in all implementations.
+     * If, on some machine, the interpreter's Java locals or stack
+     * were to grow upwards, the embedded doubles would be word-swapped.)
+     */
+    public final boolean debugInfoDoubleWordsInSecondSlot;
+
+    /**
+     * Temporary flag to distinguish between the semantics necessary for HotSpot and Maxine.
+     */
+    // TODO This should go away when XIR goes away, and the logic be part of the VM-specific lowering.
+    public final boolean invokeSnippetAfterArguments;
+
+    public TargetDescription(Architecture arch,
+             boolean isMP,
+             int stackAlignment,
+             int pageSize,
+             int cacheAlignment,
+             boolean inlineObjects,
+             boolean debugInfoDoubleWordsInSecondSlot,
+             boolean invokeSnippetAfterArguments) {
+        this.arch = arch;
+        this.pageSize = pageSize;
+        this.isMP = isMP;
+        this.wordSize = arch.wordSize;
+        if (wordSize == 8) {
+            this.wordKind = Kind.Long;
+        } else {
+            this.wordKind = Kind.Int;
+        }
+        this.stackAlignment = stackAlignment;
+        this.stackBias = 0; // TODO: configure with param once SPARC port exists
+        this.cacheAlignment = cacheAlignment;
+        this.inlineObjects = inlineObjects;
+        this.debugInfoDoubleWordsInSecondSlot = debugInfoDoubleWordsInSecondSlot;
+        this.invokeSnippetAfterArguments = invokeSnippetAfterArguments;
+    }
+
+    /**
+     * Gets the size in bytes of the specified kind for this target.
+     *
+     * @param kind the kind for which to get the size
+     * @return the size in bytes of {@code kind}
+     */
+    public int sizeInBytes(Kind kind) {
+        // Checkstyle: stop
+        switch (kind) {
+            case Boolean: return 1;
+            case Byte: return 1;
+            case Char: return 2;
+            case Short: return 2;
+            case Int: return 4;
+            case Long: return 8;
+            case Float: return 4;
+            case Double: return 8;
+            case Object: return wordSize;
+            case Jsr: return 4;
+            default: return 0;
+        }
+        // Checkstyle: resume
+    }
+
+    /**
+     * Aligns the given frame size (without return instruction pointer) to the stack
+     * alignment size and return the aligned size (without return instruction pointer).
+     * @param frameSize the initial frame size to be aligned
+     * @return the aligned frame size
+     */
+    public int alignFrameSize(int frameSize) {
+        int x = frameSize + arch.returnAddressSize + (stackAlignment - 1);
+        return (x / stackAlignment) * stackAlignment - arch.returnAddressSize;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,130 @@
+/*
+ * 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.graal.api.code;
+
+import com.oracle.graal.api.meta.*;
+
+public class ValueUtil {
+    public static boolean isIllegal(Value value) {
+        assert value != null;
+        return value == Value.IllegalValue;
+    }
+
+    public static boolean isLegal(Value value) {
+        return !isIllegal(value);
+    }
+
+    public static boolean isVirtualObject(Value value) {
+        assert value != null;
+        return value instanceof VirtualObject;
+    }
+
+    public static VirtualObject asVirtualObject(Value value) {
+        assert value != null;
+        return (VirtualObject) value;
+    }
+
+    public static boolean isConstant(Value value) {
+        assert value != null;
+        return value instanceof Constant;
+    }
+
+    public static Constant asConstant(Value value) {
+        assert value != null;
+        return (Constant) value;
+    }
+
+
+    public static boolean isStackSlot(Value value) {
+        assert value != null;
+        return value instanceof StackSlot;
+    }
+
+    public static StackSlot asStackSlot(Value value) {
+        assert value != null;
+        return (StackSlot) value;
+    }
+
+    public static boolean isAddress(Value value) {
+        assert value != null;
+        return value instanceof Address;
+    }
+
+    public static Address asAddress(Value value) {
+        assert value != null;
+        return (Address) value;
+    }
+
+
+    public static boolean isRegister(Value value) {
+        assert value != null;
+        return value instanceof RegisterValue;
+    }
+
+    public static Register asRegister(Value value) {
+        assert value != null;
+        return ((RegisterValue) value).reg;
+    }
+
+    public static Register asIntReg(Value value) {
+        assert value.kind == Kind.Int || value.kind == Kind.Jsr;
+        return asRegister(value);
+    }
+
+    public static Register asLongReg(Value value) {
+        assert value.kind == Kind.Long : value.kind;
+        return asRegister(value);
+    }
+
+    public static Register asObjectReg(Value value) {
+        assert value.kind == Kind.Object;
+        return asRegister(value);
+    }
+
+    public static Register asFloatReg(Value value) {
+        assert value.kind == Kind.Float;
+        return asRegister(value);
+    }
+
+    public static Register asDoubleReg(Value value) {
+        assert value.kind == Kind.Double;
+        return asRegister(value);
+    }
+
+
+    public static boolean sameRegister(Value v1, Value v2) {
+        return isRegister(v1) && isRegister(v2) && asRegister(v1) == asRegister(v2);
+    }
+
+    public static boolean sameRegister(Value v1, Value v2, Value v3) {
+        return sameRegister(v1, v2) && sameRegister(v1, v3);
+    }
+
+    public static boolean differentRegisters(Value v1, Value v2) {
+        return !isRegister(v1) || !isRegister(v2) || asRegister(v1) != asRegister(v2);
+    }
+
+    public static boolean differentRegisters(Value v1, Value v2, Value v3) {
+        return differentRegisters(v1, v2) && differentRegisters(v1, v3) && differentRegisters(v2, v3);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2010, 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.graal.api.code;
+
+import com.oracle.graal.api.meta.*;
+
+/**
+ * An instance of this class represents an object whose allocation was removed by escape analysis. The information stored in the {@link VirtualObject} is used during
+ * deoptimization to recreate the object.
+ */
+public final class VirtualObject extends Value {
+    private static final long serialVersionUID = -2907197776426346021L;
+
+    private final JavaType type;
+    private Value[] values;
+    private final int id;
+
+    /**
+     * Creates a new CiVirtualObject for the given type, with the given fields. If the type is an instance class then the values array needs to have one entry for each field, ordered in
+     * like the fields returned by {@link ResolvedJavaType#declaredFields()}. If the type is an array then the length of the values array determines the reallocated array length.
+     * @param type the type of the object whose allocation was removed during compilation. This can be either an instance of an array type.
+     * @param values an array containing all the values to be stored into the object when it is recreated.
+     * @param id a unique id that identifies the object within the debug information for one position in the compiled code.
+     * @return a new CiVirtualObject instance.
+     */
+    public static VirtualObject get(JavaType type, Value[] values, int id) {
+        return new VirtualObject(type, values, id);
+    }
+
+    private VirtualObject(JavaType type, Value[] values, int id) {
+        super(Kind.Object);
+        this.type = type;
+        this.values = values;
+        this.id = id;
+    }
+
+    @Override
+    public String toString() {
+        return "vobject:" + id;
+    }
+
+    /**
+     * @return the type of the object whose allocation was removed during compilation. This can be either an instance of an array type.
+     */
+    public JavaType type() {
+        return type;
+    }
+
+    /**
+     * @return an array containing all the values to be stored into the object when it is recreated.
+     */
+    public Value[] values() {
+        return values;
+    }
+
+    /**
+     * @return the unique id that identifies the object within the debug information for one position in the compiled code.
+     */
+    public int id() {
+        return id;
+    }
+
+    /**
+     * Overwrites the current set of values with a new one.
+     * @param values an array containing all the values to be stored into the object when it is recreated.
+     */
+    public void setValues(Value[] values) {
+        this.values = values;
+    }
+
+    @Override
+    public int hashCode() {
+        return kind.ordinal() + type.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (o instanceof VirtualObject) {
+            VirtualObject l = (VirtualObject) o;
+            if (l.type != type || l.values.length != values.length) {
+                return false;
+            }
+            for (int i = 0; i < values.length; i++) {
+                if (values[i] != l.values[i]) {
+                    return false;
+                }
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * This is a helper class used to create virtual objects for a number of different JDK classes.
+     */
+    public static class CiVirtualObjectFactory {
+        private int nextId = 0;
+        private final CodeCacheProvider runtime;
+
+        public CiVirtualObjectFactory(CodeCacheProvider runtime) {
+            this.runtime = runtime;
+        }
+
+        public VirtualObject constantProxy(Kind kind, Value objectValue, Value primitiveValue) {
+            Constant cKind = Constant.forObject(kind);
+            // TODO: here the ordering is hard coded... we should query RiType.fields() and act accordingly
+            return new VirtualObject(runtime.getResolvedJavaType(Constant.class), new Value[] {cKind, primitiveValue, Value.IllegalValue, objectValue}, nextId++);
+        }
+
+        public Value proxy(Value ciValue) {
+            switch (ciValue.kind) {
+                case Boolean:
+                    return new VirtualObject(runtime.getResolvedJavaType(Boolean.class), new Value[] {ciValue}, nextId++);
+                case Byte:
+                    return new VirtualObject(runtime.getResolvedJavaType(Byte.class), new Value[] {ciValue}, nextId++);
+                case Char:
+                    return new VirtualObject(runtime.getResolvedJavaType(Character.class), new Value[] {ciValue}, nextId++);
+                case Double:
+                    return new VirtualObject(runtime.getResolvedJavaType(Double.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
+                case Float:
+                    return new VirtualObject(runtime.getResolvedJavaType(Float.class), new Value[] {ciValue}, nextId++);
+                case Int:
+                    return new VirtualObject(runtime.getResolvedJavaType(Integer.class), new Value[] {ciValue}, nextId++);
+                case Long:
+                    return new VirtualObject(runtime.getResolvedJavaType(Long.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
+                case Object:
+                    return ciValue;
+                case Short:
+                    return new VirtualObject(runtime.getResolvedJavaType(Short.class), new Value[] {ciValue}, nextId++);
+                default:
+                    assert false : ciValue.kind;
+                    return null;
+            }
+        }
+
+        public VirtualObject arrayProxy(JavaType arrayType, Value[] values) {
+            return new VirtualObject(arrayType, values, nextId++);
+        }
+
+    }
+}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java	Sat Jun 09 20:10:05 2012 +0200
@@ -24,22 +24,22 @@
  * The compiler-provided part of the bi-directional interface between the compiler and the runtime system of a virtual machine for the instruction set defined in
  * {@link com.oracle.graal.compiler.graphbuilder.Bytecodes}.
  *
- * The target hardware architecture is represented by {@link com.oracle.graal.api.code.CiArchitecture} and the specific target machine
- * environment for a compiler instance is represented by {@link com.oracle.graal.api.code.CiTarget}.
+ * The target hardware architecture is represented by {@link com.oracle.graal.api.code.Architecture} and the specific target machine
+ * environment for a compiler instance is represented by {@link com.oracle.graal.api.code.TargetDescription}.
  * <p>
  * A {@code CiResult} encapsulates
- * {@linkplain com.oracle.max.cri.ci.CiStatistics compilation statistics}, possible {@linkplain com.oracle.graal.api.code.CiBailout error state}
+ * {@linkplain com.oracle.max.cri.ci.CiStatistics compilation statistics}, possible {@linkplain com.oracle.graal.api.code.BailoutException error state}
  * and the {@linkplain com.oracle.graal.api.code.CompilationResult compiled code and metadata}.
- * {@link com.oracle.graal.api.code.CiCodePos} and {@link com.oracle.graal.api.code.CiDebugInfo} provide detailed information to the
+ * {@link com.oracle.graal.api.code.BytecodePosition} and {@link com.oracle.graal.api.code.DebugInfo} provide detailed information to the
  * runtime to support debugging and deoptimization of the compiled code.
  * <p>
  * The compiler manipulates {@link com.oracle.graal.api.meta.Value} instances that have a {@link com.oracle.graal.api.meta.Kind}, and are
  * immutable. A concrete {@link com.oracle.graal.api.meta.Value value} is one of the following subclasses:
  * <ul>
  * <li>{@link com.oracle.graal.api.meta.Constant}: a constant value.
- * <li>{@link com.oracle.graal.api.code.CiRegisterValue}: a value stored in a {@linkplain com.oracle.graal.api.code.CiRegister target machine register}.
- * <li>{@link com.oracle.graal.api.code.CiStackSlot}: a spill slot or an outgoing stack-based argument in a method's frame.
- * <li>{@link com.oracle.graal.api.code.CiAddress}: an address in target machine memory.
+ * <li>{@link com.oracle.graal.api.code.RegisterValue}: a value stored in a {@linkplain com.oracle.graal.api.code.Register target machine register}.
+ * <li>{@link com.oracle.graal.api.code.StackSlot}: a spill slot or an outgoing stack-based argument in a method's frame.
+ * <li>{@link com.oracle.graal.api.code.Address}: an address in target machine memory.
  * <li>{@link com.oracle.graal.compiler.lir.CiVariable}: a value (cf. virtual register) that is yet to be bound to a target machine location (physical register or memory address).
  *</ul>
  */
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java	Sat Jun 09 20:10:05 2012 +0200
@@ -24,9 +24,6 @@
 
 
 public class MetaUtil {
-
-
-
     /**
      * Extends the functionality of {@link Class#getSimpleName()} to include a non-empty string for anonymous and local
      * classes.
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -49,7 +49,7 @@
     /**
      * The target that this compiler has been configured for.
      */
-    public final CiTarget target;
+    public final TargetDescription target;
 
     /**
      * The runtime that this compiler has been configured for.
@@ -66,7 +66,7 @@
      */
     public final Backend backend;
 
-    public GraalCompiler(ExtendedRiRuntime runtime, CiTarget target, Backend backend, RiXirGenerator xirGen) {
+    public GraalCompiler(ExtendedRiRuntime runtime, TargetDescription target, Backend backend, RiXirGenerator xirGen) {
         this.runtime = runtime;
         this.target = target;
         this.xir = xirGen;
@@ -77,12 +77,12 @@
     public CompilationResult compileMethod(final ResolvedJavaMethod method, final StructuredGraph graph, int osrBCI, final RiGraphCache cache, final PhasePlan plan, final OptimisticOptimizations optimisticOpts) {
         assert (method.accessFlags() & Modifier.NATIVE) == 0 : "compiling native methods is not supported";
         if (osrBCI != -1) {
-            throw new CiBailout("No OSR supported");
+            throw new BailoutException("No OSR supported");
         }
 
         return Debug.scope("GraalCompiler", new Object[] {graph, method, this}, new Callable<CompilationResult>() {
             public CompilationResult call() {
-                final CiAssumptions assumptions = GraalOptions.OptAssumptions ? new CiAssumptions() : null;
+                final Assumptions assumptions = GraalOptions.OptAssumptions ? new Assumptions() : null;
                 final LIR lir = Debug.scope("FrontEnd", new Callable<LIR>() {
                     public LIR call() {
                         return emitHIR(graph, assumptions, cache, plan, optimisticOpts);
@@ -105,7 +105,7 @@
     /**
      * Builds the graph, optimizes it.
      */
-    public LIR emitHIR(StructuredGraph graph, CiAssumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) {
+    public LIR emitHIR(StructuredGraph graph, Assumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) {
 
         if (graph.start().next() == null) {
             plan.runPhases(PhasePosition.AFTER_PARSING, graph);
@@ -235,7 +235,7 @@
         });
     }
 
-    public FrameMap emitLIR(final LIR lir, StructuredGraph graph, final ResolvedJavaMethod method, CiAssumptions assumptions) {
+    public FrameMap emitLIR(final LIR lir, StructuredGraph graph, final ResolvedJavaMethod method, Assumptions assumptions) {
         final FrameMap frameMap = backend.newFrameMap(runtime.getRegisterConfig(method));
         final LIRGenerator lirGenerator = backend.newLIRGenerator(graph, frameMap, method, lir, xir, assumptions);
 
@@ -262,7 +262,7 @@
         return frameMap;
     }
 
-    public CompilationResult emitCode(CiAssumptions assumptions, ResolvedJavaMethod method, LIR lir, FrameMap frameMap) {
+    public CompilationResult emitCode(Assumptions assumptions, ResolvedJavaMethod method, LIR lir, FrameMap frameMap) {
         TargetMethodAssembler tasm = backend.newAssembler(frameMap, lir);
         backend.emitCode(tasm, method, lir);
         CompilationResult targetMethod = tasm.finishTargetMethod(method, false);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/OptimisticOptimizations.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/OptimisticOptimizations.java	Sat Jun 09 20:10:05 2012 +0200
@@ -71,7 +71,7 @@
         for (Optimization opt: Optimization.values()) {
             if (!enabledOpts.contains(opt)) {
                 if (GraalOptions.PrintDisabledOptimisticOptimizations) {
-                    TTY.println("WARN: deactivated optimistic optimization %s for %s", opt.name(), CiUtil.format("%H.%n(%p)", method));
+                    TTY.println("WARN: deactivated optimistic optimization %s for %s", opt.name(), CodeUtil.format("%H.%n(%p)", method));
                 }
                 disabledOptimisticOptsMetric.increment();
             }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Sat Jun 09 20:10:05 2012 +0200
@@ -400,7 +400,7 @@
     }
 
     /**
-     * The {@linkplain CiRegisterValue register} or {@linkplain Variable variable} for this interval prior to register allocation.
+     * The {@linkplain RegisterValue register} or {@linkplain Variable variable} for this interval prior to register allocation.
      */
     public final Value operand;
 
@@ -410,14 +410,14 @@
     public final int operandNumber;
 
     /**
-     * The {@linkplain CiRegisterValue register}, {@linkplain CiStackSlot spill slot} or {@linkplain CiAddress address} assigned to this interval.
+     * The {@linkplain RegisterValue register}, {@linkplain StackSlot spill slot} or {@linkplain Address address} assigned to this interval.
      */
     private Value location;
 
     /**
      * The stack slot to which all splits of this interval are spilled if necessary.
      */
-    private CiStackSlot spillSlot;
+    private StackSlot spillSlot;
 
     /**
      * The kind of this interval.
@@ -504,7 +504,7 @@
     }
 
     /**
-     * Gets the {@linkplain CiRegisterValue register}, {@linkplain CiStackSlot spill slot} or {@linkplain CiAddress address} assigned to this interval.
+     * Gets the {@linkplain RegisterValue register}, {@linkplain StackSlot spill slot} or {@linkplain Address address} assigned to this interval.
      */
     public Value location() {
         return location;
@@ -564,11 +564,11 @@
     /**
      * Gets the canonical spill slot for this interval.
      */
-    CiStackSlot spillSlot() {
+    StackSlot spillSlot() {
         return splitParent().spillSlot;
     }
 
-    void setSpillSlot(CiStackSlot slot) {
+    void setSpillSlot(StackSlot slot) {
         assert splitParent().spillSlot == null : "connot overwrite existing spill slot";
         splitParent().spillSlot = slot;
     }
@@ -801,7 +801,7 @@
                     TTY.println(String.format("two valid result intervals found for opId %d: %d and %d", opId, result.operandNumber, interval.operandNumber));
                     TTY.println(result.logString(allocator));
                     TTY.println(interval.logString(allocator));
-                    throw new CiBailout("two valid result intervals found");
+                    throw new BailoutException("two valid result intervals found");
                 }
             }
         }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Sat Jun 09 20:10:05 2012 +0200
@@ -23,7 +23,7 @@
 package com.oracle.graal.compiler.alloc;
 
 import static com.oracle.graal.alloc.util.LocationUtil.*;
-import static com.oracle.graal.api.code.CiUtil.*;
+import static com.oracle.graal.api.code.CodeUtil.*;
 import java.util.*;
 
 import com.oracle.max.criutils.*;
@@ -49,13 +49,13 @@
  */
 public final class LinearScan {
 
-    final CiTarget target;
+    final TargetDescription target;
     final JavaMethod method;
     final LIR ir;
     final LIRGenerator gen;
     final FrameMap frameMap;
-    final CiRegisterAttributes[] registerAttributes;
-    final CiRegister[] registers;
+    final RegisterAttributes[] registerAttributes;
+    final Register[] registers;
 
     private static final int INITIAL_SPLIT_INTERVALS_CAPACITY = 32;
 
@@ -150,7 +150,7 @@
     private final int firstVariableNumber;
 
 
-    public LinearScan(CiTarget target, ResolvedJavaMethod method, LIR ir, LIRGenerator gen, FrameMap frameMap) {
+    public LinearScan(TargetDescription target, ResolvedJavaMethod method, LIR ir, LIRGenerator gen, FrameMap frameMap) {
         this.target = target;
         this.method = method;
         this.ir = ir;
@@ -172,7 +172,7 @@
 
     /**
      * Converts an operand (variable or register) to an index in a flat address space covering all the
-     * {@linkplain Variable variables} and {@linkplain CiRegisterValue registers} being processed by this
+     * {@linkplain Variable variables} and {@linkplain RegisterValue registers} being processed by this
      * allocator.
      */
     private int operandNumber(Value operand) {
@@ -238,7 +238,7 @@
     /**
      * Gets an object describing the attributes of a given register according to this register configuration.
      */
-    CiRegisterAttributes attributes(CiRegister reg) {
+    RegisterAttributes attributes(Register reg) {
         return registerAttributes[reg.number];
     }
 
@@ -248,7 +248,7 @@
         if (interval.spillSlot() != null) {
             interval.assignLocation(interval.spillSlot());
         } else {
-            CiStackSlot slot = frameMap.allocateSpillSlot(interval.kind());
+            StackSlot slot = frameMap.allocateSpillSlot(interval.kind());
             interval.setSpillSlot(slot);
             interval.assignLocation(slot);
         }
@@ -417,7 +417,7 @@
                 break;
 
             default:
-                throw new CiBailout("other states not allowed at this time");
+                throw new BailoutException("other states not allowed at this time");
         }
     }
 
@@ -456,7 +456,7 @@
                 break;
 
             default:
-                throw new CiBailout("other states not allowed at this time");
+                throw new BailoutException("other states not allowed at this time");
         }
     }
 
@@ -533,7 +533,7 @@
                         insertionBuffer.append(j + 1, ir.spillMoveFactory.createMove(toLocation, fromLocation));
 
                         if (GraalOptions.TraceLinearScanLevel >= 4) {
-                            CiStackSlot slot = interval.spillSlot();
+                            StackSlot slot = interval.spillSlot();
                             TTY.println("inserting move after definition of interval %d to stack slot %s at opId %d",
                                             interval.operandNumber, slot, opId);
                         }
@@ -826,7 +826,7 @@
             iterationCount++;
 
             if (changeOccurred && iterationCount > 50) {
-                throw new CiBailout("too many iterations in computeGlobalLiveSets");
+                throw new BailoutException("too many iterations in computeGlobalLiveSets");
             }
         } while (changeOccurred);
 
@@ -1050,7 +1050,7 @@
         if (op instanceof MoveOp) {
             MoveOp move = (MoveOp) op;
             if (isStackSlot(move.getInput()) && move.getInput().kind != Kind.Object) {
-                CiStackSlot slot = (CiStackSlot) move.getInput();
+                StackSlot slot = (StackSlot) move.getInput();
                 if (GraalOptions.DetailedAsserts) {
                     assert op.id() > 0 : "invalid id";
                     assert blockForId(op.id()).numberOfPreds() == 0 : "move from stack must be in first block";
@@ -1096,7 +1096,7 @@
         intervals = new Interval[intervalsSize + INITIAL_SPLIT_INTERVALS_CAPACITY];
 
         // create a list with all caller-save registers (cpu, fpu, xmm)
-        CiRegister[] callerSaveRegs = frameMap.registerConfig.getCallerSaveRegisters();
+        Register[] callerSaveRegs = frameMap.registerConfig.getCallerSaveRegisters();
 
         // iterate all blocks in reverse order
         for (int i = blockCount() - 1; i >= 0; i--) {
@@ -1138,7 +1138,7 @@
 
                 // add a temp range for each register if operation destroys caller-save registers
                 if (op.hasCall()) {
-                    for (CiRegister r : callerSaveRegs) {
+                    for (Register r : callerSaveRegs) {
                         if (attributes(r).isAllocatable) {
                             addTemp(r.asValue(), opId, RegisterPriority.None, Kind.Illegal);
                         }
@@ -1395,7 +1395,7 @@
             return result;
         }
 
-        throw new CiBailout("LinearScan: interval is null");
+        throw new BailoutException("LinearScan: interval is null");
     }
 
     Interval intervalAtBlockBegin(Block block, Value operand) {
@@ -1558,7 +1558,7 @@
         assert isRegister(location) || isStackSlot(location);
 
         if (isRegister(location)) {
-            CiRegister reg = asRegister(location);
+            Register reg = asRegister(location);
 
             // register
             switch (kind) {
@@ -1595,7 +1595,7 @@
         return true;
     }
 
-    static CiStackSlot canonicalSpillOpr(Interval interval) {
+    static StackSlot canonicalSpillOpr(Interval interval) {
         assert interval.spillSlot() != null : "canonical spill slot not set";
         return interval.spillSlot();
     }
@@ -2009,7 +2009,7 @@
                         TTY.println(i1.logString(this));
                         TTY.println(i2.logString(this));
                     }
-                    throw new CiBailout("");
+                    throw new BailoutException("");
                 }
             }
         }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Sat Jun 09 20:10:05 2012 +0200
@@ -23,13 +23,13 @@
 package com.oracle.graal.compiler.alloc;
 
 import static com.oracle.graal.alloc.util.LocationUtil.*;
-import static com.oracle.graal.api.code.CiUtil.*;
+import static com.oracle.graal.api.code.CodeUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.criutils.*;
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiRegister.*;
+import com.oracle.graal.api.code.Register.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.alloc.Interval.RegisterBinding;
@@ -47,7 +47,7 @@
 
     private final boolean hasCalleeSavedRegisters;
 
-    private CiRegister[] availableRegs;
+    private Register[] availableRegs;
 
     private final int[] usePos;
     private final int[] blockPos;
@@ -83,7 +83,7 @@
     }
 
     void initUseLists(boolean onlyProcessUsePos) {
-        for (CiRegister register : availableRegs) {
+        for (Register register : availableRegs) {
             int i = register.number;
             usePos[i] = Integer.MAX_VALUE;
 
@@ -607,13 +607,13 @@
         // only intervals overlapping with cur are processed, non-overlapping invervals can be ignored safely
         if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("      state of registers:");
-            for (CiRegister register : availableRegs) {
+            for (Register register : availableRegs) {
                 int i = register.number;
                 TTY.println("      reg %d: usePos: %d", register.number, usePos[i]);
             }
         }
 
-        CiRegister hint = null;
+        Register hint = null;
         Interval locationHint = interval.locationHint(true);
         if (locationHint != null && locationHint.location() != null && isRegister(locationHint.location())) {
             hint = asRegister(locationHint.location());
@@ -630,12 +630,12 @@
         boolean needSplit = false;
         int splitPos = -1;
 
-        CiRegister reg = null;
-        CiRegister minFullReg = null;
-        CiRegister maxPartialReg = null;
+        Register reg = null;
+        Register minFullReg = null;
+        Register maxPartialReg = null;
 
         for (int i = 0; i < availableRegs.length; ++i) {
-            CiRegister availableReg = availableRegs[i];
+            Register availableReg = availableRegs[i];
             int number = availableReg.number;
             if (usePos[number] >= intervalTo) {
                 // this register is free for the full interval
@@ -675,11 +675,11 @@
         return true;
     }
 
-    CiRegister findLockedRegister(int regNeededUntil, int intervalTo, Value ignoreReg, boolean[] needSplit) {
+    Register findLockedRegister(int regNeededUntil, int intervalTo, Value ignoreReg, boolean[] needSplit) {
         int maxReg = -1;
-        CiRegister ignore = isRegister(ignoreReg) ? asRegister(ignoreReg) : null;
+        Register ignore = isRegister(ignoreReg) ? asRegister(ignoreReg) : null;
 
-        for (CiRegister reg : availableRegs) {
+        for (Register reg : availableRegs) {
             int i = reg.number;
             if (reg == ignore) {
                 // this register must be ignored
@@ -701,7 +701,7 @@
         return null;
     }
 
-    void splitAndSpillIntersectingIntervals(CiRegister reg) {
+    void splitAndSpillIntersectingIntervals(Register reg) {
         assert reg != null : "no register assigned";
 
         for (int i = 0; i < spillIntervals[reg.number].size(); i++) {
@@ -728,7 +728,7 @@
 
         if (GraalOptions.TraceLinearScanLevel >= 4) {
             TTY.println("      state of registers:");
-            for (CiRegister reg : availableRegs) {
+            for (Register reg : availableRegs) {
                 int i = reg.number;
                 TTY.print("      reg %d: usePos: %d, blockPos: %d, intervals: ", i, usePos[i], blockPos[i]);
                 for (int j = 0; j < spillIntervals[i].size(); j++) {
@@ -744,9 +744,9 @@
         int intervalTo = interval.to();
         assert regNeededUntil > 0 && regNeededUntil < Integer.MAX_VALUE : "interval has no use";
 
-        CiRegister reg = null;
-        CiRegister ignore = interval.location() != null && isRegister(interval.location()) ? asRegister(interval.location()) : null;
-        for (CiRegister availableReg : availableRegs) {
+        Register reg = null;
+        Register ignore = interval.location() != null && isRegister(interval.location()) ? asRegister(interval.location()) : null;
+        for (Register availableReg : availableRegs) {
             int number = availableReg.number;
             if (availableReg == ignore) {
                 // this register must be ignored
@@ -767,7 +767,7 @@
                 assert false : "cannot spill interval that is used in first instruction (possible reason: no register found) firstUsage=" + firstUsage + ", interval.from()=" + interval.from();
                 // assign a reasonable register and do a bailout in product mode to avoid errors
                 allocator.assignSpillSlot(interval);
-                throw new CiBailout("LinearScan: no register found");
+                throw new BailoutException("LinearScan: no register found");
             }
 
             splitAndSpillInterval(interval);
@@ -822,7 +822,7 @@
     }
 
     void initVarsForAlloc(Interval interval) {
-        EnumMap<RegisterFlag, CiRegister[]> categorizedRegs = allocator.frameMap.registerConfig.getCategorizedAllocatableRegisters();
+        EnumMap<RegisterFlag, Register[]> categorizedRegs = allocator.frameMap.registerConfig.getCategorizedAllocatableRegisters();
         availableRegs = categorizedRegs.get(asVariable(interval.operand).flag);
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.compiler.alloc;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -277,7 +277,7 @@
                 // do not allocate a new spill slot for temporary interval, but
                 // use spill slot assigned to fromInterval. Otherwise moves from
                 // one stack slot to another can happen (not allowed by LIRAssembler
-                CiStackSlot spillSlot = fromInterval.spillSlot();
+                StackSlot spillSlot = fromInterval.spillSlot();
                 if (spillSlot == null) {
                     spillSlot = allocator.frameMap.allocateSpillSlot(spillInterval.kind());
                     fromInterval.setSpillSlot(spillSlot);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.compiler.alloc;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -180,7 +180,7 @@
 
     static void statePut(Interval[] inputState, Value location, Interval interval) {
         if (location != null && isRegister(location)) {
-            CiRegister reg = asRegister(location);
+            Register reg = asRegister(location);
             int regNum = reg.number;
             if (interval != null) {
                 if (GraalOptions.TraceLinearScanLevel >= 4) {
@@ -248,7 +248,7 @@
             op.forEachInput(useProc);
             // invalidate all caller save registers at calls
             if (op.hasCall()) {
-                for (CiRegister r : allocator.frameMap.registerConfig.getCallerSaveRegisters()) {
+                for (Register r : allocator.frameMap.registerConfig.getCallerSaveRegisters()) {
                     statePut(inputState, r.asValue(), null);
                 }
             }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Sat Jun 09 20:10:05 2012 +0200
@@ -43,13 +43,13 @@
     }
 
 
-    private HashMap<VirtualObjectNode, CiVirtualObject> virtualObjects = new HashMap<>();
+    private HashMap<VirtualObjectNode, VirtualObject> virtualObjects = new HashMap<>();
 
-    public LIRDebugInfo build(FrameState topState, LockScope locks, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge, long leafGraphId) {
+    public LIRDebugInfo build(FrameState topState, LockScope locks, List<StackSlot> pointerSlots, LabelRef exceptionEdge, long leafGraphId) {
         assert virtualObjects.size() == 0;
-        CiFrame frame = computeFrameForState(topState, locks, leafGraphId);
+        BytecodeFrame frame = computeFrameForState(topState, locks, leafGraphId);
 
-        CiVirtualObject[] virtualObjectsArray = null;
+        VirtualObject[] virtualObjectsArray = null;
         if (virtualObjects.size() != 0) {
             // collect all VirtualObjectField instances:
             IdentityHashMap<VirtualObjectNode, VirtualObjectFieldNode> objectStates = new IdentityHashMap<>();
@@ -75,8 +75,8 @@
             boolean changed;
             do {
                 changed = false;
-                IdentityHashMap<VirtualObjectNode, CiVirtualObject> virtualObjectsCopy = new IdentityHashMap<>(virtualObjects);
-                for (Entry<VirtualObjectNode, CiVirtualObject> entry : virtualObjectsCopy.entrySet()) {
+                IdentityHashMap<VirtualObjectNode, VirtualObject> virtualObjectsCopy = new IdentityHashMap<>(virtualObjects);
+                for (Entry<VirtualObjectNode, VirtualObject> entry : virtualObjectsCopy.entrySet()) {
                     if (entry.getValue().values() == null) {
                         VirtualObjectNode vobj = entry.getKey();
                         if (vobj instanceof BoxedVirtualObjectNode) {
@@ -107,14 +107,14 @@
                 }
             } while (changed);
 
-            virtualObjectsArray = virtualObjects.values().toArray(new CiVirtualObject[virtualObjects.size()]);
+            virtualObjectsArray = virtualObjects.values().toArray(new VirtualObject[virtualObjects.size()]);
             virtualObjects.clear();
         }
 
         return new LIRDebugInfo(frame, virtualObjectsArray, pointerSlots, exceptionEdge);
     }
 
-    private CiFrame computeFrameForState(FrameState state, LockScope locks, long leafGraphId) {
+    private BytecodeFrame computeFrameForState(FrameState state, LockScope locks, long leafGraphId) {
         int numLocals = state.localsSize();
         int numStack = state.stackSize();
         int numLocks = (locks != null && locks.callerState == state.outerFrameState()) ? locks.stateDepth + 1 : 0;
@@ -134,30 +134,30 @@
             Value owner = toCiValue(nextLock.monitor.object());
             Value lockData = nextLock.lockData;
             boolean eliminated = nextLock.monitor.eliminated();
-            values[numLocals + numStack + nextLock.stateDepth] = new CiMonitorValue(owner, lockData, eliminated);
+            values[numLocals + numStack + nextLock.stateDepth] = new MonitorValue(owner, lockData, eliminated);
 
             nextLock = nextLock.outer;
         }
 
-        CiFrame caller = null;
+        BytecodeFrame caller = null;
         if (state.outerFrameState() != null) {
             caller = computeFrameForState(state.outerFrameState(), nextLock, -1);
         } else {
             if (nextLock != null) {
-                throw new CiBailout("unbalanced monitors: found monitor for unknown frame");
+                throw new BailoutException("unbalanced monitors: found monitor for unknown frame");
             }
         }
         assert state.bci >= 0 || state.bci == FrameState.BEFORE_BCI;
-        CiFrame frame = new CiFrame(caller, state.method(), state.bci, state.rethrowException(), state.duringCall(), values, state.localsSize(), state.stackSize(), numLocks, leafGraphId);
+        BytecodeFrame frame = new BytecodeFrame(caller, state.method(), state.bci, state.rethrowException(), state.duringCall(), values, state.localsSize(), state.stackSize(), numLocks, leafGraphId);
         return frame;
     }
 
     private Value toCiValue(ValueNode value) {
         if (value instanceof VirtualObjectNode) {
             VirtualObjectNode obj = (VirtualObjectNode) value;
-            CiVirtualObject ciObj = virtualObjects.get(value);
+            VirtualObject ciObj = virtualObjects.get(value);
             if (ciObj == null) {
-                ciObj = CiVirtualObject.get(obj.type(), null, virtualObjects.size());
+                ciObj = VirtualObject.get(obj.type(), null, virtualObjects.size());
                 virtualObjects.put(obj, ciObj);
             }
             Debug.metric("StateVirtualObjects").increment();
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/InstructionPrinter.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/InstructionPrinter.java	Sat Jun 09 20:10:05 2012 +0200
@@ -124,7 +124,7 @@
              fillTo(USE.position + indentation, ' ').
              print("0").
              fillTo(VALUE.position + indentation, ' ').
-             print(ValueUtil.valueString(instruction)).
+             print(ValueNodeUtil.valueString(instruction)).
              fillTo(INSTRUCTION.position + indentation, ' ');
         printInstruction(instruction);
         if (instruction instanceof StateSplit) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,9 +22,9 @@
  */
 package com.oracle.graal.compiler.gen;
 
-import static com.oracle.graal.api.code.CiCallingConvention.Type.*;
+import static com.oracle.graal.api.code.CallingConvention.Type.*;
 import static com.oracle.graal.api.meta.Value.*;
-import static com.oracle.graal.lir.ValueUtil.*;
+import static com.oracle.graal.lir.LIRValueUtil.*;
 
 import java.util.*;
 import java.util.Map.Entry;
@@ -69,7 +69,7 @@
 public abstract class LIRGenerator extends LIRGeneratorTool {
     protected final Graph graph;
     protected final CodeCacheProvider runtime;
-    protected final CiTarget target;
+    protected final TargetDescription target;
     protected final ResolvedJavaMethod method;
     protected final FrameMap frameMap;
     public final NodeMap<Value> nodeOperands;
@@ -95,7 +95,7 @@
 
         /**
          * The frame state of the caller of the method performing the lock, or null if the outermost method
-         * performs the lock. This information is used to compute the {@link CiFrame} that this lock belongs to.
+         * performs the lock. This information is used to compute the {@link BytecodeFrame} that this lock belongs to.
          * We cannot use the actual frame state of the locking method, because it is not unique for a method. The
          * caller frame states are unique, i.e., all frame states of inlined methods refer to the same caller frame state.
          */
@@ -114,9 +114,9 @@
         /**
          * Space in the stack frame needed by the VM to perform the locking.
          */
-        public final CiStackSlot lockData;
+        public final StackSlot lockData;
 
-        public LockScope(LockScope outer, FrameState callerState, MonitorEnterNode monitor, CiStackSlot lockData) {
+        public LockScope(LockScope outer, FrameState callerState, MonitorEnterNode monitor, StackSlot lockData) {
             this.outer = outer;
             this.callerState = callerState;
             this.monitor = monitor;
@@ -142,7 +142,7 @@
     private LockScope curLocks;
 
 
-    public LIRGenerator(Graph graph, CodeCacheProvider runtime, CiTarget target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
+    public LIRGenerator(Graph graph, CodeCacheProvider runtime, TargetDescription target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, Assumptions assumptions) {
         this.graph = graph;
         this.runtime = runtime;
         this.target = target;
@@ -158,7 +158,7 @@
     }
 
     @Override
-    public CiTarget target() {
+    public TargetDescription target() {
         return target;
     }
 
@@ -197,10 +197,10 @@
             case Int:
             case Long:
             case Object:
-                return new Variable(stackKind, lir.nextVariable(), CiRegister.RegisterFlag.CPU);
+                return new Variable(stackKind, lir.nextVariable(), Register.RegisterFlag.CPU);
             case Float:
             case Double:
-                return new Variable(stackKind, lir.nextVariable(), CiRegister.RegisterFlag.FPU);
+                return new Variable(stackKind, lir.nextVariable(), Register.RegisterFlag.FPU);
             default:
                 throw GraalInternalError.shouldNotReachHere();
         }
@@ -240,7 +240,7 @@
             return value;
         }
         if (storeKind == Kind.Byte || storeKind == Kind.Boolean) {
-            Variable tempVar = new Variable(value.kind, lir.nextVariable(), CiRegister.RegisterFlag.Byte);
+            Variable tempVar = new Variable(value.kind, lir.nextVariable(), Register.RegisterFlag.Byte);
             emitMove(value, tempVar);
             return tempVar;
         }
@@ -269,7 +269,7 @@
         return stateFor(state, null, null, leafGraphId);
     }
 
-    public LIRDebugInfo stateFor(FrameState state, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge, long leafGraphId) {
+    public LIRDebugInfo stateFor(FrameState state, List<StackSlot> pointerSlots, LabelRef exceptionEdge, long leafGraphId) {
         return debugInfoBuilder.build(state, curLocks, pointerSlots, exceptionEdge, leafGraphId);
     }
 
@@ -337,7 +337,7 @@
             if (curLocks == null) {
                 curLocks = predLocks;
             } else if (curLocks != predLocks && (!pred.isLoopEnd() || predLocks != null)) {
-                throw new CiBailout("unbalanced monitors: predecessor blocks have different monitor states");
+                throw new BailoutException("unbalanced monitors: predecessor blocks have different monitor states");
             }
         }
 
@@ -503,13 +503,13 @@
     }
 
     protected void emitPrologue() {
-        CiCallingConvention incomingArguments = frameMap.registerConfig.getCallingConvention(JavaCallee, CiUtil.signatureToKinds(method), target, false);
+        CallingConvention incomingArguments = frameMap.registerConfig.getCallingConvention(JavaCallee, CodeUtil.signatureToKinds(method), target, false);
 
         Value[] params = new Value[incomingArguments.locations.length];
         for (int i = 0; i < params.length; i++) {
             params[i] = toStackKind(incomingArguments.locations[i]);
-            if (CiValueUtil.isStackSlot(params[i])) {
-                CiStackSlot slot = CiValueUtil.asStackSlot(params[i]);
+            if (ValueUtil.isStackSlot(params[i])) {
+                StackSlot slot = ValueUtil.asStackSlot(params[i]);
                 if (slot.inCallerFrame() && !lir.hasArgInCallerFrame()) {
                     lir.setHasArgInCallerFrame();
                 }
@@ -535,7 +535,7 @@
 
     @Override
     public void visitMonitorEnter(MonitorEnterNode x) {
-        CiStackSlot lockData = frameMap.allocateStackBlock(runtime.sizeOfLockData(), false);
+        StackSlot lockData = frameMap.allocateStackBlock(runtime.sizeOfLockData(), false);
         if (x.eliminated()) {
             // No code is emitted for eliminated locks, but for proper debug information generation we need to
             // register the monitor and its lock data.
@@ -559,14 +559,14 @@
     @Override
     public void visitMonitorExit(MonitorExitNode x) {
         if (curLocks == null || curLocks.monitor.object() != x.object() || curLocks.monitor.eliminated() != x.eliminated()) {
-            throw new CiBailout("unbalanced monitors: attempting to unlock an object that is not on top of the locking stack");
+            throw new BailoutException("unbalanced monitors: attempting to unlock an object that is not on top of the locking stack");
         }
         if (x.eliminated()) {
             curLocks = curLocks.outer;
             return;
         }
 
-        CiStackSlot lockData = curLocks.lockData;
+        StackSlot lockData = curLocks.lockData;
         XirArgument obj = toXirArgument(x.object());
         XirArgument lockAddress = lockData == null ? null : toXirArgument(emitLea(lockData));
 
@@ -685,7 +685,7 @@
     }
 
     @Override
-    public void emitGuardCheck(BooleanNode comp, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+    public void emitGuardCheck(BooleanNode comp, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated, long leafGraphId) {
         if (comp instanceof IsNullNode && negated) {
             emitNullCheckGuard(((IsNullNode) comp).object(), leafGraphId);
         } else if (comp instanceof ConstantNode && (comp.asConstant().asBoolean() != negated)) {
@@ -883,8 +883,8 @@
 
         Value resultOperand = resultOperandFor(x.node().kind());
 
-        Kind[] signature = CiUtil.signatureToKinds(callTarget.targetMethod().signature(), callTarget.isStatic() ? null : callTarget.targetMethod().holder().kind());
-        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(JavaCall, signature, target(), false);
+        Kind[] signature = CodeUtil.signatureToKinds(callTarget.targetMethod().signature(), callTarget.isStatic() ? null : callTarget.targetMethod().holder().kind());
+        CallingConvention cc = frameMap.registerConfig.getCallingConvention(JavaCall, signature, target(), false);
         frameMap.callsMethod(cc, JavaCall);
         List<Value> argList = visitInvokeArguments(cc, callTarget.arguments());
 
@@ -911,7 +911,7 @@
             if (isRegister(value)) {
                 return asRegister(value).asValue(value.kind.stackKind());
             } else if (isStackSlot(value)) {
-                return CiStackSlot.get(value.kind.stackKind(), asStackSlot(value).rawOffset(), asStackSlot(value).rawAddFrameSize());
+                return StackSlot.get(value.kind.stackKind(), asStackSlot(value).rawOffset(), asStackSlot(value).rawAddFrameSize());
             } else {
                 throw GraalInternalError.shouldNotReachHere();
             }
@@ -919,7 +919,7 @@
         return value;
     }
 
-    public List<Value> visitInvokeArguments(CiCallingConvention cc, Iterable<ValueNode> arguments) {
+    public List<Value> visitInvokeArguments(CallingConvention cc, Iterable<ValueNode> arguments) {
         // for each argument, load it into the correct location
         List<Value> argList = new ArrayList<>();
         int j = 0;
@@ -937,7 +937,7 @@
     }
 
 
-    protected abstract LabelRef createDeoptStub(CiDeoptAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo);
+    protected abstract LabelRef createDeoptStub(DeoptimizationAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo);
 
     @Override
     public Variable emitCall(@SuppressWarnings("hiding") Object target, Kind result, Kind[] arguments, boolean canTrap, Value... args) {
@@ -948,7 +948,7 @@
         List<Value> argumentList;
         if (arguments.length > 0) {
             // move the arguments into the correct location
-            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
+            CallingConvention 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++) {
@@ -977,7 +977,7 @@
         // TODO Merge with emitCallToRuntime() method above.
 
         Value resultOperand = resultOperandFor(x.kind());
-        CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, x.call().arguments, target(), false);
+        CallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, x.call().arguments, target(), false);
         frameMap.callsMethod(cc, RuntimeCall);
         List<Value> argList = visitInvokeArguments(cc, x.arguments());
 
@@ -1156,7 +1156,7 @@
         }
         Variable variable = load(value);
         if (var.kind == Kind.Byte || var.kind == Kind.Boolean) {
-            Variable tempVar = new Variable(value.kind, lir.nextVariable(), CiRegister.RegisterFlag.Byte);
+            Variable tempVar = new Variable(value.kind, lir.nextVariable(), Register.RegisterFlag.Byte);
             emitMove(variable, tempVar);
             variable = tempVar;
         }
@@ -1277,7 +1277,7 @@
     protected abstract void emitXir(XirSnippet snippet, Value[] operands, Value outputOperand, Value[] inputs, Value[] temps, int[] inputOperandIndices, int[] tempOperandIndices, int outputOperandIndex,
                     LIRDebugInfo info, LIRDebugInfo infoAfter, LabelRef trueSuccessor, LabelRef falseSuccessor);
 
-    protected final Value callRuntime(CiRuntimeCall runtimeCall, LIRDebugInfo info, Value... args) {
+    protected final Value callRuntime(RuntimeCall runtimeCall, LIRDebugInfo info, Value... args) {
         // get a result register
         Kind result = runtimeCall.resultKind;
         Kind[] arguments = runtimeCall.arguments;
@@ -1287,7 +1287,7 @@
         List<Value> argumentList;
         if (arguments.length > 0) {
             // move the arguments into the correct location
-            CiCallingConvention cc = frameMap.registerConfig.getCallingConvention(RuntimeCall, arguments, target(), false);
+            CallingConvention 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++) {
@@ -1307,7 +1307,7 @@
         return physReg;
     }
 
-    protected final Variable callRuntimeWithResult(CiRuntimeCall runtimeCall, LIRDebugInfo info, Value... args) {
+    protected final Variable callRuntimeWithResult(RuntimeCall runtimeCall, LIRDebugInfo info, Value... args) {
         Value location = callRuntime(runtimeCall, info, args);
         return emitMove(location);
     }
@@ -1386,12 +1386,12 @@
      * Implements site-specific information for the XIR interface.
      */
     static class XirSupport implements XirSite {
-        final CiAssumptions assumptions;
+        final Assumptions assumptions;
         ValueNode current;
         ValueNode receiver;
 
 
-        public XirSupport(CiAssumptions assumptions) {
+        public XirSupport(Assumptions assumptions) {
             this.assumptions = assumptions;
         }
 
@@ -1419,7 +1419,7 @@
             return true;
         }
 
-        public CiAssumptions assumptions() {
+        public Assumptions assumptions() {
             return assumptions;
         }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java	Sat Jun 09 20:10:05 2012 +0200
@@ -23,7 +23,7 @@
 package com.oracle.graal.compiler.gen;
 
 import static com.oracle.graal.api.meta.Value.*;
-import static com.oracle.graal.lir.ValueUtil.*;
+import static com.oracle.graal.lir.LIRValueUtil.*;
 
 import java.util.*;
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Sat Jun 09 20:10:05 2012 +0200
@@ -40,8 +40,8 @@
     public static final DebugMetric METRIC_GLOBAL_VALUE_NUMBERING_HITS = Debug.metric("GlobalValueNumberingHits");
 
     private final int newNodesMark;
-    private final CiTarget target;
-    private final CiAssumptions assumptions;
+    private final TargetDescription target;
+    private final Assumptions assumptions;
     private final CodeCacheProvider runtime;
     private final IsImmutablePredicate immutabilityPredicate;
     private final Iterable<Node> initWorkingSet;
@@ -49,7 +49,7 @@
     private NodeWorkList workList;
     private Tool tool;
 
-    public CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions) {
+    public CanonicalizerPhase(TargetDescription target, CodeCacheProvider runtime, Assumptions assumptions) {
         this(target, runtime, assumptions, null, 0, null);
     }
 
@@ -60,7 +60,7 @@
      * @param workingSet the initial working set of nodes on which the canonicalizer works, should be an auto-grow node bitmap
      * @param immutabilityPredicate
      */
-    public CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions, Iterable<Node> workingSet, IsImmutablePredicate immutabilityPredicate) {
+    public CanonicalizerPhase(TargetDescription target, CodeCacheProvider runtime, Assumptions assumptions, Iterable<Node> workingSet, IsImmutablePredicate immutabilityPredicate) {
         this(target, runtime, assumptions, workingSet, 0, immutabilityPredicate);
     }
 
@@ -68,11 +68,11 @@
      * @param newNodesMark only the {@linkplain Graph#getNewNodes(int) new nodes} specified by
      *            this mark are processed otherwise all nodes in the graph are processed
      */
-    public CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
+    public CanonicalizerPhase(TargetDescription target, CodeCacheProvider runtime, Assumptions assumptions, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
         this(target, runtime, assumptions, null, newNodesMark, immutabilityPredicate);
     }
 
-    private CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions, Iterable<Node> workingSet, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
+    private CanonicalizerPhase(TargetDescription target, CodeCacheProvider runtime, Assumptions assumptions, Iterable<Node> workingSet, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
         this.newNodesMark = newNodesMark;
         this.target = target;
         this.assumptions = assumptions;
@@ -224,11 +224,11 @@
 
         private final NodeWorkList nodeWorkSet;
         private final CodeCacheProvider runtime;
-        private final CiTarget target;
-        private final CiAssumptions assumptions;
+        private final TargetDescription target;
+        private final Assumptions assumptions;
         private final IsImmutablePredicate immutabilityPredicate;
 
-        public Tool(NodeWorkList nodeWorkSet, CodeCacheProvider runtime, CiTarget target, CiAssumptions assumptions, IsImmutablePredicate immutabilityPredicate) {
+        public Tool(NodeWorkList nodeWorkSet, CodeCacheProvider runtime, TargetDescription target, Assumptions assumptions, IsImmutablePredicate immutabilityPredicate) {
             this.nodeWorkSet = nodeWorkSet;
             this.runtime = runtime;
             this.target = target;
@@ -246,7 +246,7 @@
          * @return the current target or {@code null} if no target is available in the current context.
          */
         @Override
-        public CiTarget target() {
+        public TargetDescription target() {
             return target;
         }
 
@@ -254,7 +254,7 @@
          * @return an object that can be used for recording assumptions or {@code null} if assumptions are not allowed in the current context.
          */
         @Override
-        public CiAssumptions assumptions() {
+        public Assumptions assumptions() {
             return assumptions;
         }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java	Sat Jun 09 20:10:05 2012 +0200
@@ -240,14 +240,14 @@
         }
     }
 
-    private final CiTarget target;
+    private final TargetDescription target;
     private final ExtendedRiRuntime runtime;
-    private final CiAssumptions assumptions;
+    private final Assumptions assumptions;
     private final RiGraphCache cache;
     private final PhasePlan plan;
     private final OptimisticOptimizations optimisticOpts;
 
-    public EscapeAnalysisPhase(CiTarget target, ExtendedRiRuntime runtime, CiAssumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) {
+    public EscapeAnalysisPhase(TargetDescription target, ExtendedRiRuntime runtime, Assumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) {
         this.runtime = runtime;
         this.target = target;
         this.assumptions = assumptions;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java	Sat Jun 09 20:10:05 2012 +0200
@@ -47,13 +47,13 @@
      * - honor the result of overrideInliningDecision(0, caller, invoke.bci, method, true);
      */
 
-    private final CiTarget target;
+    private final TargetDescription target;
     private final ExtendedRiRuntime runtime;
 
     private final Collection<? extends Invoke> hints;
 
     private final PriorityQueue<InlineInfo> inlineCandidates = new PriorityQueue<>();
-    private CiAssumptions assumptions;
+    private Assumptions assumptions;
 
     private final PhasePlan plan;
     private final RiGraphCache cache;
@@ -66,7 +66,7 @@
     private static final DebugMetric metricInliningConsidered = Debug.metric("InliningConsidered");
     private static final DebugMetric metricInliningStoppedByMaxDesiredSize = Debug.metric("InliningStoppedByMaxDesiredSize");
 
-    public InliningPhase(CiTarget target, ExtendedRiRuntime runtime, Collection<? extends Invoke> hints, CiAssumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) {
+    public InliningPhase(TargetDescription target, ExtendedRiRuntime runtime, Collection<? extends Invoke> hints, Assumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) {
         this.target = target;
         this.runtime = runtime;
         this.hints = hints;
@@ -114,7 +114,7 @@
 //                        new IntrinsificationPhase(runtime).apply(graph);
 //                    }
                     metricInliningPerformed.increment();
-                } catch (CiBailout bailout) {
+                } catch (BailoutException bailout) {
                     // TODO determine if we should really bail out of the whole compilation.
                     throw bailout;
                 } catch (AssertionError e) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java	Sat Jun 09 20:10:05 2012 +0200
@@ -52,30 +52,30 @@
 
         @Override
         public ValueNode createNullCheckGuard(ValueNode object, long leafGraphId) {
-            return createGuard(object.graph().unique(new IsNullNode(object)), DeoptimizationReason.NullCheckException, CiDeoptAction.InvalidateReprofile, true, leafGraphId);
+            return createGuard(object.graph().unique(new IsNullNode(object)), DeoptimizationReason.NullCheckException, DeoptimizationAction.InvalidateReprofile, true, leafGraphId);
         }
 
         @Override
-        public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, long leafGraphId) {
+        public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, long leafGraphId) {
             return createGuard(condition, deoptReason, action, false, leafGraphId);
         }
 
         @Override
-        public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+        public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated, long leafGraphId) {
             // TODO (thomaswue): Document why this must not be called on floating nodes.
             throw new UnsupportedOperationException();
         }
 
         @Override
-        public CiAssumptions assumptions() {
+        public Assumptions assumptions() {
             return assumptions;
         }
     }
 
     private final ExtendedRiRuntime runtime;
-    private final CiAssumptions assumptions;
+    private final Assumptions assumptions;
 
-    public LoweringPhase(ExtendedRiRuntime runtime, CiAssumptions assumptions) {
+    public LoweringPhase(ExtendedRiRuntime runtime, Assumptions assumptions) {
         this.runtime = runtime;
         this.assumptions = assumptions;
     }
@@ -150,7 +150,7 @@
             }
 
             @Override
-            public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+            public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated, long leafGraphId) {
                 FixedNode guardAnchor = (FixedNode) getGuardAnchor();
                 if (GraalOptions.OptEliminateGuards) {
                     for (Node usage : condition.usages()) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Sat Jun 09 20:10:05 2012 +0200
@@ -59,7 +59,7 @@
         if (intrinsic != null) {
             assert target.getAnnotation(Node.Fold.class) == null;
 
-            Class< ? >[] parameterTypes = CiUtil.signatureToTypes(target.signature(), target.holder());
+            Class< ? >[] parameterTypes = CodeUtil.signatureToTypes(target.signature(), target.holder());
 
             // Prepare the arguments for the reflective constructor call on the node class.
             Object[] nodeConstructorArguments = prepareArguments(invoke, parameterTypes, target, false);
@@ -75,7 +75,7 @@
             // Clean up checkcast instructions inserted by javac if the return type is generic.
             cleanUpReturnCheckCast(newInstance);
         } else if (target.getAnnotation(Node.Fold.class) != null) {
-            Class< ? >[] parameterTypes = CiUtil.signatureToTypes(target.signature(), target.holder());
+            Class< ? >[] parameterTypes = CodeUtil.signatureToTypes(target.signature(), target.holder());
 
             // Prepare the arguments for the reflective method call
             Object[] arguments = prepareArguments(invoke, parameterTypes, target, true);
@@ -117,7 +117,7 @@
                 parameterIndex--;
             }
             ValueNode argument = tryBoxingElimination(parameterIndex, target, arguments.get(i));
-            if (folding || CiUtil.getParameterAnnotation(ConstantNodeParameter.class, parameterIndex, target) != null) {
+            if (folding || CodeUtil.getParameterAnnotation(ConstantNodeParameter.class, parameterIndex, target) != null) {
                 assert argument instanceof ConstantNode : "parameter " + parameterIndex + " must be a compile time constant for calling " + invoke.callTarget().targetMethod() + ": " + argument;
                 ConstantNode constantNode = (ConstantNode) argument;
                 Constant constant = constantNode.asConstant();
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java	Sat Jun 09 20:10:05 2012 +0200
@@ -40,14 +40,14 @@
 
     /**
      * The name of the system property whose value (if non-null) specifies the fully qualified
-     * name of the class to be instantiated by {@link #create(CodeCacheProvider, CiTarget)}.
+     * name of the class to be instantiated by {@link #create(CodeCacheProvider, TargetDescription)}.
      */
     public static final String BACKEND_CLASS_PROPERTY = "graal.compiler.backend.class";
 
     public final CodeCacheProvider runtime;
-    public final CiTarget target;
+    public final TargetDescription target;
 
-    protected Backend(CodeCacheProvider runtime, CiTarget target) {
+    protected Backend(CodeCacheProvider runtime, TargetDescription target) {
         this.runtime = runtime;
         this.target = target;
     }
@@ -56,23 +56,23 @@
      * Creates the architecture and runtime specific back-end object.
      * The class of the object instantiated must be in the {@link #BACKEND_CLASS_PROPERTY} system property.
      */
-    public static Backend create(CodeCacheProvider runtime, CiTarget target) {
+    public static Backend create(CodeCacheProvider runtime, TargetDescription target) {
         String className = System.getProperty(BACKEND_CLASS_PROPERTY);
         assert className != null : "System property must be defined: " + BACKEND_CLASS_PROPERTY;
         try {
             Class<?> c = Class.forName(className);
-            Constructor<?> cons = c.getDeclaredConstructor(CodeCacheProvider.class, CiTarget.class);
+            Constructor<?> cons = c.getDeclaredConstructor(CodeCacheProvider.class, TargetDescription.class);
             return (Backend) cons.newInstance(runtime, target);
         } catch (Exception e) {
             throw new Error("Could not instantiate " + className, e);
         }
     }
 
-    public FrameMap newFrameMap(CiRegisterConfig registerConfig) {
+    public FrameMap newFrameMap(RegisterConfig registerConfig) {
         return new FrameMap(runtime, target, registerConfig);
     }
 
-    public abstract LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions);
+    public abstract LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, Assumptions assumptions);
 
     public abstract TargetMethodAssembler newAssembler(FrameMap frameMap, LIR lir);
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Sat Jun 09 20:10:05 2012 +0200
@@ -36,11 +36,11 @@
 public class AMD64DeoptimizationStub extends AMD64Code {
     public final Label label = new Label();
     public final LIRDebugInfo info;
-    public final CiDeoptAction action;
+    public final DeoptimizationAction action;
     public final DeoptimizationReason reason;
     public final Object deoptInfo;
 
-    public AMD64DeoptimizationStub(CiDeoptAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo) {
+    public AMD64DeoptimizationStub(DeoptimizationAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo) {
         this.action = action;
         this.reason = reason;
         this.info = info;
@@ -52,7 +52,7 @@
     @Override
     public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
         // TODO (cwimmer): we want to get rid of a generally reserved scratch register.
-        CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
+        Register scratch = tasm.frameMap.registerConfig.getScratchRegister();
 
         masm.bind(label);
         if (GraalOptions.CreateDeoptInfo && deoptInfo != null) {
@@ -60,12 +60,12 @@
             keepAlive.add(deoptInfo.toString());
             AMD64Move.move(tasm, masm, scratch.asValue(), Constant.forObject(deoptInfo));
             // TODO Make this an explicit calling convention instead of using a scratch register
-            AMD64Call.directCall(tasm, masm, CiRuntimeCall.SetDeoptInfo, info);
+            AMD64Call.directCall(tasm, masm, RuntimeCall.SetDeoptInfo, info);
         }
 
         masm.movl(scratch, tasm.runtime.encodeDeoptActionAndReason(action, reason));
         // TODO Make this an explicit calling convention instead of using a scratch register
-        AMD64Call.directCall(tasm, masm, CiRuntimeCall.Deoptimize, info);
+        AMD64Call.directCall(tasm, masm, RuntimeCall.Deoptimize, info);
         AMD64Call.shouldNotReachHere(tasm, masm);
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Sat Jun 09 20:10:05 2012 +0200
@@ -23,7 +23,7 @@
 
 package com.oracle.graal.compiler.target.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 import static com.oracle.graal.lir.amd64.AMD64Arithmetic.*;
 import static com.oracle.graal.lir.amd64.AMD64Compare.*;
 
@@ -44,7 +44,7 @@
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.StandardOp.JumpOp;
 import com.oracle.graal.lir.StandardOp.LabelOp;
-import com.oracle.graal.lir.ValueUtil;
+import com.oracle.graal.lir.LIRValueUtil;
 import com.oracle.graal.lir.amd64.AMD64Arithmetic.DivOp;
 import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op1Reg;
 import com.oracle.graal.lir.amd64.AMD64Arithmetic.Op1Stack;
@@ -79,11 +79,11 @@
  */
 public abstract class AMD64LIRGenerator extends LIRGenerator {
 
-    private static final CiRegisterValue RAX_I = AMD64.rax.asValue(Kind.Int);
-    private static final CiRegisterValue RAX_L = AMD64.rax.asValue(Kind.Long);
-    private static final CiRegisterValue RDX_I = AMD64.rdx.asValue(Kind.Int);
-    private static final CiRegisterValue RDX_L = AMD64.rdx.asValue(Kind.Long);
-    private static final CiRegisterValue RCX_I = AMD64.rcx.asValue(Kind.Int);
+    private static final RegisterValue RAX_I = AMD64.rax.asValue(Kind.Int);
+    private static final RegisterValue RAX_L = AMD64.rax.asValue(Kind.Long);
+    private static final RegisterValue RDX_I = AMD64.rdx.asValue(Kind.Int);
+    private static final RegisterValue RDX_L = AMD64.rdx.asValue(Kind.Long);
+    private static final RegisterValue RCX_I = AMD64.rcx.asValue(Kind.Int);
 
     public static class AMD64SpillMoveFactory implements LIR.SpillMoveFactory {
         @Override
@@ -98,7 +98,7 @@
         }
     }
 
-    public AMD64LIRGenerator(Graph graph, CodeCacheProvider runtime, CiTarget target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
+    public AMD64LIRGenerator(Graph graph, CodeCacheProvider runtime, TargetDescription target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, Assumptions assumptions) {
         super(graph, runtime, target, frameMap, method, lir, xir, assumptions);
         lir.spillMoveFactory = new AMD64SpillMoveFactory();
     }
@@ -133,7 +133,7 @@
     }
 
     @Override
-    public CiAddress makeAddress(LocationNode location, ValueNode object) {
+    public Address makeAddress(LocationNode location, ValueNode object) {
         Value base = operand(object);
         Value index = Value.IllegalValue;
         int scale = 1;
@@ -168,7 +168,7 @@
             }
         }
 
-        return new CiAddress(location.getValueKind(), base, index, CiAddress.Scale.fromInt(scale), (int) displacement);
+        return new Address(location.getValueKind(), base, index, Address.Scale.fromInt(scale), (int) displacement);
     }
 
     @Override
@@ -259,7 +259,7 @@
         Variable left;
         Value right;
         boolean mirrored;
-        if (ValueUtil.isVariable(b)) {
+        if (LIRValueUtil.isVariable(b)) {
             left = load(b);
             right = loadNonConst(a);
             mirrored = true;
@@ -370,9 +370,9 @@
                 append(new DivOp(LREM, RDX_L, RAX_L, load(b), state()));
                 return emitMove(RDX_L);
             case Float:
-                return emitCall(CiRuntimeCall.ArithmeticFrem, false, a, b);
+                return emitCall(RuntimeCall.ArithmeticFrem, false, a, b);
             case Double:
-                return emitCall(CiRuntimeCall.ArithmeticDrem, false, a, b);
+                return emitCall(RuntimeCall.ArithmeticDrem, false, a, b);
             default:
                 throw GraalInternalError.shouldNotReachHere();
         }
@@ -519,7 +519,7 @@
 
 
     @Override
-    public void emitDeoptimizeOnOverflow(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo) {
+    public void emitDeoptimizeOnOverflow(DeoptimizationAction action, DeoptimizationReason reason, Object deoptInfo) {
         LIRDebugInfo info = state();
         LabelRef stubEntry = createDeoptStub(action, reason, info, deoptInfo);
         append(new BranchOp(ConditionFlag.overflow, stubEntry, info));
@@ -527,7 +527,7 @@
 
 
     @Override
-    public void emitDeoptimize(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo, long leafGraphId) {
+    public void emitDeoptimize(DeoptimizationAction action, DeoptimizationReason reason, Object deoptInfo, long leafGraphId) {
         LIRDebugInfo info = state(leafGraphId);
         LabelRef stubEntry = createDeoptStub(action, reason, info, deoptInfo);
         append(new JumpOp(stubEntry, info));
@@ -569,7 +569,7 @@
     }
 
     @Override
-    protected LabelRef createDeoptStub(CiDeoptAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo) {
+    protected LabelRef createDeoptStub(DeoptimizationAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo) {
         assert info.topFrame.bci >= 0 : "invalid bci for deopt framestate";
         AMD64DeoptimizationStub stub = new AMD64DeoptimizationStub(action, reason, info, deoptInfo);
         lir.stubs.add(stub);
@@ -591,17 +591,17 @@
         Value expected = loadNonConst(operand(node.expected()));
         Variable newValue = load(operand(node.newValue()));
 
-        CiAddress address;
+        Address address;
         int displacement = node.displacement();
         Value index = operand(node.offset());
         if (isConstant(index) && NumUtil.isInt(asConstant(index).asLong())) {
             displacement += (int) asConstant(index).asLong();
-            address = new CiAddress(kind, load(operand(node.object())), displacement);
+            address = new Address(kind, load(operand(node.object())), displacement);
         } else {
-            address = new CiAddress(kind, load(operand(node.object())), load(index), CiAddress.Scale.Times1, displacement);
+            address = new Address(kind, load(operand(node.object())), load(index), Address.Scale.Times1, displacement);
         }
 
-        CiRegisterValue rax = AMD64.rax.asValue(kind);
+        RegisterValue rax = AMD64.rax.asValue(kind);
         emitMove(expected, rax);
         append(new CompareAndSwapOp(rax, address, rax, newValue));
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirAssembler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirAssembler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -36,7 +36,7 @@
  *
  */
 public class AMD64XirAssembler extends CiXirAssembler {
-    public AMD64XirAssembler(CiTarget target) {
+    public AMD64XirAssembler(TargetDescription target) {
         super(target);
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,8 +22,8 @@
  */
 package com.oracle.graal.compiler.target.amd64;
 
-import static com.oracle.graal.api.code.CiCallingConvention.Type.*;
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.CallingConvention.Type.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 import static com.oracle.graal.api.meta.Value.*;
 
 import java.util.*;
@@ -163,9 +163,9 @@
                 case PointerLoad: {
                     Value result = operands[inst.result.index];
                     Value pointer = operands[inst.x().index];
-                    CiRegisterValue register = assureInRegister(tasm, masm, pointer);
+                    RegisterValue register = assureInRegister(tasm, masm, pointer);
 
-                    AMD64Move.load(tasm, masm, result, new CiAddress(inst.kind, register), (Boolean) inst.extra ? info : null);
+                    AMD64Move.load(tasm, masm, result, new Address(inst.kind, register), (Boolean) inst.extra ? info : null);
                     break;
                 }
 
@@ -174,7 +174,7 @@
                     Value pointer = operands[inst.x().index];
                     assert isRegister(pointer);
 
-                    AMD64Move.store(tasm, masm, new CiAddress(inst.kind, pointer), value, (Boolean) inst.extra ? info : null);
+                    AMD64Move.store(tasm, masm, new Address(inst.kind, pointer), value, (Boolean) inst.extra ? info : null);
                     break;
                 }
 
@@ -182,7 +182,7 @@
                     CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
                     boolean canTrap = addressInformation.canTrap;
 
-                    CiAddress.Scale scale = addressInformation.scale;
+                    Address.Scale scale = addressInformation.scale;
                     int displacement = addressInformation.disp;
 
                     Value result = operands[inst.result.index];
@@ -192,13 +192,13 @@
                     pointer = assureInRegister(tasm, masm, pointer);
                     assert isRegister(pointer);
 
-                    CiAddress src;
+                    Address src;
                     if (isConstant(index)) {
                         assert index.kind == Kind.Int;
                         Constant constantIndex = (Constant) index;
-                        src = new CiAddress(inst.kind, pointer, constantIndex.asInt() * scale.value + displacement);
+                        src = new Address(inst.kind, pointer, constantIndex.asInt() * scale.value + displacement);
                     } else {
-                        src = new CiAddress(inst.kind, pointer, index, scale, displacement);
+                        src = new Address(inst.kind, pointer, index, scale, displacement);
                     }
 
                     AMD64Move.load(tasm, masm, result, src, canTrap ? info : null);
@@ -208,7 +208,7 @@
                 case LoadEffectiveAddress: {
                     CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
 
-                    CiAddress.Scale scale = addressInformation.scale;
+                    Address.Scale scale = addressInformation.scale;
                     int displacement = addressInformation.disp;
 
                     Value result = operands[inst.result.index];
@@ -217,7 +217,7 @@
 
                     pointer = assureInRegister(tasm, masm, pointer);
                     assert isRegister(pointer);
-                    CiAddress src = new CiAddress(Kind.Illegal, pointer, index, scale, displacement);
+                    Address src = new Address(Kind.Illegal, pointer, index, scale, displacement);
                     masm.leaq(asRegister(result), src);
                     break;
                 }
@@ -226,7 +226,7 @@
                     CiXirAssembler.AddressAccessInformation addressInformation = (CiXirAssembler.AddressAccessInformation) inst.extra;
                     boolean canTrap = addressInformation.canTrap;
 
-                    CiAddress.Scale scale = addressInformation.scale;
+                    Address.Scale scale = addressInformation.scale;
                     int displacement = addressInformation.disp;
 
                     Value value = assureNot64BitConstant(tasm, masm, operands[inst.z().index]);
@@ -236,13 +236,13 @@
                     pointer = assureInRegister(tasm, masm, pointer);
                     assert isRegister(pointer);
 
-                    CiAddress dst;
+                    Address dst;
                     if (isConstant(index)) {
                         assert index.kind == Kind.Int;
                         Constant constantIndex = (Constant) index;
-                        dst = new CiAddress(inst.kind, pointer, IllegalValue, scale, constantIndex.asInt() * scale.value + displacement);
+                        dst = new Address(inst.kind, pointer, IllegalValue, scale, constantIndex.asInt() * scale.value + displacement);
                     } else {
-                        dst = new CiAddress(inst.kind, pointer, index, scale, displacement);
+                        dst = new Address(inst.kind, pointer, index, scale, displacement);
                     }
 
                     AMD64Move.store(tasm, masm, dst, value, canTrap ? info : null);
@@ -268,8 +268,8 @@
 
                     Value exchangedVal = operands[inst.y().index];
                     Value exchangedAddress = operands[inst.x().index];
-                    CiRegisterValue pointerRegister = assureInRegister(tasm, masm, exchangedAddress);
-                    CiAddress addr = new CiAddress(tasm.target.wordKind, pointerRegister);
+                    RegisterValue pointerRegister = assureInRegister(tasm, masm, exchangedAddress);
+                    Address addr = new Address(tasm.target.wordKind, pointerRegister);
 
                     if ((Boolean) inst.extra && info != null) {
                         tasm.recordImplicitException(masm.codeBuffer.position(), info);
@@ -284,7 +284,7 @@
                         signature[i] = inst.arguments[i].kind;
                     }
 
-                    CiCallingConvention cc = tasm.frameMap.registerConfig.getCallingConvention(RuntimeCall, signature, tasm.target, false);
+                    CallingConvention cc = tasm.frameMap.registerConfig.getCallingConvention(RuntimeCall, signature, tasm.target, false);
                     for (int i = 0; i < inst.arguments.length; i++) {
                         Value argumentLocation = cc.locations[i];
                         Value argumentSourceLocation = operands[inst.arguments[i].index];
@@ -297,7 +297,7 @@
                     AMD64Call.directCall(tasm, masm, runtimeCallInformation.target, (runtimeCallInformation.useInfoAfter) ? infoAfter : info);
 
                     if (inst.result != null && inst.result.kind != Kind.Illegal && inst.result.kind != Kind.Void) {
-                        CiRegister returnRegister = tasm.frameMap.registerConfig.getReturnRegister(inst.result.kind);
+                        Register returnRegister = tasm.frameMap.registerConfig.getReturnRegister(inst.result.kind);
                         Value resultLocation = returnRegister.asValue(inst.result.kind.stackKind());
                         AMD64Move.move(tasm, masm, operands[inst.result.index], resultLocation);
                     }
@@ -373,7 +373,7 @@
                     assert isConstant(offset) && isConstant(bit);
                     Constant constantOffset = (Constant) offset;
                     Constant constantBit = (Constant) bit;
-                    CiAddress src = new CiAddress(inst.kind, pointer, constantOffset.asInt());
+                    Address src = new Address(inst.kind, pointer, constantOffset.asInt());
                     masm.btli(src, constantBit.asInt());
                     masm.jcc(ConditionFlag.aboveEqual, label);
                     break;
@@ -397,7 +397,7 @@
                     break;
                 }
                 case Push: {
-                    CiRegisterValue value = assureInRegister(tasm, masm, operands[inst.x().index]);
+                    RegisterValue value = assureInRegister(tasm, masm, operands[inst.x().index]);
                     masm.push(asRegister(value));
                     break;
                 }
@@ -406,7 +406,7 @@
                     if (isRegister(result)) {
                         masm.pop(asRegister(result));
                     } else {
-                        CiRegister rscratch = tasm.frameMap.registerConfig.getScratchRegister();
+                        Register rscratch = tasm.frameMap.registerConfig.getScratchRegister();
                         masm.pop(rscratch);
                         AMD64Move.move(tasm, masm, result, rscratch.asValue());
                     }
@@ -476,21 +476,21 @@
 
     private static Value assureNot64BitConstant(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value value) {
         if (isConstant(value) && (value.kind == Kind.Long || value.kind == Kind.Object)) {
-            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(value.kind);
+            RegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(value.kind);
             AMD64Move.move(tasm, masm, register, value);
             return register;
         }
         return value;
     }
 
-    private static CiRegisterValue assureInRegister(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value pointer) {
+    private static RegisterValue assureInRegister(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value pointer) {
         if (isConstant(pointer)) {
-            CiRegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(pointer.kind);
+            RegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(pointer.kind);
             AMD64Move.move(tasm, masm, register, pointer);
             return register;
         }
 
         assert isRegister(pointer) : "should be register, but is: " + pointer;
-        return (CiRegisterValue) pointer;
+        return (RegisterValue) pointer;
     }
 }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypeCachePhase.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypeCachePhase.java	Sat Jun 09 20:10:05 2012 +0200
@@ -41,9 +41,9 @@
 
     private static final boolean DUMP = false;
 
-    private final CiTarget target;
+    private final TargetDescription target;
     private final CodeCacheProvider runtime;
-    private final CiAssumptions assumptions;
+    private final Assumptions assumptions;
 
     private StructuredGraph currentGraph;
     private SchedulePhase schedule;
@@ -64,7 +64,7 @@
 //        });
 //    }
 
-    public PropagateTypeCachePhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions) {
+    public PropagateTypeCachePhase(TargetDescription target, CodeCacheProvider runtime, Assumptions assumptions) {
         this.target = target;
         this.runtime = runtime;
         this.assumptions = assumptions;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java	Sat Jun 09 20:10:05 2012 +0200
@@ -55,9 +55,9 @@
         if (!Debug.isLogEnabled()) {
             return null;
         } else if (invoke != null && invoke.stateAfter() != null) {
-            return methodName(invoke.stateAfter(), invoke.bci()) + ": " + CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
+            return methodName(invoke.stateAfter(), invoke.bci()) + ": " + CodeUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
         } else {
-            return CiUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
+            return CodeUtil.format("%H.%n(%p):%r", method) + " (" + method.codeSize() + " bytes)";
         }
     }
 
@@ -77,7 +77,7 @@
             sb.append(methodName(frameState.outerFrameState(), frameState.outerFrameState().bci));
             sb.append("->");
         }
-        sb.append(CiUtil.format("%h.%n", frameState.method()));
+        sb.append(CodeUtil.format("%h.%n", frameState.method()));
         sb.append("@").append(bci);
         return sb.toString();
     }
@@ -154,7 +154,7 @@
 
         @Override
         public String toString() {
-            return "exact " + CiUtil.format("%H.%n(%p):%r", concrete);
+            return "exact " + CodeUtil.format("%H.%n(%p):%r", concrete);
         }
 
         @Override
@@ -189,7 +189,7 @@
             ValueNode receiver = invoke.callTarget().receiver();
             ReadHubNode objectClass = graph.add(new ReadHubNode(receiver));
             IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClass, type));
-            FixedGuardNode guard = graph.add(new FixedGuardNode(isTypeNode, DeoptimizationReason.TypeCheckedInliningViolated, CiDeoptAction.InvalidateReprofile, invoke.leafGraphId()));
+            FixedGuardNode guard = graph.add(new FixedGuardNode(isTypeNode, DeoptimizationReason.TypeCheckedInliningViolated, DeoptimizationAction.InvalidateReprofile, invoke.leafGraphId()));
             AnchorNode anchor = graph.add(new AnchorNode());
             assert invoke.predecessor() != null;
 
@@ -208,7 +208,7 @@
 
         @Override
         public String toString() {
-            return "type-checked " + CiUtil.format("%H.%n(%p):%r", concrete);
+            return "type-checked " + CodeUtil.format("%H.%n(%p):%r", concrete);
         }
 
         @Override
@@ -315,7 +315,7 @@
             if (shouldFallbackToInvoke()) {
                 unknownTypeNode = createInvocationBlock(graph, invoke, returnMerge, returnValuePhi, exceptionMerge, exceptionObjectPhi, 1, notRecordedTypeProbability, false);
             } else {
-                unknownTypeNode = graph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
+                unknownTypeNode = graph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
             }
 
             // replace the invoke exception edge
@@ -380,7 +380,7 @@
             ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver()));
             graph.addBeforeFixed(invoke.node(), objectClassNode);
 
-            FixedNode unknownTypeNode = graph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
+            FixedNode unknownTypeNode = graph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
             FixedNode dispatchOnType = createDispatchOnType(graph, objectClassNode, new BeginNode[] {calleeEntryNode}, unknownTypeNode);
 
             FixedWithNextNode pred = (FixedWithNextNode) invoke.node().predecessor();
@@ -497,7 +497,7 @@
             StringBuilder builder = new StringBuilder(shouldFallbackToInvoke() ? "megamorphic" : "polymorphic");
             builder.append(String.format(", %d methods with %d type checks:", concretes.size(), ptypes.length));
             for (int i = 0; i < concretes.size(); i++) {
-                builder.append(CiUtil.format("  %H.%n(%p):%r", concretes.get(i)));
+                builder.append(CodeUtil.format("  %H.%n(%p):%r", concretes.get(i)));
             }
             return builder.toString();
         }
@@ -524,8 +524,8 @@
         @Override
         public void inline(StructuredGraph graph, ExtendedRiRuntime runtime, InliningCallback callback) {
             if (Debug.isLogEnabled()) {
-                String targetName = CiUtil.format("%H.%n(%p):%r", invoke.callTarget().targetMethod());
-                String concreteName = CiUtil.format("%H.%n(%p):%r", concrete);
+                String targetName = CodeUtil.format("%H.%n(%p):%r", invoke.callTarget().targetMethod());
+                String concreteName = CodeUtil.format("%H.%n(%p):%r", concrete);
                 Debug.log("recording concrete method assumption: %s on receiver type %s -> %s", targetName, context, concreteName);
             }
             callback.recordConcreteMethodAssumption(invoke.callTarget().targetMethod(), context, concrete);
@@ -535,7 +535,7 @@
 
         @Override
         public String toString() {
-            return "assumption " + CiUtil.format("%H.%n(%p):%r", concrete);
+            return "assumption " + CodeUtil.format("%H.%n(%p):%r", concrete);
         }
 
         @Override
@@ -552,7 +552,7 @@
      * @param callback a callback that is used to determine the weight of a specific inlining
      * @return an instance of InlineInfo, or null if no inlining is possible at the given invoke
      */
-    public static InlineInfo getInlineInfo(Invoke invoke, int level, ExtendedRiRuntime runtime, CiAssumptions assumptions, InliningCallback callback, OptimisticOptimizations optimisticOpts) {
+    public static InlineInfo getInlineInfo(Invoke invoke, int level, ExtendedRiRuntime runtime, Assumptions assumptions, InliningCallback callback, OptimisticOptimizations optimisticOpts) {
         ResolvedJavaMethod parent = invoke.stateAfter().method();
         MethodCallTargetNode callTarget = invoke.callTarget();
         ResolvedJavaMethod targetMethod = callTarget.targetMethod();
@@ -828,7 +828,7 @@
         } else {
             if (unwindNode != null) {
                 UnwindNode unwindDuplicate = (UnwindNode) duplicates.get(unwindNode);
-                DeoptimizeNode deoptimizeNode = new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.NotCompiledExceptionHandler, invoke.leafGraphId());
+                DeoptimizeNode deoptimizeNode = new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.NotCompiledExceptionHandler, invoke.leafGraphId());
                 unwindDuplicate.replaceAndDelete(graph.add(deoptimizeNode));
                 // move the deopt upwards if there is a monitor exit that tries to use the "after exception" frame state
                 // (because there is no "after exception" frame state!)
@@ -908,7 +908,7 @@
         NodeInputList<ValueNode> parameters = callTarget.arguments();
         ValueNode firstParam = parameters.size() <= 0 ? null : parameters.get(0);
         if (!callTarget.isStatic() && firstParam.kind() == Kind.Object && !firstParam.objectStamp().nonNull()) {
-            graph.addBeforeFixed(invoke.node(), graph.add(new FixedGuardNode(graph.unique(new IsNullNode(firstParam)), DeoptimizationReason.ClassCastException, CiDeoptAction.InvalidateReprofile, true, invoke.leafGraphId())));
+            graph.addBeforeFixed(invoke.node(), graph.add(new FixedGuardNode(graph.unique(new IsNullNode(firstParam)), DeoptimizationReason.ClassCastException, DeoptimizationAction.InvalidateReprofile, true, invoke.leafGraphId())));
         }
     }
 }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/Util.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/Util.java	Sat Jun 09 20:10:05 2012 +0200
@@ -132,31 +132,31 @@
     }
 
     static {
-        assert CiUtil.log2(2) == 1;
-        assert CiUtil.log2(4) == 2;
-        assert CiUtil.log2(8) == 3;
-        assert CiUtil.log2(16) == 4;
-        assert CiUtil.log2(32) == 5;
-        assert CiUtil.log2(0x40000000) == 30;
+        assert CodeUtil.log2(2) == 1;
+        assert CodeUtil.log2(4) == 2;
+        assert CodeUtil.log2(8) == 3;
+        assert CodeUtil.log2(16) == 4;
+        assert CodeUtil.log2(32) == 5;
+        assert CodeUtil.log2(0x40000000) == 30;
 
-        assert CiUtil.log2(2L) == 1;
-        assert CiUtil.log2(4L) == 2;
-        assert CiUtil.log2(8L) == 3;
-        assert CiUtil.log2(16L) == 4;
-        assert CiUtil.log2(32L) == 5;
-        assert CiUtil.log2(0x4000000000000000L) == 62;
+        assert CodeUtil.log2(2L) == 1;
+        assert CodeUtil.log2(4L) == 2;
+        assert CodeUtil.log2(8L) == 3;
+        assert CodeUtil.log2(16L) == 4;
+        assert CodeUtil.log2(32L) == 5;
+        assert CodeUtil.log2(0x4000000000000000L) == 62;
 
-        assert !CiUtil.isPowerOf2(3);
-        assert !CiUtil.isPowerOf2(5);
-        assert !CiUtil.isPowerOf2(7);
-        assert !CiUtil.isPowerOf2(-1);
+        assert !CodeUtil.isPowerOf2(3);
+        assert !CodeUtil.isPowerOf2(5);
+        assert !CodeUtil.isPowerOf2(7);
+        assert !CodeUtil.isPowerOf2(-1);
 
-        assert CiUtil.isPowerOf2(2);
-        assert CiUtil.isPowerOf2(4);
-        assert CiUtil.isPowerOf2(8);
-        assert CiUtil.isPowerOf2(16);
-        assert CiUtil.isPowerOf2(32);
-        assert CiUtil.isPowerOf2(64);
+        assert CodeUtil.isPowerOf2(2);
+        assert CodeUtil.isPowerOf2(4);
+        assert CodeUtil.isPowerOf2(8);
+        assert CodeUtil.isPowerOf2(16);
+        assert CodeUtil.isPowerOf2(32);
+        assert CodeUtil.isPowerOf2(64);
     }
 
     /**
@@ -186,7 +186,7 @@
 
     public static void guarantee(boolean b, String string) {
         if (!b) {
-            throw new CiBailout(string);
+            throw new BailoutException(string);
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationStatistics.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,212 @@
+/*
+ * 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
+ * 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.graal.hotspot;
+
+import java.io.*;
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import com.oracle.graal.api.code.*;
+import com.oracle.graal.api.meta.*;
+
+@SuppressWarnings("unused")
+public final class CompilationStatistics {
+
+    private static final long RESOLUTION = 100000000;
+    private static final boolean TIMELINE_ENABLED = System.getProperty("stats.timeline.file") != null;
+    private static final boolean COMPILATIONSTATS_ENABLED = System.getProperty("stats.compilations.file") != null;
+    private static final boolean ENABLED = TIMELINE_ENABLED || COMPILATIONSTATS_ENABLED;
+
+    private static final CompilationStatistics DUMMY = new CompilationStatistics(null);
+
+    private static ConcurrentLinkedDeque<CompilationStatistics> list = new ConcurrentLinkedDeque<>();
+
+    private static final ThreadLocal<Deque<CompilationStatistics>> current = new ThreadLocal<Deque<CompilationStatistics>>() {
+
+        @Override
+        protected Deque<CompilationStatistics> initialValue() {
+            return new ArrayDeque<>();
+        }
+    };
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.FIELD)
+    private static @interface AbsoluteTimeValue {
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.FIELD)
+    private static @interface TimeValue {
+    }
+
+    private static long zeroTime = System.nanoTime();
+
+    private final String holder;
+    private final String name;
+    private final String signature;
+    @AbsoluteTimeValue
+    private final long startTime;
+    @TimeValue
+    private long duration;
+    private int startInvCount;
+    private int endInvCount;
+    private int bytecodeCount;
+    private int codeSize;
+    private int deoptCount;
+
+    private CompilationStatistics(ResolvedJavaMethod method) {
+        if (method != null) {
+            holder = CodeUtil.format("%H", method);
+            name = method.name();
+            signature = CodeUtil.format("%p", method);
+            startTime = System.nanoTime();
+            startInvCount = method.invocationCount();
+            bytecodeCount = method.codeSize();
+        } else {
+            holder = "";
+            name = "";
+            signature = "";
+            startTime = 0;
+        }
+    }
+
+    public void finish(ResolvedJavaMethod method) {
+        if (ENABLED) {
+            duration = System.nanoTime() - startTime;
+            endInvCount = method.invocationCount();
+            codeSize = method.compiledCodeSize();
+            if (current.get().getLast() != this) {
+                throw new RuntimeException("mismatch in finish()");
+            }
+            current.get().removeLast();
+        }
+    }
+
+    public static CompilationStatistics current() {
+        return current.get().isEmpty() ? null : current.get().getLast();
+    }
+
+    public static CompilationStatistics create(ResolvedJavaMethod method) {
+        if (ENABLED) {
+            CompilationStatistics stats = new CompilationStatistics(method);
+            list.add(stats);
+            current.get().addLast(stats);
+            return stats;
+        } else {
+            return DUMMY;
+        }
+    }
+
+    @SuppressWarnings("deprecation")
+    public static void clear(String dumpName) {
+        if (!ENABLED) {
+            return;
+        }
+        try {
+            ConcurrentLinkedDeque<CompilationStatistics> snapshot = list;
+            long snapshotZeroTime = zeroTime;
+
+            list = new ConcurrentLinkedDeque<>();
+            zeroTime = System.nanoTime();
+
+            Date now = new Date();
+            String dateString = (now.getYear() + 1900) + "_" + (now.getMonth() + 1) + "_" + now.getDate() + " " + now.getHours() + "_" + now.getMinutes() + "_" + now.getSeconds();
+            try (PrintStream out = new PrintStream("compilations " + dateString + " " + dumpName + ".csv")) {
+                // output the list of all compilations
+
+                Field[] declaredFields = CompilationStatistics.class.getDeclaredFields();
+                ArrayList<Field> fields = new ArrayList<>();
+                for (Field field : declaredFields) {
+                    if (!Modifier.isStatic(field.getModifiers())) {
+                        fields.add(field);
+                    }
+                }
+                for (Field field : fields) {
+                    out.print(field.getName() + ";");
+                }
+                out.println();
+                for (CompilationStatistics stats : snapshot) {
+                    for (Field field : fields) {
+                        if (field.isAnnotationPresent(AbsoluteTimeValue.class)) {
+                            double value = (field.getLong(stats) - snapshotZeroTime) / 1000000d;
+                            out.print(String.format(Locale.ENGLISH, "%.3f", value) + ";");
+                        } else if (field.isAnnotationPresent(TimeValue.class)) {
+                            double value = field.getLong(stats) / 1000000d;
+                            out.print(String.format(Locale.ENGLISH, "%.3f", value) + ";");
+                        } else {
+                            out.print(field.get(stats) + ";");
+                        }
+                    }
+                    out.println();
+                }
+            }
+
+            String timelineFile = System.getProperty("stats.timeline.file");
+            if (timelineFile == null || timelineFile.isEmpty()) {
+                timelineFile = "timeline " + dateString;
+            }
+            try (FileOutputStream fos = new FileOutputStream(timelineFile + " " + dumpName + ".csv", true); PrintStream out = new PrintStream(fos)) {
+
+                long[] timeSpent = new long[10000];
+                int maxTick = 0;
+                for (CompilationStatistics stats : snapshot) {
+                    long start = stats.startTime - snapshotZeroTime;
+                    long duration = stats.duration;
+                    if (start < 0) {
+                        duration -= -start;
+                        start = 0;
+                    }
+
+                    int tick = (int) (start / RESOLUTION);
+                    long timeLeft = RESOLUTION - (start % RESOLUTION);
+
+                    while (tick < timeSpent.length && duration > 0) {
+                        if (tick > maxTick) {
+                            maxTick = tick;
+                        }
+                        timeSpent[tick] += Math.min(timeLeft, duration);
+                        duration -= timeLeft;
+                        tick++;
+                        timeLeft = RESOLUTION;
+                    }
+                }
+                String timelineName = System.getProperty("stats.timeline.name");
+                if (timelineName != null && !timelineName.isEmpty()) {
+                    out.print(timelineName + ";");
+                }
+                for (int i = 0; i <= maxTick; i++) {
+                    out.print((timeSpent[i] * 100 / RESOLUTION) + ";");
+                }
+                out.println();
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public void setDeoptCount(int count) {
+        this.deoptCount = count;
+    }
+}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Sat Jun 09 20:10:05 2012 +0200
@@ -101,7 +101,7 @@
     }
 
     public void runCompilation() {
-        CiCompilationStatistics stats = CiCompilationStatistics.create(method);
+        CompilationStatistics stats = CompilationStatistics.create(method);
         try {
             final boolean printCompilation = GraalOptions.PrintCompilation && !TTY.isSuppressed();
             if (printCompilation) {
@@ -128,14 +128,14 @@
             }
 
             installMethod(result);
-        } catch (CiBailout bailout) {
+        } catch (BailoutException bailout) {
             Debug.metric("Bailouts").increment();
             if (GraalOptions.ExitVMOnBailout) {
-                TTY.cachedOut.println(CiUtil.format("Bailout in %H.%n(%p)", method));
+                TTY.cachedOut.println(CodeUtil.format("Bailout in %H.%n(%p)", method));
                 bailout.printStackTrace(TTY.cachedOut);
                 System.exit(-1);
             } else if (GraalOptions.PrintBailout) {
-                TTY.cachedOut.println(CiUtil.format("Bailout in %H.%n(%p)", method));
+                TTY.cachedOut.println(CodeUtil.format("Bailout in %H.%n(%p)", method));
                 bailout.printStackTrace(TTY.cachedOut);
             }
         } catch (Throwable t) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Sat Jun 09 20:10:05 2012 +0200
@@ -144,7 +144,7 @@
 
     @Override
     public RuntimeException interceptException(Throwable e) {
-        if (e instanceof CiBailout) {
+        if (e instanceof BailoutException) {
             return null;
         }
         Debug.setConfig(Debug.fixedConfig(true, true, false, false, dumpHandlers, output));
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Sat Jun 09 20:10:05 2012 +0200
@@ -51,7 +51,7 @@
 
     private HotSpotRuntime runtime;
     private GraalCompiler compiler;
-    private CiTarget target;
+    private TargetDescription target;
     private volatile HotSpotGraphCache cache;
 
     private final HotSpotVMConfig config;
@@ -99,11 +99,11 @@
         }
     }
 
-    public CiTarget getTarget() {
+    public TargetDescription getTarget() {
         if (target == null) {
             final int wordSize = 8;
             final int stackFrameAlignment = 16;
-            target = new CiTarget(new AMD64(), true, stackFrameAlignment, config.vmPageSize, wordSize, true, true, true);
+            target = new TargetDescription(new AMD64(), true, stackFrameAlignment, config.vmPageSize, wordSize, true, true, true);
         }
 
         return target;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Sat Jun 09 20:10:05 2012 +0200
@@ -101,7 +101,7 @@
 
     JavaMethod getRiMethod(Method reflectionMethod);
 
-    long getMaxCallTargetOffset(CiRuntimeCall rtcall);
+    long getMaxCallTargetOffset(RuntimeCall rtcall);
 
     String disassembleNative(byte[] code, long address);
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Sat Jun 09 20:10:05 2012 +0200
@@ -144,7 +144,7 @@
     public native int RiMethod_getCompiledCodeSize(HotSpotMethodResolved method);
 
     @Override
-    public native long getMaxCallTargetOffset(CiRuntimeCall rtcall);
+    public native long getMaxCallTargetOffset(RuntimeCall rtcall);
 
     @Override
     public native String disassembleNative(byte[] code, long address);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Sat Jun 09 20:10:05 2012 +0200
@@ -29,7 +29,6 @@
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
-import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.phases.*;
@@ -211,14 +210,14 @@
                 }
             }
         } while ((System.currentTimeMillis() - startTime) <= GraalOptions.TimedBootstrap);
-        CiCompilationStatistics.clear("bootstrap");
+        CompilationStatistics.clear("bootstrap");
 
         TTY.println(" in %d ms", System.currentTimeMillis() - startTime);
         if (compiler.getCache() != null) {
             compiler.getCache().clear();
         }
         System.gc();
-        CiCompilationStatistics.clear("bootstrap2");
+        CompilationStatistics.clear("bootstrap2");
         MethodEntryCounters.printCounters(compiler);
     }
 
@@ -284,7 +283,7 @@
                 }
             }
         }
-        CiCompilationStatistics.clear("final");
+        CompilationStatistics.clear("final");
         MethodEntryCounters.printCounters(compiler);
         HotSpotXirGenerator.printCounters(TTY.out().out());
         CheckCastSnippets.printCounters(TTY.out().out());
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.hotspot.counters;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -53,7 +53,7 @@
         protected long sortCount;
 
         protected Counter(ResolvedJavaMethod method) {
-            this.method = CiUtil.format("%H.%n", method);
+            this.method = CodeUtil.format("%H.%n", method);
             counters.add(this);
         }
 
@@ -85,12 +85,12 @@
             int scale = Unsafe.getUnsafe().arrayIndexScale(long[].class);
 
             AMD64Move.move(tasm, masm, counterArr, Constant.forObject(counter.counts));
-            AMD64Move.load(tasm, masm, callerPc, new CiAddress(Kind.Long, AMD64.rbp.asValue(Kind.Long), 8), null);
+            AMD64Move.load(tasm, masm, callerPc, new Address(Kind.Long, AMD64.rbp.asValue(Kind.Long), 8), null);
 
             Label done = new Label();
             for (int i = 0; i < counter.counts.length - 2; i += 2) {
-                CiAddress counterPcAddr = new CiAddress(Kind.Long, counterArr, i * scale + off);
-                CiAddress counterValueAddr = new CiAddress(Kind.Long, counterArr, (i + 1) * scale + off);
+                Address counterPcAddr = new Address(Kind.Long, counterArr, i * scale + off);
+                Address counterValueAddr = new Address(Kind.Long, counterArr, (i + 1) * scale + off);
 
                 Label skipClaim = new Label();
                 masm.cmpq(counterPcAddr, 0);
@@ -106,7 +106,7 @@
                 masm.bind(skipInc);
             }
 
-            CiAddress counterValueAddr = new CiAddress(Kind.Long, counterArr, (counter.counts.length - 1) * scale + off);
+            Address counterValueAddr = new Address(Kind.Long, counterArr, (counter.counts.length - 1) * scale + off);
             masm.addq(counterValueAddr, 1);
             masm.bind(done);
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Sat Jun 09 20:10:05 2012 +0200
@@ -40,7 +40,7 @@
 
     @Override
     public void generate(LIRGeneratorTool generator) {
-        generator.setResult(this, generator.emitLoad(new CiAddress(Kind.Object, AMD64.r15.asValue(generator.target().wordKind), threadObjectOffset), false));
+        generator.setResult(this, generator.emitLoad(new Address(Kind.Object, AMD64.r15.asValue(generator.target().wordKind), threadObjectOffset), false));
     }
 
     @SuppressWarnings("unused")
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -61,16 +61,16 @@
         ResolvedJavaMethod method = frameState.method();
         boolean isStatic = Modifier.isStatic(method.accessFlags());
 
-        Kind[] signature = CiUtil.signatureToKinds(method.signature(), isStatic ? null : method.holder().kind());
-        CiCallingConvention cc = gen.frameMap().registerConfig.getCallingConvention(CiCallingConvention.Type.JavaCall, signature, gen.target(), false);
-        gen.frameMap().callsMethod(cc, CiCallingConvention.Type.JavaCall); // TODO (aw): I think this is unnecessary for a tail call.
+        Kind[] signature = CodeUtil.signatureToKinds(method.signature(), isStatic ? null : method.holder().kind());
+        CallingConvention cc = gen.frameMap().registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, signature, gen.target(), false);
+        gen.frameMap().callsMethod(cc, CallingConvention.Type.JavaCall); // TODO (aw): I think this is unnecessary for a tail call.
         List<ValueNode> parameters = new ArrayList<>();
         for (int i = 0, slot = 0; i < cc.locations.length; i++, slot += FrameStateBuilder.stackSlots(frameState.localAt(slot).kind())) {
             parameters.add(frameState.localAt(slot));
         }
         List<Value> argList = gen.visitInvokeArguments(cc, parameters);
 
-        Value entry = gen.emitLoad(new CiAddress(Kind.Long, gen.operand(target), config.nmethodEntryOffset), false);
+        Value entry = gen.emitLoad(new Address(Kind.Long, gen.operand(target), config.nmethodEntryOffset), false);
 
         gen.append(new AMD64TailcallOp(argList, entry, cc.locations));
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java	Sat Jun 09 20:10:05 2012 +0200
@@ -46,6 +46,6 @@
         } else {
             base = gen.emitAdd(base, Constant.forLong(config.cardtableStartAddress));
         }
-        gen.emitStore(new CiAddress(Kind.Boolean, base, displacement), Constant.FALSE, false);
+        gen.emitStore(new Address(Kind.Boolean, base, displacement), Constant.FALSE, false);
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Sat Jun 09 20:10:05 2012 +0200
@@ -70,14 +70,14 @@
     }
 
     private boolean checkArgs(Object... args) {
-        Kind[] sig = CiUtil.signatureToKinds(method);
-        assert args.length == sig.length : CiUtil.format("%H.%n(%p): expected ", method) + sig.length + " args, got " + args.length;
+        Kind[] sig = CodeUtil.signatureToKinds(method);
+        assert args.length == sig.length : CodeUtil.format("%H.%n(%p): expected ", method) + sig.length + " args, got " + args.length;
         for (int i = 0; i < sig.length; i++) {
             Object arg = args[i];
             if (arg == null) {
-                assert sig[i].isObject() : CiUtil.format("%H.%n(%p): expected arg ", method) + i + " to be Object, not " + sig[i];
+                assert sig[i].isObject() : CodeUtil.format("%H.%n(%p): expected arg ", method) + i + " to be Object, not " + sig[i];
             } else if (!sig[i].isObject()) {
-                assert sig[i].toBoxedJavaClass() == arg.getClass() : CiUtil.format("%H.%n(%p): expected arg ", method) + i + " to be " + sig[i] + ", not " + arg.getClass();
+                assert sig[i].toBoxedJavaClass() == arg.getClass() : CodeUtil.format("%H.%n(%p): expected arg ", method) + i + " to be " + sig[i] + ", not " + arg.getClass();
             }
         }
         return true;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Sat Jun 09 20:10:05 2012 +0200
@@ -112,7 +112,7 @@
 
     @Override
     public String toString() {
-        return "HotSpotField<" + CiUtil.format("%h.%n", this) + ":" + offset + ">";
+        return "HotSpotField<" + CodeUtil.format("%h.%n", this) + ":" + offset + ">";
     }
 
     @Override
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Sat Jun 09 20:10:05 2012 +0200
@@ -165,7 +165,7 @@
 
     @Override
     public String toString() {
-        return "HotSpotMethod<" + CiUtil.format("%h.%n", this) + ">";
+        return "HotSpotMethod<" + CodeUtil.format("%h.%n", this) + ">";
     }
 
     public boolean hasCompiledCode() {
@@ -315,7 +315,7 @@
 
     private Method toJava() {
         try {
-            return holder.toJava().getDeclaredMethod(name, CiUtil.signatureToTypes(signature(), holder));
+            return holder.toJava().getDeclaredMethod(name, CodeUtil.signatureToTypes(signature(), holder));
         } catch (NoSuchMethodException e) {
             return null;
         }
@@ -323,7 +323,7 @@
 
     private Constructor toJavaConstructor() {
         try {
-            return holder.toJava().getDeclaredConstructor(CiUtil.signatureToTypes(signature(), holder));
+            return holder.toJava().getDeclaredConstructor(CodeUtil.signatureToTypes(signature(), holder));
         } catch (NoSuchMethodException e) {
             return null;
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java	Sat Jun 09 20:10:05 2012 +0200
@@ -149,6 +149,6 @@
 
     @Override
     public String toString() {
-        return "HotSpotProfilingInfo<" + CiUtil.profileToString(this, null, "; ") + ">";
+        return "HotSpotProfilingInfo<" + CodeUtil.profileToString(this, null, "; ") + ">";
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRegisterConfig.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRegisterConfig.java	Sat Jun 09 20:10:05 2012 +0200
@@ -28,98 +28,98 @@
 
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiCallingConvention.*;
-import com.oracle.graal.api.code.CiRegister.*;
+import com.oracle.graal.api.code.CallingConvention.*;
+import com.oracle.graal.api.code.Register.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.hotspot.*;
 
-public class HotSpotRegisterConfig implements CiRegisterConfig {
+public class HotSpotRegisterConfig implements RegisterConfig {
 
     // be careful - the contents of this array are duplicated in graal_CodeInstaller.cpp
-    private final CiRegister[] allocatable = {
+    private final Register[] allocatable = {
         rax, rbx, rcx, rdx, rsi, rdi, r8, r9, /* r10, */r11, r12, r13, r14, /*r15*/
         xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
         xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
     };
 
-    private final EnumMap<RegisterFlag, CiRegister[]> categorized = CiRegister.categorize(allocatable);
+    private final EnumMap<RegisterFlag, Register[]> categorized = Register.categorize(allocatable);
 
-    private final CiRegisterAttributes[] attributesMap;
+    private final RegisterAttributes[] attributesMap;
 
     @Override
-    public CiRegister[] getAllocatableRegisters() {
+    public Register[] getAllocatableRegisters() {
         return allocatable;
     }
 
     @Override
-    public EnumMap<RegisterFlag, CiRegister[]> getCategorizedAllocatableRegisters() {
+    public EnumMap<RegisterFlag, Register[]> getCategorizedAllocatableRegisters() {
         return categorized;
     }
 
     @Override
-    public CiRegisterAttributes[] getAttributesMap() {
+    public RegisterAttributes[] getAttributesMap() {
         return attributesMap;
     }
 
-    private final CiRegister[] generalParameterRegisters;
-    private final CiRegister[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7};
-    private final CiRegister[] allParameterRegisters;
+    private final Register[] generalParameterRegisters;
+    private final Register[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7};
+    private final Register[] allParameterRegisters;
 
-    private final CiCalleeSaveLayout csl;
+    private final CalleeSaveLayout csl;
 
     public HotSpotRegisterConfig(HotSpotVMConfig config, boolean globalStubConfig) {
         if (config.windowsOs) {
-            generalParameterRegisters = new CiRegister[] {rdx, r8, r9, rdi, rsi, rcx};
+            generalParameterRegisters = new Register[] {rdx, r8, r9, rdi, rsi, rcx};
         } else {
-            generalParameterRegisters = new CiRegister[] {rsi, rdx, rcx, r8, r9, rdi};
+            generalParameterRegisters = new Register[] {rsi, rdx, rcx, r8, r9, rdi};
         }
 
         if (globalStubConfig) {
-            CiRegister[] regs = {
+            Register[] regs = {
                 rax,  rcx,  rdx,   rbx,   rsp,   rbp,   rsi,   rdi,
                 r8,   r9,   r10,   r11,   r12,   r13,   r14,   r15,
                 xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
                 xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
             };
-            csl = new CiCalleeSaveLayout(0, -1, 8, regs);
+            csl = new CalleeSaveLayout(0, -1, 8, regs);
         } else {
             // We reserve space for saving RBP but don't explicitly specify
             // it as a callee save register since we explicitly do the saving
             // with push and pop in HotSpotFrameContext
             final int size = 8;
-            final CiRegister[] regs = {};
-            csl = new CiCalleeSaveLayout(0, size, 8, regs);
+            final Register[] regs = {};
+            csl = new CalleeSaveLayout(0, size, 8, regs);
         }
 
-        attributesMap = CiRegisterAttributes.createMap(this, AMD64.allRegisters);
+        attributesMap = RegisterAttributes.createMap(this, AMD64.allRegisters);
         allParameterRegisters = Arrays.copyOf(generalParameterRegisters, generalParameterRegisters.length + xmmParameterRegisters.length);
         System.arraycopy(xmmParameterRegisters, 0, allParameterRegisters, generalParameterRegisters.length, xmmParameterRegisters.length);
     }
 
     @Override
-    public CiRegister[] getCallerSaveRegisters() {
+    public Register[] getCallerSaveRegisters() {
         return getAllocatableRegisters();
     }
 
     @Override
-    public CiRegister getRegisterForRole(int index) {
+    public Register getRegisterForRole(int index) {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public CiCallingConvention getCallingConvention(Type type, Kind[] parameters, CiTarget target, boolean stackOnly) {
+    public CallingConvention getCallingConvention(Type type, Kind[] parameters, TargetDescription target, boolean stackOnly) {
         if (type == Type.NativeCall) {
             throw new UnsupportedOperationException();
         }
         return callingConvention(parameters, type, target, stackOnly);
     }
 
-    public CiRegister[] getCallingConventionRegisters(Type type, RegisterFlag flag) {
+    public Register[] getCallingConventionRegisters(Type type, RegisterFlag flag) {
         return allParameterRegisters;
     }
 
-    private CiCallingConvention callingConvention(Kind[] types, Type type, CiTarget target, boolean stackOnly) {
+    private CallingConvention callingConvention(Kind[] types, Type type, TargetDescription target, boolean stackOnly) {
         Value[] locations = new Value[types.length];
 
         int currentGeneral = 0;
@@ -138,14 +138,14 @@
                 case Long:
                 case Object:
                     if (!stackOnly && currentGeneral < generalParameterRegisters.length) {
-                        CiRegister register = generalParameterRegisters[currentGeneral++];
+                        Register register = generalParameterRegisters[currentGeneral++];
                         locations[i] = register.asValue(kind);
                     }
                     break;
                 case Float:
                 case Double:
                     if (!stackOnly && currentXMM < xmmParameterRegisters.length) {
-                        CiRegister register = xmmParameterRegisters[currentXMM++];
+                        Register register = xmmParameterRegisters[currentXMM++];
                         locations[i] = register.asValue(kind);
                     }
                     break;
@@ -154,16 +154,16 @@
             }
 
             if (locations[i] == null) {
-                locations[i] = CiStackSlot.get(kind.stackKind(), currentStackOffset, !type.out);
+                locations[i] = StackSlot.get(kind.stackKind(), currentStackOffset, !type.out);
                 currentStackOffset += Math.max(target.sizeInBytes(kind), target.wordSize);
             }
         }
 
-        return new CiCallingConvention(locations, currentStackOffset);
+        return new CallingConvention(locations, currentStackOffset);
     }
 
     @Override
-    public CiRegister getReturnRegister(Kind kind) {
+    public Register getReturnRegister(Kind kind) {
         switch (kind) {
             case Boolean:
             case Byte:
@@ -185,16 +185,16 @@
     }
 
     @Override
-    public CiRegister getScratchRegister() {
+    public Register getScratchRegister() {
         return r10;
     }
 
     @Override
-    public CiRegister getFrameRegister() {
+    public Register getFrameRegister() {
         return rsp;
     }
 
-    public CiCalleeSaveLayout getCalleeSaveLayout() {
+    public CalleeSaveLayout getCalleeSaveLayout() {
         return csl;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Sat Jun 09 20:10:05 2012 +0200
@@ -29,7 +29,7 @@
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.code.CompilationResult.*;
-import com.oracle.graal.api.code.CiUtil.*;
+import com.oracle.graal.api.code.CodeUtil.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.api.meta.JavaType.*;
 import com.oracle.graal.compiler.*;
@@ -83,23 +83,23 @@
     @Override
     public String disassemble(CodeInfo info, CompilationResult tm) {
         byte[] code = info.code();
-        CiTarget target = compiler.getTarget();
+        TargetDescription target = compiler.getTarget();
         HexCodeFile hcf = new HexCodeFile(code, info.start(), target.arch.name, target.wordSize * 8);
         if (tm != null) {
             HexCodeFile.addAnnotations(hcf, tm.annotations());
             addExceptionHandlersComment(tm, hcf);
-            CiRegister fp = regConfig.getFrameRegister();
+            Register fp = regConfig.getFrameRegister();
             RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0);
             for (Safepoint safepoint : tm.safepoints) {
                 if (safepoint instanceof Call) {
                     Call call = (Call) safepoint;
                     if (call.debugInfo != null) {
-                        hcf.addComment(call.pcOffset + call.size, CiUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString());
+                        hcf.addComment(call.pcOffset + call.size, CodeUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString());
                     }
                     addOperandComment(hcf, call.pcOffset, "{" + getTargetName(call) + "}");
                 } else {
                     if (safepoint.debugInfo != null) {
-                        hcf.addComment(safepoint.pcOffset, CiUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString());
+                        hcf.addComment(safepoint.pcOffset, CodeUtil.append(new StringBuilder(100), safepoint.debugInfo, slotFormatter).toString());
                     }
                     addOperandComment(hcf, safepoint.pcOffset, "{safepoint}");
                 }
@@ -200,7 +200,7 @@
     }
 
     @Override
-    public CiRegisterConfig getRegisterConfig(JavaMethod method) {
+    public RegisterConfig getRegisterConfig(JavaMethod method) {
         return regConfig;
     }
 
@@ -370,7 +370,7 @@
                 return true;
             }
             ResolvedJavaMethod method = graph.method();
-            return method != null && CiUtil.format("%H.%n", method).contains(option);
+            return method != null && CodeUtil.format("%H.%n", method).contains(option);
         }
         return false;
     }
@@ -386,7 +386,7 @@
     private static ValueNode createBoundsCheck(AccessIndexedNode n, CiLoweringTool tool) {
         StructuredGraph graph = (StructuredGraph) n.graph();
         ArrayLengthNode arrayLength = graph.add(new ArrayLengthNode(n.array()));
-        ValueNode guard = tool.createGuard(graph.unique(new IntegerBelowThanNode(n.index(), arrayLength)), DeoptimizationReason.BoundsCheckException, CiDeoptAction.InvalidateReprofile, n.leafGraphId());
+        ValueNode guard = tool.createGuard(graph.unique(new IntegerBelowThanNode(n.index(), arrayLength)), DeoptimizationReason.BoundsCheckException, DeoptimizationAction.InvalidateReprofile, n.leafGraphId());
 
         graph.addBeforeFixed(n, arrayLength);
         return guard;
@@ -457,7 +457,7 @@
         return target;
     }
 
-    public long getMaxCallTargetOffset(CiRuntimeCall rtcall) {
+    public long getMaxCallTargetOffset(RuntimeCall rtcall) {
         return compiler.getCompilerToVM().getMaxCallTargetOffset(rtcall);
     }
 
@@ -486,7 +486,7 @@
     }
 
     @Override
-    public CiRegisterConfig getGlobalStubRegisterConfig() {
+    public RegisterConfig getGlobalStubRegisterConfig() {
         return globalStubRegConfig;
     }
 
@@ -497,7 +497,7 @@
     }
 
     @Override
-    public int encodeDeoptActionAndReason(CiDeoptAction action, DeoptimizationReason reason) {
+    public int encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason) {
         final int actionShift = 0;
         final int reasonShift = 3;
 
@@ -507,7 +507,7 @@
     }
 
     @Override
-    public int convertDeoptAction(CiDeoptAction action) {
+    public int convertDeoptAction(DeoptimizationAction action) {
         switch(action) {
             case None: return 0;
             case RecompileIfTooManyDeopts: return 1;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.hotspot.ri;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 import static com.oracle.graal.hotspot.ri.TemplateFlag.*;
 
 import java.io.*;
@@ -32,8 +32,8 @@
 import sun.misc.*;
 
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiAddress.*;
-import com.oracle.graal.api.code.CiRegister.*;
+import com.oracle.graal.api.code.Address.*;
+import com.oracle.graal.api.code.Register.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.hotspot.*;
@@ -73,14 +73,14 @@
     // @formatter:on
 
     private final HotSpotVMConfig config;
-    private final CiTarget target;
-    private final CiRegisterConfig registerConfig;
+    private final TargetDescription target;
+    private final RegisterConfig registerConfig;
     private final HotSpotGraalRuntime compiler;
 
 
     private CiXirAssembler globalAsm;
 
-    public HotSpotXirGenerator(HotSpotVMConfig config, CiTarget target, CiRegisterConfig registerConfig, HotSpotGraalRuntime compiler) {
+    public HotSpotXirGenerator(HotSpotVMConfig config, TargetDescription target, RegisterConfig registerConfig, HotSpotGraalRuntime compiler) {
         this.config = config;
         this.target = target;
         this.registerConfig = registerConfig;
@@ -259,8 +259,8 @@
         }
     };
 
-    private CiRegister getGeneralParameterRegister(int index) {
-        return registerConfig.getCallingConventionRegisters(CiCallingConvention.Type.RuntimeCall, RegisterFlag.CPU)[index];
+    private Register getGeneralParameterRegister(int index) {
+        return registerConfig.getCallingConventionRegisters(CallingConvention.Type.RuntimeCall, RegisterFlag.CPU)[index];
     }
 
     private SimpleTemplates monitorExitTemplates = new SimpleTemplates(NULL_CHECK) {
@@ -383,13 +383,13 @@
 
             // Calculate aligned size
             asm.mov(size, length);
-            int scale = CiUtil.log2(target.sizeInBytes(kind));
+            int scale = CodeUtil.log2(target.sizeInBytes(kind));
             if (scale != 0) {
                 asm.shl(size, size, asm.i(scale));
             }
             asm.add(size, size, asm.i(arrayElementOffset + aligning - 1));
             long mask = 0xFFFFFFFFL;
-            mask <<= CiUtil.log2(aligning);
+            mask <<= CodeUtil.log2(aligning);
             asm.and(size, size, asm.i((int) mask));
 
             // Try tlab allocation
@@ -581,8 +581,8 @@
             }
             DeoptimizationReason deoptReason = exact ? DeoptimizationReason.OptimizedTypeCheckViolated : DeoptimizationReason.ClassCastException;
             XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
-            asm.mov(scratch, wordConst(asm, compiler.getRuntime().encodeDeoptActionAndReason(CiDeoptAction.InvalidateReprofile, deoptReason)));
-            asm.callRuntime(CiRuntimeCall.Deoptimize, null);
+            asm.mov(scratch, wordConst(asm, compiler.getRuntime().encodeDeoptActionAndReason(DeoptimizationAction.InvalidateReprofile, deoptReason)));
+            asm.callRuntime(RuntimeCall.Deoptimize, null);
             asm.shouldNotReachHere();
 
             return asm.finishTemplate("checkcast");
@@ -903,9 +903,9 @@
         asm.pop(result);
     }
 
-    private static void useRegisters(CiXirAssembler asm, CiRegister... registers) {
+    private static void useRegisters(CiXirAssembler asm, Register... registers) {
         if (registers != null) {
-            for (CiRegister register : registers) {
+            for (Register register : registers) {
                 asm.createRegisterTemp("reg", Kind.Illegal, register);
             }
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Sat Jun 09 20:10:05 2012 +0200
@@ -74,7 +74,7 @@
         Object objectHub = UnsafeLoadNode.loadObject(object, 0, hubOffset(), true);
         if (objectHub != exactHub) {
             exactMiss.inc();
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
+            DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         exactHit.inc();
         return object;
@@ -96,7 +96,7 @@
         Object objectHub = UnsafeLoadNode.loadObject(object, 0, hubOffset(), true);
         if (UnsafeLoadNode.loadObject(objectHub, 0, superCheckOffset, true) != hub) {
             displayMiss.inc();
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
+            DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         displayHit.inc();
         return object;
@@ -122,7 +122,7 @@
             }
         }
         if (!checkSecondarySubType(hub, objectHub)) {
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
+            DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         return object;
     }
@@ -148,7 +148,7 @@
             }
         }
         if (!checkUnknownSubType(hub, objectHub)) {
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
+            DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         return object;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/DirectStoreNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/DirectStoreNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -58,6 +58,6 @@
     @Override
     public void generate(LIRGeneratorTool gen) {
         Value v = gen.operand(value);
-        gen.emitStore(new CiAddress(v.kind, gen.operand(address)), v, false);
+        gen.emitStore(new Address(v.kind, gen.operand(address)), v, false);
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/SystemSnippets.java	Sat Jun 09 20:10:05 2012 +0200
@@ -33,11 +33,11 @@
 public class SystemSnippets implements SnippetsInterface {
 
     public static long currentTimeMillis() {
-        return RuntimeCallNode.performCall(CiRuntimeCall.JavaTimeMillis);
+        return RuntimeCallNode.performCall(RuntimeCall.JavaTimeMillis);
     }
 
     public static long nanoTime() {
-        return RuntimeCallNode.performCall(CiRuntimeCall.JavaTimeNanos);
+        return RuntimeCallNode.performCall(RuntimeCall.JavaTimeNanos);
     }
 
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64SafepointOp.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64SafepointOp.java	Sat Jun 09 20:10:05 2012 +0200
@@ -49,17 +49,17 @@
 
     @Override
     public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler asm) {
-        CiRegister scratch = tasm.frameMap.registerConfig.getScratchRegister();
+        Register scratch = tasm.frameMap.registerConfig.getScratchRegister();
         int pos = asm.codeBuffer.position();
         if (config.isPollingPageFar) {
             asm.movq(scratch, config.safepointPollingAddress);
             tasm.recordMark(MARK_POLL_FAR);
             tasm.recordSafepoint(pos, info);
-            asm.movq(scratch, new CiAddress(tasm.target.wordKind, scratch.asValue()));
+            asm.movq(scratch, new Address(tasm.target.wordKind, scratch.asValue()));
         } else {
             tasm.recordMark(MARK_POLL_NEAR);
             tasm.recordSafepoint(pos, info);
-            asm.movq(scratch, new CiAddress(tasm.target.wordKind, rip.asValue()));
+            asm.movq(scratch, new Address(tasm.target.wordKind, rip.asValue()));
         }
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64TailcallOp.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64TailcallOp.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.hotspot.target.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,8 +22,8 @@
  */
 package com.oracle.graal.hotspot.target.amd64;
 
-import static com.oracle.graal.api.code.CiCallingConvention.Type.*;
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.CallingConvention.Type.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 import static com.oracle.graal.hotspot.ri.HotSpotXirGenerator.*;
 import static com.oracle.max.asm.target.amd64.AMD64.*;
 
@@ -51,12 +51,12 @@
 
 public class HotSpotAMD64Backend extends Backend {
 
-    public HotSpotAMD64Backend(CodeCacheProvider runtime, CiTarget target) {
+    public HotSpotAMD64Backend(CodeCacheProvider runtime, TargetDescription target) {
         super(runtime, target);
     }
 
     @Override
-    public LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
+    public LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, Assumptions assumptions) {
         return new AMD64LIRGenerator(graph, runtime, target, frameMap, method, lir, xir, assumptions) {
 
             @Override
@@ -68,9 +68,9 @@
             @Override
             public void visitExceptionObject(ExceptionObjectNode x) {
                 HotSpotVMConfig config = ((HotSpotRuntime) runtime).config;
-                CiRegisterValue thread = r15.asValue();
-                CiAddress exceptionAddress = new CiAddress(Kind.Object, thread, config.threadExceptionOopOffset);
-                CiAddress pcAddress = new CiAddress(Kind.Long, thread, config.threadExceptionPcOffset);
+                RegisterValue thread = r15.asValue();
+                Address exceptionAddress = new Address(Kind.Object, thread, config.threadExceptionOopOffset);
+                Address pcAddress = new Address(Kind.Long, thread, config.threadExceptionPcOffset);
                 Value exception = emitLoad(exceptionAddress, false);
                 emitStore(exceptionAddress, Constant.NULL_OBJECT, false);
                 emitStore(pcAddress, Constant.LONG_0, false);
@@ -105,10 +105,10 @@
             if (GraalOptions.ZapStackOnMethodEntry) {
                 final int intSize = 4;
                 for (int i = 0; i < frameSize / intSize; ++i) {
-                    asm.movl(new CiAddress(Kind.Int, rsp.asValue(), i * intSize), 0xC1C1C1C1);
+                    asm.movl(new Address(Kind.Int, rsp.asValue(), i * intSize), 0xC1C1C1C1);
                 }
             }
-            CiCalleeSaveLayout csl = frameMap.registerConfig.getCalleeSaveLayout();
+            CalleeSaveLayout csl = frameMap.registerConfig.getCalleeSaveLayout();
             if (csl != null && csl.size != 0) {
                 int frameToCSA = frameMap.offsetToCalleeSaveArea();
                 assert frameToCSA >= 0;
@@ -120,8 +120,8 @@
         public void leave(TargetMethodAssembler tasm) {
             int frameSize = tasm.frameMap.frameSize();
             AMD64MacroAssembler asm = (AMD64MacroAssembler) tasm.asm;
-            CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
-            CiRegisterConfig regConfig = tasm.frameMap.registerConfig;
+            CalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout();
+            RegisterConfig regConfig = tasm.frameMap.registerConfig;
 
             if (csl != null && csl.size != 0) {
                 tasm.targetMethod.setRegisterRestoreEpilogueOffset(asm.codeBuffer.position());
@@ -140,14 +140,14 @@
                 // so deoptimization cannot be performed here. The HotSpot runtime
                 // detects this case - see the definition of frame::should_be_deoptimized()
 
-                CiRegister scratch = regConfig.getScratchRegister();
+                Register scratch = regConfig.getScratchRegister();
                 if (config.isPollingPageFar) {
                     asm.movq(scratch, config.safepointPollingAddress);
                     tasm.recordMark(MARK_POLL_RETURN_FAR);
-                    asm.movq(scratch, new CiAddress(tasm.target.wordKind, scratch.asValue()));
+                    asm.movq(scratch, new Address(tasm.target.wordKind, scratch.asValue()));
                 } else {
                     tasm.recordMark(MARK_POLL_RETURN_NEAR);
-                    asm.movq(scratch, new CiAddress(tasm.target.wordKind, rip.asValue()));
+                    asm.movq(scratch, new Address(tasm.target.wordKind, rip.asValue()));
                 }
             }
         }
@@ -178,7 +178,7 @@
     public void emitCode(TargetMethodAssembler tasm, ResolvedJavaMethod method, LIR lir) {
         AMD64MacroAssembler asm = (AMD64MacroAssembler) tasm.asm;
         FrameMap frameMap = tasm.frameMap;
-        CiRegisterConfig regConfig = frameMap.registerConfig;
+        RegisterConfig regConfig = frameMap.registerConfig;
         HotSpotVMConfig config = ((HotSpotRuntime) runtime).config;
         Label unverifiedStub = new Label();
 
@@ -188,10 +188,10 @@
         boolean isStatic = Modifier.isStatic(method.accessFlags());
         if (!isStatic) {
             tasm.recordMark(MARK_UNVERIFIED_ENTRY);
-            CiCallingConvention cc = regConfig.getCallingConvention(JavaCallee, new Kind[] {Kind.Object}, target, false);
-            CiRegister inlineCacheKlass = rax; // see definition of IC_Klass in c1_LIRAssembler_x86.cpp
-            CiRegister receiver = asRegister(cc.locations[0]);
-            CiAddress src = new CiAddress(target.wordKind, receiver.asValue(), config.hubOffset);
+            CallingConvention cc = regConfig.getCallingConvention(JavaCallee, new Kind[] {Kind.Object}, target, false);
+            Register inlineCacheKlass = rax; // see definition of IC_Klass in c1_LIRAssembler_x86.cpp
+            Register receiver = asRegister(cc.locations[0]);
+            Address src = new Address(target.wordKind, receiver.asValue(), config.hubOffset);
 
             asm.cmpq(inlineCacheKlass, src);
             asm.jcc(ConditionFlag.notEqual, unverifiedStub);
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java	Sat Jun 09 20:10:05 2012 +0200
@@ -413,7 +413,7 @@
     private void addSuccessor(int predBci, Block sux) {
         Block predecessor = blockMap[predBci];
         if (sux.isExceptionEntry) {
-            throw new CiBailout("Exception handler can be reached by both normal and exceptional control flow");
+            throw new BailoutException("Exception handler can be reached by both normal and exceptional control flow");
         }
         predecessor.successors.add(sux);
     }
@@ -522,7 +522,7 @@
                 // There is a path from a loop end to the method entry that does not pass the loop header.
                 // Therefore, the loop is non reducible (has more than one entry).
                 // We don't want to compile such methods because the IR only supports structured loops.
-                throw new CiBailout("Non-reducible loop");
+                throw new BailoutException("Non-reducible loop");
             }
         } while (loopChanges);
     }
@@ -534,7 +534,7 @@
             // There is a path from a loop end to the method entry that does not pass the loop header.
             // Therefore, the loop is non reducible (has more than one entry).
             // We don't want to compile such methods because the IR only supports structured loops.
-            throw new CiBailout("Non-reducible loop");
+            throw new BailoutException("Non-reducible loop");
         }
 
         // Convert postorder to the desired reverse postorder.
@@ -615,12 +615,12 @@
             if (block.isExceptionEntry) {
                 // Loops that are implicitly formed by an exception handler lead to all sorts of corner cases.
                 // Don't compile such methods for now, until we see a concrete case that allows checking for correctness.
-                throw new CiBailout("Loop formed by an exception handler");
+                throw new BailoutException("Loop formed by an exception handler");
             }
             if (nextLoop >= Long.SIZE) {
                 // This restriction can be removed by using a fall-back to a BitSet in case we have more than 64 loops
                 // Don't compile such methods for now, until we see a concrete case that allows checking for correctness.
-                throw new CiBailout("Too many loops in method");
+                throw new BailoutException("Too many loops in method");
             }
 
             assert block.loops == 0;
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java	Sat Jun 09 20:10:05 2012 +0200
@@ -23,7 +23,7 @@
 package com.oracle.graal.java;
 
 import static com.oracle.graal.graph.iterators.NodePredicates.*;
-import static com.oracle.graal.nodes.ValueUtil.*;
+import static com.oracle.graal.nodes.ValueNodeUtil.*;
 import static java.lang.reflect.Modifier.*;
 
 import java.util.*;
@@ -131,7 +131,7 @@
         for (int i = 0; i < stackSize(); i++) {
             ValueNode x = stackAt(i);
             ValueNode y = other.stackAt(i);
-            if (x != y && ValueUtil.typeMismatch(x, y)) {
+            if (x != y && ValueNodeUtil.typeMismatch(x, y)) {
                 return false;
             }
         }
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Sat Jun 09 20:10:05 2012 +0200
@@ -129,13 +129,13 @@
 
     @Override
     protected String getDetailedName() {
-        return getName() + " " + CiUtil.format("%H.%n(%p):%r", method);
+        return getName() + " " + CodeUtil.format("%H.%n(%p):%r", method);
     }
 
     private BciBlockMapping createBlockMap() {
         BciBlockMapping map = new BciBlockMapping(method);
         map.build();
-        Debug.dump(map, CiUtil.format("After block building %f %R %H.%n(%P)", method));
+        Debug.dump(map, CodeUtil.format("After block building %f %R %H.%n(%P)", method));
 
         return map;
     }
@@ -148,7 +148,7 @@
 
         if (GraalOptions.PrintProfilingInformation) {
             TTY.println("Profiling info for " + method);
-            TTY.println(CiUtil.indent(CiUtil.profileToString(profilingInfo, method, CiUtil.NEW_LINE), "  "));
+            TTY.println(CodeUtil.indent(CodeUtil.profileToString(profilingInfo, method, CodeUtil.NEW_LINE), "  "));
         }
 
         // compute the block map, setup exception handlers and get the entrypoint(s)
@@ -286,7 +286,7 @@
             if (riType instanceof ResolvedJavaType) {
                 frameState.push(Kind.Object, append(ConstantNode.forCiConstant(((ResolvedJavaType) riType).getEncoding(Representation.JavaClass), runtime, currentGraph)));
             } else {
-                append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+                append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
                 frameState.push(Kind.Object, append(ConstantNode.forObject(null, runtime, currentGraph)));
             }
         } else if (con instanceof Constant) {
@@ -565,7 +565,7 @@
 
     private void genThrow() {
         ValueNode exception = frameState.apop();
-        FixedGuardNode node = currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(exception)), DeoptimizationReason.NullCheckException, CiDeoptAction.InvalidateReprofile, true, graphId));
+        FixedGuardNode node = currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(exception)), DeoptimizationReason.NullCheckException, DeoptimizationAction.InvalidateReprofile, true, graphId));
         append(node);
         append(handleException(exception, bci()));
     }
@@ -635,7 +635,7 @@
             frameState.apush(checkCast);
         } else {
             ValueNode object = frameState.apop();
-            append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(object)), DeoptimizationReason.Unresolved, CiDeoptAction.InvalidateRecompile, graphId)));
+            append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(object)), DeoptimizationReason.Unresolved, DeoptimizationAction.InvalidateRecompile, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
@@ -651,7 +651,7 @@
             frameState.ipush(append(MaterializeNode.create(currentGraph.unique(instanceOfNode), currentGraph)));
         } else {
             BlockPlaceholderNode successor = currentGraph.add(new BlockPlaceholderNode());
-            DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId));
+            DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId));
             IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new IsNullNode(object)), successor, deopt, 0));
             append(ifNode);
             lastInstr = successor;
@@ -665,7 +665,7 @@
             NewInstanceNode n = currentGraph.add(new NewInstanceNode((ResolvedJavaType) type));
             frameState.apush(append(n));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
@@ -706,7 +706,7 @@
             NewArrayNode n = currentGraph.add(new NewObjectArrayNode((ResolvedJavaType) type, length));
             frameState.apush(append(n));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
 
@@ -723,7 +723,7 @@
             FixedWithNextNode n = currentGraph.add(new NewMultiArrayNode((ResolvedJavaType) type, dims));
             frameState.apush(append(n));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
@@ -737,7 +737,7 @@
             LoadFieldNode load = currentGraph.add(new LoadFieldNode(receiver, (ResolvedJavaField) field, graphId));
             appendOptimizedLoadField(kind, load);
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
         }
     }
@@ -765,7 +765,7 @@
             ValueNode exception = ConstantNode.forObject(new NullPointerException(), runtime, currentGraph);
             trueSucc.setNext(handleException(exception, bci()));
         } else {
-            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(CiRuntimeCall.CreateNullPointerException));
+            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(RuntimeCall.CreateNullPointerException));
             call.setStateAfter(frameState.create(bci()));
             trueSucc.setNext(call);
             call.setNext(handleException(call, bci()));
@@ -784,7 +784,7 @@
             ValueNode exception = ConstantNode.forObject(new ArrayIndexOutOfBoundsException(), runtime, currentGraph);
             falseSucc.setNext(handleException(exception, bci()));
         } else {
-            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(CiRuntimeCall.CreateOutOfBoundsException, new ValueNode[] {index}));
+            RuntimeCallNode call = currentGraph.add(new RuntimeCallNode(RuntimeCall.CreateOutOfBoundsException, new ValueNode[] {index}));
             call.setStateAfter(frameState.create(bci()));
             falseSucc.setNext(call);
             call.setNext(handleException(call, bci()));
@@ -814,7 +814,7 @@
             StoreFieldNode store = currentGraph.add(new StoreFieldNode(receiver, (ResolvedJavaField) field, value, graphId));
             appendOptimizedStoreField(store);
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
         }
     }
 
@@ -856,7 +856,7 @@
         if (initialized) {
             return appendConstant(((ResolvedJavaType) holder).getEncoding(representation));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             return null;
         }
     }
@@ -917,7 +917,7 @@
     }
 
     private void genInvokeDeopt(JavaMethod unresolvedTarget, boolean withReceiver) {
-        append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+        append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
         frameState.popArguments(unresolvedTarget.signature().argumentSlots(withReceiver), unresolvedTarget.signature().argumentCount(withReceiver));
         Kind kind = unresolvedTarget.signature().returnKind();
         if (kind != Kind.Void) {
@@ -957,7 +957,7 @@
     private void appendInvoke(InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args) {
         Kind resultType = targetMethod.signature().returnKind();
         if (GraalOptions.DeoptALot) {
-            DeoptimizeNode deoptimize = currentGraph.add(new DeoptimizeNode(CiDeoptAction.None, DeoptimizationReason.RuntimeConstraint, graphId));
+            DeoptimizeNode deoptimize = currentGraph.add(new DeoptimizeNode(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint, graphId));
             deoptimize.setMessage("invoke " + targetMethod.name());
             append(deoptimize);
             frameState.pushReturn(resultType, ConstantNode.defaultForKind(resultType, currentGraph));
@@ -1029,7 +1029,7 @@
         ValueNode local = frameState.loadLocal(localIndex);
         JsrScope scope = currentBlock.jsrScope;
         int retAddress = scope.nextReturnAddress();
-        append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IntegerEqualsNode(local, ConstantNode.forJsr(retAddress, currentGraph))), DeoptimizationReason.JavaSubroutineMismatch, CiDeoptAction.InvalidateReprofile, graphId)));
+        append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IntegerEqualsNode(local, ConstantNode.forJsr(retAddress, currentGraph))), DeoptimizationReason.JavaSubroutineMismatch, DeoptimizationAction.InvalidateReprofile, graphId)));
         if (!successor.jsrScope.equals(scope.pop())) {
             throw new JsrNotSupportedBailout("unstructured control flow (ret leaves more than one scope)");
         }
@@ -1186,7 +1186,7 @@
     private FixedNode createTarget(double probability, Block block, FrameStateBuilder stateAfter) {
         assert probability >= 0 && probability <= 1;
         if (probability == 0 && optimisticOpts.removeNeverExecutedCode()) {
-            return currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.UnreachedCode, graphId));
+            return currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.UnreachedCode, graphId));
         } else {
             return createTarget(block, stateAfter);
         }
@@ -1211,7 +1211,7 @@
 
         // We already saw this block before, so we have to merge states.
         if (!block.entryState.isCompatibleWith(state)) {
-            throw new CiBailout("stacks do not match; bytecodes would not verify");
+            throw new BailoutException("stacks do not match; bytecodes would not verify");
         }
 
         if (block.firstInstruction instanceof LoopBeginNode) {
@@ -1714,9 +1714,9 @@
             case GOTO_W         : genGoto(); break;
             case JSR_W          : genJsr(stream.readBranchDest()); break;
             case BREAKPOINT:
-                throw new CiBailout("concurrent setting of breakpoint");
+                throw new BailoutException("concurrent setting of breakpoint");
             default:
-                throw new CiBailout("Unsupported opcode " + opcode + " (" + nameOf(opcode) + ") [bci=" + bci + "]");
+                throw new BailoutException("Unsupported opcode " + opcode + " (" + nameOf(opcode) + ") [bci=" + bci + "]");
         }
         // Checkstyle: resume
     }
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java	Sat Jun 09 20:10:05 2012 +0200
@@ -25,7 +25,7 @@
 import com.oracle.graal.api.code.*;
 
 
-public class JsrNotSupportedBailout extends CiBailout{
+public class JsrNotSupportedBailout extends BailoutException{
     private static final long serialVersionUID = -7476925652727154272L;
 
     public JsrNotSupportedBailout(String reason) {
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -119,12 +119,12 @@
 
     public static void directCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Object target, LIRDebugInfo info) {
         int before = masm.codeBuffer.position();
-        if (target instanceof CiRuntimeCall) {
-            long maxOffset = tasm.runtime.getMaxCallTargetOffset((CiRuntimeCall) target);
+        if (target instanceof RuntimeCall) {
+            long maxOffset = tasm.runtime.getMaxCallTargetOffset((RuntimeCall) 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.frameMap.registerConfig.getScratchRegister();
+                Register scratch = tasm.frameMap.registerConfig.getScratchRegister();
                 // TODO (cwimmer): we want to get rid of a generally reserved scratch register.
                 masm.movq(scratch, 0L);
                 masm.call(scratch);
@@ -148,7 +148,7 @@
         masm.ensureUniquePC();
     }
 
-    public static void indirectCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiRegister dst, Object target, LIRDebugInfo info) {
+    public static void indirectCall(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Register dst, Object target, LIRDebugInfo info) {
         int before = masm.codeBuffer.position();
         masm.call(dst);
         int after = masm.codeBuffer.position();
@@ -162,7 +162,7 @@
         assert (assertions = true) == true;
 
         if (assertions) {
-            directCall(tasm, masm, CiRuntimeCall.Debug, null);
+            directCall(tasm, masm, RuntimeCall.Debug, null);
             masm.hlt();
         }
     }
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -30,7 +30,7 @@
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiAddress.*;
+import com.oracle.graal.api.code.Address.*;
 import com.oracle.graal.api.code.CompilationResult.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.graph.*;
@@ -238,7 +238,7 @@
     }
 
 
-    private static void tableswitch(TargetMethodAssembler tasm, AMD64MacroAssembler masm, int lowKey, LabelRef defaultTarget, LabelRef[] targets, CiRegister value, CiRegister scratch) {
+    private static void tableswitch(TargetMethodAssembler tasm, AMD64MacroAssembler masm, int lowKey, LabelRef defaultTarget, LabelRef[] targets, Register value, Register scratch) {
         Buffer buf = masm.codeBuffer;
         // Compare index against jump table bounds
         int highKey = lowKey + targets.length - 1;
@@ -255,11 +255,11 @@
 
         // Set scratch to address of jump table
         int leaPos = buf.position();
-        masm.leaq(scratch, new CiAddress(tasm.target.wordKind, AMD64.rip.asValue(), 0));
+        masm.leaq(scratch, new Address(tasm.target.wordKind, AMD64.rip.asValue(), 0));
         int afterLea = buf.position();
 
         // Load jump table entry into scratch and jump to it
-        masm.movslq(value, new CiAddress(Kind.Int, scratch.asValue(), value.asValue(), Scale.Times4, 0));
+        masm.movslq(value, new Address(Kind.Int, scratch.asValue(), value.asValue(), Scale.Times4, 0));
         masm.addq(scratch, value);
         masm.jmp(scratch);
 
@@ -271,7 +271,7 @@
         // Patch LEA instruction above now that we know the position of the jump table
         int jumpTablePos = buf.position();
         buf.setPosition(leaPos);
-        masm.leaq(scratch, new CiAddress(tasm.target.wordKind, AMD64.rip.asValue(), jumpTablePos - afterLea));
+        masm.leaq(scratch, new Address(tasm.target.wordKind, AMD64.rip.asValue(), jumpTablePos - afterLea));
         buf.setPosition(jumpTablePos);
 
         // Emit jump table entries
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 import static java.lang.Double.*;
 import static java.lang.Float.*;
 
@@ -139,7 +139,7 @@
 
         @Override
         public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            load(tasm, masm, output(0), (CiAddress) input(0), info);
+            load(tasm, masm, output(0), (Address) input(0), info);
         }
 
         @Override
@@ -161,7 +161,7 @@
 
         @Override
         public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-            store(tasm, masm, (CiAddress) input(0), input(1), info);
+            store(tasm, masm, (Address) input(0), input(1), info);
         }
 
         @Override
@@ -240,7 +240,7 @@
 
 
     public static class CompareAndSwapOp extends AMD64LIRInstruction {
-        public CompareAndSwapOp(Value result, CiAddress address, Value cmpValue, Value newValue) {
+        public CompareAndSwapOp(Value result, Address address, Value cmpValue, Value newValue) {
             super("CAS", new Value[] {result}, null, new Value[] {address, cmpValue, newValue}, LIRInstruction.NO_OPERANDS, LIRInstruction.NO_OPERANDS);
         }
 
@@ -404,7 +404,7 @@
     }
 
 
-    public static void load(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, CiAddress loadAddr, LIRDebugInfo info) {
+    public static void load(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, Address loadAddr, LIRDebugInfo info) {
         if (info != null) {
             tasm.recordImplicitException(masm.codeBuffer.position(), info);
         }
@@ -422,7 +422,7 @@
         }
     }
 
-    public static void store(TargetMethodAssembler tasm, AMD64MacroAssembler masm, CiAddress storeAddr, Value input, LIRDebugInfo info) {
+    public static void store(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Address storeAddr, Value input, LIRDebugInfo info) {
         if (info != null) {
             tasm.recordImplicitException(masm.codeBuffer.position(), info);
         }
@@ -474,7 +474,7 @@
         }
     }
 
-    protected static void compareAndSwap(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, CiAddress address, Value cmpValue, Value newValue) {
+    protected static void compareAndSwap(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, Address address, Value cmpValue, Value newValue) {
         assert asRegister(cmpValue) == AMD64.rax && asRegister(result) == AMD64.rax;
 
         if (tasm.target.isMP) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,18 +22,18 @@
  */
 package com.oracle.graal.lir;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiCallingConvention.*;
+import com.oracle.graal.api.code.CallingConvention.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.max.asm.*;
 
 /**
  * This class is used to build the stack frame layout for a compiled method.
- * A {@link CiStackSlot} is used to index slots of the frame relative to the stack pointer.
+ * A {@link StackSlot} is used to index slots of the frame relative to the stack pointer.
  * The frame size is only fixed after register allocation when all spill slots have
  * been allocated. Both the outgoing argument area and the spill are can grow until then.
  * Therefore, outgoing arguments are indexed from the stack pointer, while spill slots
@@ -81,8 +81,8 @@
  */
 public final class FrameMap {
     public final CodeCacheProvider runtime;
-    public final CiTarget target;
-    public final CiRegisterConfig registerConfig;
+    public final TargetDescription target;
+    public final RegisterConfig registerConfig;
 
     /**
      * The initial frame size, not including the size of the return address.
@@ -110,22 +110,22 @@
     /**
      * The list of stack areas allocated in this frame that are present in every reference map.
      */
-    private final List<CiStackSlot> objectStackBlocks;
+    private final List<StackSlot> objectStackBlocks;
 
     /**
      * The stack area reserved for use by the VM, or {@code null} if the VM does not request stack space.
      */
-    private final CiStackSlot customArea;
+    private final StackSlot customArea;
 
     /**
-     * Records whether an offset to an incoming stack argument was ever returned by {@link #offsetForStackSlot(CiStackSlot)}.
+     * Records whether an offset to an incoming stack argument was ever returned by {@link #offsetForStackSlot(StackSlot)}.
      */
     private boolean accessesCallerFrame;
 
     /**
      * Creates a new frame map for the specified method.
      */
-    public FrameMap(CodeCacheProvider runtime, CiTarget target, CiRegisterConfig registerConfig) {
+    public FrameMap(CodeCacheProvider runtime, TargetDescription target, RegisterConfig registerConfig) {
         this.runtime = runtime;
         this.target = target;
         this.registerConfig = registerConfig;
@@ -142,12 +142,12 @@
     }
 
     private int calleeSaveAreaSize() {
-        CiCalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
+        CalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
         return csl != null ? csl.size : 0;
     }
 
     /**
-     * Determines if an offset to an incoming stack argument was ever returned by {@link #offsetForStackSlot(CiStackSlot)}.
+     * Determines if an offset to an incoming stack argument was ever returned by {@link #offsetForStackSlot(StackSlot)}.
      */
     public boolean accessesCallerFrame() {
         return accessesCallerFrame;
@@ -194,7 +194,7 @@
      * @param slot a stack slot
      * @return the offset of the stack slot
      */
-    public int offsetForStackSlot(CiStackSlot slot) {
+    public int offsetForStackSlot(StackSlot slot) {
         assert (!slot.rawAddFrameSize() && slot.rawOffset() < outgoingSize) ||
             (slot.rawAddFrameSize() && slot.rawOffset() < 0 && -slot.rawOffset() <= spillSize) ||
             (slot.rawAddFrameSize() && slot.rawOffset() >= 0);
@@ -226,7 +226,7 @@
      * @param cc The calling convention for the called method.
      * @param type The type of calling convention.
      */
-    public void callsMethod(CiCallingConvention cc, Type type) {
+    public void callsMethod(CallingConvention cc, Type type) {
         // TODO look at the actual stack offsets?
         assert type.out;
         reserveOutgoing(cc.stackSize);
@@ -241,8 +241,8 @@
         outgoingSize = Math.max(outgoingSize, argsSize);
     }
 
-    private CiStackSlot getSlot(Kind kind, int additionalOffset) {
-        return CiStackSlot.get(kind, -spillSize + additionalOffset, true);
+    private StackSlot getSlot(Kind kind, int additionalOffset) {
+        return StackSlot.get(kind, -spillSize + additionalOffset, true);
     }
 
     /**
@@ -251,7 +251,7 @@
      * @param kind The kind of the spill slot to be reserved.
      * @return A spill slot denoting the reserved memory area.
      */
-    public CiStackSlot allocateSpillSlot(Kind kind) {
+    public StackSlot allocateSpillSlot(Kind kind) {
         assert frameSize == -1 : "frame size must not yet be fixed";
         int size = target.sizeInBytes(kind);
         spillSize = NumUtil.roundUp(spillSize + size, size);
@@ -267,7 +267,7 @@
      *             The caller is responsible to initialize the memory block before the first instruction that uses a reference map.
      * @return A stack slot describing the begin of the memory block.
      */
-    public CiStackSlot allocateStackBlock(int size, boolean refs) {
+    public StackSlot allocateStackBlock(int size, boolean refs) {
         assert frameSize == -1 : "frame size must not yet be fixed";
         if (size == 0) {
             return null;
@@ -276,7 +276,7 @@
 
         if (refs) {
             assert size % target.wordSize == 0;
-            CiStackSlot result = getSlot(Kind.Object, 0);
+            StackSlot result = getSlot(Kind.Object, 0);
             objectStackBlocks.add(result);
             for (int i = target.wordSize; i < size; i += target.wordSize) {
                 objectStackBlocks.add(getSlot(Kind.Object, i));
@@ -289,7 +289,7 @@
     }
 
 
-    private int frameRefMapIndex(CiStackSlot slot) {
+    private int frameRefMapIndex(StackSlot slot) {
         assert offsetForStackSlot(slot) % target.wordSize == 0;
         return offsetForStackSlot(slot) / target.wordSize;
     }
@@ -308,7 +308,7 @@
      */
     public BitSet initFrameRefMap() {
         BitSet frameRefMap = new BitSet(frameSize() / target.wordSize);
-        for (CiStackSlot slot : objectStackBlocks) {
+        for (StackSlot slot : objectStackBlocks) {
             setReference(slot, null, frameRefMap);
         }
         return frameRefMap;
@@ -316,7 +316,7 @@
 
     /**
      * Marks the specified location as a reference in the reference map of the debug information.
-     * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
+     * The tracked location can be a {@link RegisterValue} or a {@link StackSlot}. Note that a
      * {@link Constant} is automatically tracked.
      *
      * @param location The location to be added to the reference map.
@@ -338,7 +338,7 @@
 
     /**
      * Clears the specified location as a reference in the reference map of the debug information.
-     * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
+     * The tracked location can be a {@link RegisterValue} or a {@link StackSlot}. Note that a
      * {@link Constant} is automatically tracked.
      *
      * @param location The location to be removed from the reference map.
@@ -347,7 +347,7 @@
      */
     public void clearReference(Value location, BitSet registerRefMap, BitSet frameRefMap) {
         if (location.kind == Kind.Object) {
-            if (location instanceof CiRegisterValue) {
+            if (location instanceof RegisterValue) {
                 registerRefMap.clear(asRegister(location).number);
             } else if (isStackSlot(location)) {
                 int index = frameRefMapIndex(asStackSlot(location));
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -36,13 +36,13 @@
  * This class represents garbage collection and deoptimization information attached to a LIR instruction.
  */
 public class LIRDebugInfo {
-    public final CiFrame topFrame;
-    private final CiVirtualObject[] virtualObjects;
-    private final List<CiStackSlot> pointerSlots;
+    public final BytecodeFrame topFrame;
+    private final VirtualObject[] virtualObjects;
+    private final List<StackSlot> pointerSlots;
     public final LabelRef exceptionEdge;
-    private CiDebugInfo debugInfo;
+    private DebugInfo debugInfo;
 
-    public LIRDebugInfo(CiFrame topFrame, CiVirtualObject[] virtualObjects, List<CiStackSlot> pointerSlots, LabelRef exceptionEdge) {
+    public LIRDebugInfo(BytecodeFrame topFrame, VirtualObject[] virtualObjects, List<StackSlot> pointerSlots, LabelRef exceptionEdge) {
         this.topFrame = topFrame;
         this.virtualObjects = virtualObjects;
         this.pointerSlots = pointerSlots;
@@ -53,7 +53,7 @@
         return debugInfo != null;
     }
 
-    public CiDebugInfo debugInfo() {
+    public DebugInfo debugInfo() {
         assert debugInfo != null : "debug info not allocated yet";
         return debugInfo;
     }
@@ -64,11 +64,11 @@
      * @param proc The procedure called for variables.
      */
     public void forEachState(ValueProcedure proc) {
-        for (CiFrame cur = topFrame; cur != null; cur = cur.caller()) {
+        for (BytecodeFrame cur = topFrame; cur != null; cur = cur.caller()) {
             processValues(cur.values, proc);
         }
         if (virtualObjects != null) {
-            for (CiVirtualObject obj : virtualObjects) {
+            for (VirtualObject obj : virtualObjects) {
                 processValues(obj.values(), proc);
             }
         }
@@ -82,8 +82,8 @@
     private void processValues(Value[] values, ValueProcedure proc) {
         for (int i = 0; i < values.length; i++) {
             Value value = values[i];
-            if (value instanceof CiMonitorValue) {
-                CiMonitorValue monitor = (CiMonitorValue) value;
+            if (value instanceof MonitorValue) {
+                MonitorValue monitor = (MonitorValue) value;
                 if (processed(monitor.owner)) {
                     monitor.owner = proc.doValue(monitor.owner, OperandMode.Alive, STATE_FLAGS);
                 }
@@ -111,11 +111,11 @@
 
 
     public void finish(BitSet registerRefMap, BitSet frameRefMap, FrameMap frameMap) {
-        debugInfo = new CiDebugInfo(topFrame, registerRefMap, frameRefMap);
+        debugInfo = new DebugInfo(topFrame, registerRefMap, frameRefMap);
 
         // Add additional stack slots for outgoing method parameters.
         if (pointerSlots != null) {
-            for (CiStackSlot v : pointerSlots) {
+            for (StackSlot v : pointerSlots) {
                 frameMap.setReference(v, registerRefMap, frameRefMap);
             }
         }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -280,7 +280,7 @@
             Value value = values[i];
             if (isAddress(value)) {
                 assert flagsFor(mode, i).contains(OperandFlag.Address);
-                CiAddress address = asAddress(value);
+                Address address = asAddress(value);
                 address.base = proc.doValue(address.base, mode, ADDRESS_FLAGS);
                 address.index = proc.doValue(address.index, mode, ADDRESS_FLAGS);
             } else {
@@ -431,7 +431,7 @@
         if (info != null) {
             buf.append(" [bci:");
             String sep = "";
-            for (CiFrame cur = info.topFrame; cur != null; cur = cur.caller()) {
+            for (BytecodeFrame cur = info.topFrame; cur != null; cur = cur.caller()) {
                 buf.append(sep).append(cur.bci);
                 sep = ",";
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRValueUtil.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,38 @@
+/*
+ * 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.graal.lir;
+
+import com.oracle.graal.api.code.*;
+import com.oracle.graal.api.meta.*;
+
+public class LIRValueUtil extends ValueUtil {
+    public static boolean isVariable(Value value) {
+        assert value != null;
+        return value instanceof Variable;
+    }
+
+    public static Variable asVariable(Value value) {
+        assert value != null;
+        return (Variable) value;
+    }
+}
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,8 +22,8 @@
  */
 package com.oracle.graal.lir;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
-import static com.oracle.graal.lir.ValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
+import static com.oracle.graal.lir.LIRValueUtil.*;
 
 import java.util.*;
 
@@ -135,7 +135,7 @@
 
                 op.forEachInput(useProc);
                 if (op.hasCall()) {
-                    for (CiRegister register : frameMap.registerConfig.getCallerSaveRegisters()) {
+                    for (Register register : frameMap.registerConfig.getCallerSaveRegisters()) {
                         curRegistersLive[register.number] = null;
                     }
                 }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRXirInstruction.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRXirInstruction.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueUtil.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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.graal.lir;
-
-import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.meta.*;
-
-public class ValueUtil extends CiValueUtil {
-
-    public static boolean isVariable(Value value) {
-        assert value != null;
-        return value instanceof Variable;
-    }
-
-    public static Variable asVariable(Value value) {
-        assert value != null;
-        return (Variable) value;
-    }
-}
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java	Sat Jun 09 20:10:05 2012 +0200
@@ -27,7 +27,7 @@
 
 /**
  * Represents a value that is yet to be bound to a machine location (such as
- * a {@link CiRegisterValue} or {@link CiStackSlot}) by a register allocator.
+ * a {@link RegisterValue} or {@link StackSlot}) by a register allocator.
  */
 public final class Variable extends Value {
     private static final long serialVersionUID = 4507578431686109809L;
@@ -40,14 +40,14 @@
     /**
      * The type of register that this variable needs to get assigned.
      */
-    public final CiRegister.RegisterFlag flag;
+    public final Register.RegisterFlag flag;
 
     /**
      * Creates a new variable.
      * @param kind
      * @param index
      */
-    public Variable(Kind kind, int index, CiRegister.RegisterFlag flag) {
+    public Variable(Kind kind, int index, Register.RegisterFlag flag) {
         super(kind);
         assert kind == kind.stackKind() : "Variables can be only created for stack kinds";
         assert index >= 0;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.lir.asm;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
@@ -48,7 +48,7 @@
 
     public final AbstractAssembler asm;
     public final CompilationResult targetMethod;
-    public final CiTarget target;
+    public final TargetDescription target;
     public final CodeCacheProvider runtime;
     public final FrameMap frameMap;
 
@@ -66,7 +66,7 @@
     private List<ExceptionInfo> exceptionInfoList;
     private int lastSafepointPos;
 
-    public TargetMethodAssembler(CiTarget target, CodeCacheProvider runtime, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext, List<Code> stubs) {
+    public TargetMethodAssembler(TargetDescription target, CodeCacheProvider runtime, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext, List<Code> stubs) {
         this.target = target;
         this.runtime = runtime;
         this.frameMap = frameMap;
@@ -181,14 +181,14 @@
     }
 
     public void recordDirectCall(int posBefore, int posAfter, Object callTarget, LIRDebugInfo info) {
-        CiDebugInfo debugInfo = info != null ? info.debugInfo() : null;
+        DebugInfo debugInfo = info != null ? info.debugInfo() : null;
         assert lastSafepointPos < posAfter;
         lastSafepointPos = posAfter;
         targetMethod.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, true);
     }
 
     public void recordIndirectCall(int posBefore, int posAfter, Object callTarget, LIRDebugInfo info) {
-        CiDebugInfo debugInfo = info != null ? info.debugInfo() : null;
+        DebugInfo debugInfo = info != null ? info.debugInfo() : null;
         assert lastSafepointPos < posAfter;
         lastSafepointPos = posAfter;
         targetMethod.recordCall(posBefore, posAfter - posBefore, callTarget, debugInfo, false);
@@ -196,18 +196,18 @@
 
     public void recordSafepoint(int pos, LIRDebugInfo info) {
         // safepoints always need debug info
-        CiDebugInfo debugInfo = info.debugInfo();
+        DebugInfo debugInfo = info.debugInfo();
         assert lastSafepointPos < pos;
         lastSafepointPos = pos;
         targetMethod.recordSafepoint(pos, debugInfo);
     }
 
-    public CiAddress recordDataReferenceInCode(Constant data, int alignment) {
+    public Address recordDataReferenceInCode(Constant data, int alignment) {
         assert data != null;
         int pos = asm.codeBuffer.position();
         Debug.log("Data reference in code: pos = %d, data = %s", pos, data.toString());
         targetMethod.recordDataReference(pos, data, alignment);
-        return CiAddress.Placeholder;
+        return Address.Placeholder;
     }
 
     public int lastSafepointPos() {
@@ -231,11 +231,11 @@
     /**
      * Returns the address of a float constant that is embedded as a data references into the code.
      */
-    public CiAddress asFloatConstRef(Value value) {
+    public Address asFloatConstRef(Value value) {
         return asFloatConstRef(value, 4);
     }
 
-    public CiAddress asFloatConstRef(Value value, int alignment) {
+    public Address asFloatConstRef(Value value, int alignment) {
         assert value.kind == Kind.Float && isConstant(value);
         return recordDataReferenceInCode((Constant) value, alignment);
     }
@@ -243,11 +243,11 @@
     /**
      * Returns the address of a double constant that is embedded as a data references into the code.
      */
-    public CiAddress asDoubleConstRef(Value value) {
+    public Address asDoubleConstRef(Value value) {
         return asDoubleConstRef(value, 8);
     }
 
-    public CiAddress asDoubleConstRef(Value value, int alignment) {
+    public Address asDoubleConstRef(Value value, int alignment) {
         assert value.kind == Kind.Double && isConstant(value);
         return recordDataReferenceInCode((Constant) value, alignment);
     }
@@ -255,41 +255,41 @@
     /**
      * Returns the address of a long constant that is embedded as a data references into the code.
      */
-    public CiAddress asLongConstRef(Value value) {
+    public Address asLongConstRef(Value value) {
         assert value.kind == Kind.Long && isConstant(value);
         return recordDataReferenceInCode((Constant) value, 8);
     }
 
-    public CiAddress asIntAddr(Value value) {
+    public Address asIntAddr(Value value) {
         assert value.kind == Kind.Int;
         return asAddress(value);
     }
 
-    public CiAddress asLongAddr(Value value) {
+    public Address asLongAddr(Value value) {
         assert value.kind == Kind.Long;
         return asAddress(value);
     }
 
-    public CiAddress asObjectAddr(Value value) {
+    public Address asObjectAddr(Value value) {
         assert value.kind == Kind.Object;
         return asAddress(value);
     }
 
-    public CiAddress asFloatAddr(Value value) {
+    public Address asFloatAddr(Value value) {
         assert value.kind == Kind.Float;
         return asAddress(value);
     }
 
-    public CiAddress asDoubleAddr(Value value) {
+    public Address asDoubleAddr(Value value) {
         assert value.kind == Kind.Double;
         return asAddress(value);
     }
 
-    public CiAddress asAddress(Value value) {
+    public Address asAddress(Value value) {
         if (isStackSlot(value)) {
-            CiStackSlot slot = (CiStackSlot) value;
-            return new CiAddress(slot.kind, frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot));
+            StackSlot slot = (StackSlot) value;
+            return new Address(slot.kind, frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot));
         }
-        return (CiAddress) value;
+        return (Address) value;
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java	Sat Jun 09 20:10:05 2012 +0200
@@ -30,8 +30,8 @@
     ExtendedRiRuntime getRuntime();
     ValueNode getGuardAnchor();
     ValueNode createNullCheckGuard(ValueNode object, long leafGraphId);
-    ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, long leafGraphId);
-    ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId);
-    CiAssumptions assumptions();
+    ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, long leafGraphId);
+    ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated, long leafGraphId);
+    Assumptions assumptions();
 }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -32,16 +32,16 @@
 public class DeoptimizeNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
 
     private String message;
-    private final CiDeoptAction action;
+    private final DeoptimizationAction action;
     private final DeoptimizationReason reason;
     private final long leafGraphId;
 
 
-    public DeoptimizeNode(CiDeoptAction action, DeoptimizationReason reason) {
+    public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason) {
         this(action, reason, -1);
     }
 
-    public DeoptimizeNode(CiDeoptAction action, DeoptimizationReason reason, long leafGraphId) {
+    public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason, long leafGraphId) {
         super(StampFactory.forVoid());
         this.action = action;
         this.reason = reason;
@@ -56,7 +56,7 @@
         return message;
     }
 
-    public CiDeoptAction action() {
+    public DeoptimizationAction action() {
         return action;
     }
 
@@ -75,7 +75,7 @@
 
     @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void deopt(@ConstantNodeParameter CiDeoptAction action, @ConstantNodeParameter DeoptimizationReason reason) {
+    public static void deopt(@ConstantNodeParameter DeoptimizationAction action, @ConstantNodeParameter DeoptimizationReason reason) {
         throw new UnsupportedOperationException();
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -33,7 +33,7 @@
 
     @Input private BooleanNode condition;
     private final DeoptimizationReason deoptReason;
-    private final CiDeoptAction action;
+    private final DeoptimizationAction action;
     private boolean negated;
     private final long leafGraphId;
 
@@ -46,11 +46,11 @@
         condition = x;
     }
 
-    public FixedGuardNode(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, long leafGraphId) {
+    public FixedGuardNode(BooleanNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, long leafGraphId) {
         this(condition, deoptReason, action, false, leafGraphId);
     }
 
-    public FixedGuardNode(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+    public FixedGuardNode(BooleanNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated, long leafGraphId) {
         super(StampFactory.forVoid());
         this.action = action;
         this.negated = negated;
@@ -84,7 +84,7 @@
                 if (next != null) {
                     tool.deleteBranch(next);
                 }
-                setNext(graph().add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, deoptReason, leafGraphId)));
+                setNext(graph().add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, deoptReason, leafGraphId)));
                 return;
             }
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Sat Jun 09 20:10:05 2012 +0200
@@ -287,10 +287,10 @@
 
     private static String toString(FrameState frameState) {
         StringBuilder sb = new StringBuilder();
-        String nl = CiUtil.NEW_LINE;
+        String nl = CodeUtil.NEW_LINE;
         FrameState fs = frameState;
         while (fs != null) {
-            CiUtil.appendLocation(sb, fs.method, fs.bci).append(nl);
+            CodeUtil.appendLocation(sb, fs.method, fs.bci).append(nl);
             sb.append("locals: [");
             for (int i = 0; i < fs.localsSize(); i++) {
                 sb.append(i == 0 ? "" : ", ").append(fs.localAt(i) == null ? "_" : fs.localAt(i).toString(Verbosity.Id));
@@ -321,7 +321,7 @@
         Map<Object, Object> properties = super.getDebugProperties();
         properties.put("bci", bci);
         if (method != null) {
-            properties.put("method", CiUtil.format("%H.%n(%p):%r", method));
+            properties.put("method", CodeUtil.format("%H.%n(%p):%r", method));
         } else {
             properties.put("method", "None");
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -46,7 +46,7 @@
     @Input private BooleanNode condition;
     @Input(notDataflow = true) private FixedNode anchor;
     private final DeoptimizationReason reason;
-    private final CiDeoptAction action;
+    private final DeoptimizationAction action;
     private boolean negated;
     private final long leafGraphId;
 
@@ -79,11 +79,11 @@
         return reason;
     }
 
-    public CiDeoptAction action() {
+    public DeoptimizationAction action() {
         return action;
     }
 
-    public GuardNode(BooleanNode condition, FixedNode anchor, DeoptimizationReason reason, CiDeoptAction action, boolean negated, long leafGraphId) {
+    public GuardNode(BooleanNode condition, FixedNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, long leafGraphId) {
         super(StampFactory.dependency());
         this.condition = condition;
         this.anchor = anchor;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -92,7 +92,7 @@
     public Map<Object, Object> getDebugProperties() {
         Map<Object, Object> debugProperties = super.getDebugProperties();
         if (callTarget != null && callTarget.targetMethod() != null) {
-            debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
+            debugProperties.put("targetMethod", CodeUtil.format("%h.%n(%p)", callTarget.targetMethod()));
         }
         return debugProperties;
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -162,7 +162,7 @@
         Map<Object, Object> debugProperties = super.getDebugProperties();
         debugProperties.put("memoryCheckpoint", "true");
         if (callTarget != null && callTarget.targetMethod() != null) {
-            debugProperties.put("targetMethod", CiUtil.format("%h.%n(%p)", callTarget.targetMethod()));
+            debugProperties.put("targetMethod", CodeUtil.format("%h.%n(%p)", callTarget.targetMethod()));
         }
         return debugProperties;
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoopBeginNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -116,7 +116,7 @@
         } else {
             return super.forwardEndIndex(pred);
         }
-        throw ValueUtil.shouldNotReachHere("unknown pred : " + pred);
+        throw ValueNodeUtil.shouldNotReachHere("unknown pred : " + pred);
     }
 
     @Override
@@ -131,7 +131,7 @@
                 return end;
             }
         }
-        throw ValueUtil.shouldNotReachHere();
+        throw ValueNodeUtil.shouldNotReachHere();
     }
 
     @Override
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -47,6 +47,6 @@
 
     @Override
     public void generate(LIRGeneratorTool gen) {
-        gen.emitCall(CiRuntimeCall.UnwindException, false, gen.operand(exception()));
+        gen.emitCall(RuntimeCall.UnwindException, false, gen.operand(exception()));
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java	Sat Jun 09 20:10:05 2012 +0200
@@ -0,0 +1,108 @@
+/*
+ * 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.graal.nodes;
+
+import java.util.*;
+
+import com.oracle.graal.api.meta.*;
+import com.oracle.graal.graph.*;
+import com.oracle.graal.graph.Node.Verbosity;
+
+
+public class ValueNodeUtil {
+
+    public static ValueNode assertKind(Kind kind, ValueNode x) {
+        assert x != null && ((x.kind() == kind) || (x.kind() == Kind.Jsr && kind == Kind.Object)) : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.kind());
+        return x;
+    }
+
+    public static RuntimeException shouldNotReachHere(String msg) {
+        throw new InternalError("should not reach here: " + msg);
+    }
+
+    public static RuntimeException shouldNotReachHere() {
+        throw new InternalError("should not reach here");
+    }
+
+    public static ValueNode assertLong(ValueNode x) {
+        assert x != null && (x.kind() == Kind.Long);
+        return x;
+    }
+
+    public static ValueNode assertJsr(ValueNode x) {
+        assert x != null && (x.kind() == Kind.Jsr);
+        return x;
+    }
+
+    public static ValueNode assertInt(ValueNode x) {
+        assert x != null && (x.kind() == Kind.Int);
+        return x;
+    }
+
+    public static ValueNode assertFloat(ValueNode x) {
+        assert x != null && (x.kind() == Kind.Float);
+        return x;
+    }
+
+    public static ValueNode assertObject(ValueNode x) {
+        assert x != null && (x.kind() == Kind.Object);
+        return x;
+    }
+
+    public static ValueNode assertDouble(ValueNode x) {
+        assert x != null && (x.kind() == Kind.Double);
+        return x;
+    }
+
+    public static void assertHigh(ValueNode x) {
+        assert x == null;
+    }
+
+    public static boolean typeMismatch(ValueNode x, ValueNode y) {
+        return y == null || x == null || x.kind() != y.kind();
+    }
+
+
+    @SuppressWarnings("unchecked")
+    public static <T extends Node> Collection<T> filter(Iterable<Node> nodes, Class<T> clazz) {
+        ArrayList<T> phis = new ArrayList<>();
+        for (Node node : nodes) {
+            if (clazz.isInstance(node)) {
+                phis.add((T) node);
+            }
+        }
+        return phis;
+    }
+
+    /**
+     * Converts a given instruction to a value string. The representation of an node as
+     * a value is formed by concatenating the {@linkplain com.oracle.graal.api.meta.Kind#typeChar character} denoting its
+     * {@linkplain ValueNode#kind kind} and its {@linkplain Node#id()}. For example, {@code "i13"}.
+     *
+     * @param value the instruction to convert to a value string. If {@code value == null}, then "-" is returned.
+     * @return the instruction representation as a string
+     */
+    public static String valueString(ValueNode value) {
+        return (value == null) ? "-" : ("" + value.kind().typeChar + value.toString(Verbosity.Id));
+    }
+}
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueUtil.java	Sat Jun 09 18:01:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +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.graal.nodes;
-
-import java.util.*;
-
-import com.oracle.graal.api.meta.*;
-import com.oracle.graal.graph.*;
-import com.oracle.graal.graph.Node.Verbosity;
-
-
-public class ValueUtil {
-
-    public static ValueNode assertKind(Kind kind, ValueNode x) {
-        assert x != null && ((x.kind() == kind) || (x.kind() == Kind.Jsr && kind == Kind.Object)) : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.kind());
-        return x;
-    }
-
-    public static RuntimeException shouldNotReachHere(String msg) {
-        throw new InternalError("should not reach here: " + msg);
-    }
-
-    public static RuntimeException shouldNotReachHere() {
-        throw new InternalError("should not reach here");
-    }
-
-    public static ValueNode assertLong(ValueNode x) {
-        assert x != null && (x.kind() == Kind.Long);
-        return x;
-    }
-
-    public static ValueNode assertJsr(ValueNode x) {
-        assert x != null && (x.kind() == Kind.Jsr);
-        return x;
-    }
-
-    public static ValueNode assertInt(ValueNode x) {
-        assert x != null && (x.kind() == Kind.Int);
-        return x;
-    }
-
-    public static ValueNode assertFloat(ValueNode x) {
-        assert x != null && (x.kind() == Kind.Float);
-        return x;
-    }
-
-    public static ValueNode assertObject(ValueNode x) {
-        assert x != null && (x.kind() == Kind.Object);
-        return x;
-    }
-
-    public static ValueNode assertDouble(ValueNode x) {
-        assert x != null && (x.kind() == Kind.Double);
-        return x;
-    }
-
-    public static void assertHigh(ValueNode x) {
-        assert x == null;
-    }
-
-    public static boolean typeMismatch(ValueNode x, ValueNode y) {
-        return y == null || x == null || x.kind() != y.kind();
-    }
-
-
-    @SuppressWarnings("unchecked")
-    public static <T extends Node> Collection<T> filter(Iterable<Node> nodes, Class<T> clazz) {
-        ArrayList<T> phis = new ArrayList<>();
-        for (Node node : nodes) {
-            if (clazz.isInstance(node)) {
-                phis.add((T) node);
-            }
-        }
-        return phis;
-    }
-
-    /**
-     * Converts a given instruction to a value string. The representation of an node as
-     * a value is formed by concatenating the {@linkplain com.oracle.graal.api.meta.Kind#typeChar character} denoting its
-     * {@linkplain ValueNode#kind kind} and its {@linkplain Node#id()}. For example, {@code "i13"}.
-     *
-     * @param value the instruction to convert to a value string. If {@code value == null}, then "-" is returned.
-     * @return the instruction representation as a string
-     */
-    public static String valueString(ValueNode value) {
-        return (value == null) ? "-" : ("" + value.kind().typeChar + value.toString(Verbosity.Id));
-    }
-}
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerArithmeticNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -43,7 +43,7 @@
             case Long:
                 return graph.unique(new IntegerAddNode(Kind.Long, v1, v2));
             default:
-                throw ValueUtil.shouldNotReachHere();
+                throw ValueNodeUtil.shouldNotReachHere();
         }
     }
 
@@ -56,7 +56,7 @@
             case Long:
                 return graph.unique(new IntegerMulNode(Kind.Long, v1, v2));
             default:
-                throw ValueUtil.shouldNotReachHere();
+                throw ValueNodeUtil.shouldNotReachHere();
         }
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerMulNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -55,8 +55,8 @@
             if (c == 0) {
                 return ConstantNode.defaultForKind(kind(), graph());
             }
-            if (c > 0 && CiUtil.isPowerOf2(c)) {
-                return graph().unique(new LeftShiftNode(kind(), x(), ConstantNode.forInt(CiUtil.log2(c), graph())));
+            if (c > 0 && CodeUtil.isPowerOf2(c)) {
+                return graph().unique(new LeftShiftNode(kind(), x(), ConstantNode.forInt(CodeUtil.log2(c), graph())));
             }
             // canonicalize expressions like "(a * 1) * 2"
             if (x() instanceof IntegerMulNode) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/RuntimeCallNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -29,21 +29,21 @@
 
 public final class RuntimeCallNode extends AbstractCallNode implements LIRLowerable {
 
-    private final CiRuntimeCall call;
+    private final RuntimeCall call;
 
-    public CiRuntimeCall call() {
+    public RuntimeCall call() {
         return call;
     }
 
-    public RuntimeCallNode(CiRuntimeCall call) {
+    public RuntimeCallNode(RuntimeCall call) {
         this(call, new ValueNode[0]);
     }
 
-    public RuntimeCallNode(CiRuntimeCall call, ValueNode arg1) {
+    public RuntimeCallNode(RuntimeCall call, ValueNode arg1) {
         this(call, new ValueNode[] {arg1});
     }
 
-    public RuntimeCallNode(CiRuntimeCall call, ValueNode[] arguments) {
+    public RuntimeCallNode(RuntimeCall call, ValueNode[] arguments) {
         super(StampFactory.forKind(call.resultKind), arguments);
         this.call = call;
     }
@@ -56,13 +56,13 @@
     // specialized on return type (instead of public static <T> T performCall) until boxing/unboxing is sorted out in intrinsification
     @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static <S> double performCall(@ConstantNodeParameter CiRuntimeCall call, S arg1) {
+    public static <S> double performCall(@ConstantNodeParameter RuntimeCall call, S arg1) {
         throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
     }
 
     @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static long performCall(@ConstantNodeParameter CiRuntimeCall call) {
+    public static long performCall(@ConstantNodeParameter RuntimeCall call) {
         throw new UnsupportedOperationException("This method may only be compiled with the Graal compiler");
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -82,7 +82,7 @@
                     case Double:
                         return ConstantNode.forDouble((Long) o, graph());
                     default:
-                        ValueUtil.shouldNotReachHere();
+                        ValueNodeUtil.shouldNotReachHere();
                 }
             }
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -97,7 +97,7 @@
     @Override
     public Map<Object, Object> getDebugProperties() {
         Map<Object, Object> debugProperties = super.getDebugProperties();
-        debugProperties.put("field", CiUtil.format("%h.%n", field));
+        debugProperties.put("field", CodeUtil.format("%h.%n", field));
         return debugProperties;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java	Sat Jun 09 20:10:05 2012 +0200
@@ -45,7 +45,7 @@
 
     @Override
     public void generate(LIRGeneratorTool gen) {
-        gen.emitCall(CiRuntimeCall.RegisterFinalizer, true, gen.operand(object()));
+        gen.emitCall(RuntimeCall.RegisterFinalizer, true, gen.operand(object()));
     }
 
     @Override
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Sat Jun 09 20:10:05 2012 +0200
@@ -27,8 +27,8 @@
 
 
 public interface CanonicalizerTool {
-    CiTarget target();
-    CiAssumptions assumptions();
+    TargetDescription target();
+    Assumptions assumptions();
     CodeCacheProvider runtime();
 
     /**
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Sat Jun 09 20:10:05 2012 +0200
@@ -30,7 +30,7 @@
 import com.oracle.graal.nodes.java.*;
 
 public abstract class LIRGeneratorTool {
-    public abstract CiTarget target();
+    public abstract TargetDescription target();
 
     /**
      * Checks whether the supplied constant can be used without loading it into a register
@@ -52,7 +52,7 @@
     public abstract Value newVariable(Kind kind);
     public abstract Value setResult(ValueNode x, Value operand);
 
-    public abstract CiAddress makeAddress(LocationNode location, ValueNode object);
+    public abstract Address makeAddress(LocationNode location, ValueNode object);
 
     public abstract Value emitMove(Value input);
     public abstract void emitMove(Value src, Value dst);
@@ -79,16 +79,16 @@
 
     public abstract Value emitConvert(ConvertNode.Op opcode, Value inputVal);
     public abstract void emitMembar(int barriers);
-    public abstract void emitDeoptimizeOnOverflow(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo);
-    public abstract void emitDeoptimize(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo, long leafGraphId);
+    public abstract void emitDeoptimizeOnOverflow(DeoptimizationAction action, DeoptimizationReason reason, Object deoptInfo);
+    public abstract void emitDeoptimize(DeoptimizationAction action, DeoptimizationReason reason, Object deoptInfo, long leafGraphId);
     public abstract Value emitCall(Object target, Kind result, Kind[] arguments, boolean canTrap, Value... args);
-    public final Value emitCall(CiRuntimeCall runtimeCall, boolean canTrap, Value... args) {
+    public final Value emitCall(RuntimeCall runtimeCall, boolean canTrap, Value... args) {
         return emitCall(runtimeCall, runtimeCall.resultKind, runtimeCall.arguments, canTrap, args);
     }
 
     public abstract void emitIf(IfNode i);
     public abstract void emitConditional(ConditionalNode i);
-    public abstract void emitGuardCheck(BooleanNode comp, DeoptimizationReason deoptReason, CiDeoptAction deoptAction, boolean negated, long leafGraphId);
+    public abstract void emitGuardCheck(BooleanNode comp, DeoptimizationReason deoptReason, DeoptimizationAction deoptAction, boolean negated, long leafGraphId);
 
     public abstract void emitLookupSwitch(LookupSwitchNode i);
     public abstract void emitTableSwitch(TableSwitchNode i);
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.printer;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.io.*;
 import java.util.*;
@@ -49,7 +49,7 @@
  */
 class CFGPrinter extends CompilationPrinter {
 
-    protected CiTarget target;
+    protected TargetDescription target;
     protected LIR lir;
     protected LIRGenerator lirGenerator;
     protected ControlFlowGraph cfg;
@@ -382,7 +382,7 @@
         StringBuilder buf = new StringBuilder();
         FrameState curState = state;
         do {
-            buf.append(CiUtil.toLocation(curState.method(), curState.bci)).append('\n');
+            buf.append(CodeUtil.toLocation(curState.method(), curState.bci)).append('\n');
 
             if (curState.stackSize() > 0) {
                 buf.append("stack: ");
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -150,7 +150,7 @@
         for (Object o : Debug.context()) {
             if (o instanceof ResolvedJavaMethod) {
                 ResolvedJavaMethod method = (ResolvedJavaMethod) o;
-                result.add(CiUtil.format("%H::%n(%p)", method));
+                result.add(CodeUtil.format("%H::%n(%p)", method));
             } else if (o instanceof DebugDumpScope) {
                 DebugDumpScope debugDumpScope = (DebugDumpScope) o;
                 if (debugDumpScope.decorator && !result.isEmpty()) {
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java	Sat Jun 09 20:10:05 2012 +0200
@@ -30,7 +30,7 @@
  * Definition of the snippets that are VM-independent and can be intrinsified by Graal in any VM.
  */
 public class GraalIntrinsics {
-    public static void installIntrinsics(ExtendedRiRuntime runtime, CiTarget target) {
+    public static void installIntrinsics(ExtendedRiRuntime runtime, TargetDescription target) {
         if (GraalOptions.Intrinsify) {
             Snippets.install(runtime, target, new MathSnippetsX86());
             Snippets.install(runtime, target, new DoubleSnippets());
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/MathSnippetsX86.java	Sat Jun 09 20:10:05 2012 +0200
@@ -61,7 +61,7 @@
         if (abs(x) < PI_4) {
             return MathIntrinsicNode.compute(x, Operation.SIN);
         } else {
-            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticSin, x);
+            return RuntimeCallNode.performCall(RuntimeCall.ArithmeticSin, x);
         }
     }
 
@@ -69,7 +69,7 @@
         if (abs(x) < PI_4) {
             return MathIntrinsicNode.compute(x, Operation.COS);
         } else {
-            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticCos, x);
+            return RuntimeCallNode.performCall(RuntimeCall.ArithmeticCos, x);
         }
     }
 
@@ -77,7 +77,7 @@
         if (abs(x) < PI_4) {
             return MathIntrinsicNode.compute(x, Operation.TAN);
         } else {
-            return RuntimeCallNode.performCall(CiRuntimeCall.ArithmeticTan, x);
+            return RuntimeCallNode.performCall(RuntimeCall.ArithmeticTan, x);
         }
     }
 
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java	Sat Jun 09 20:10:05 2012 +0200
@@ -104,7 +104,7 @@
 
         @Override
         public String toString() {
-            return CiUtil.format("%h.%n", method) + map.toString();
+            return CodeUtil.format("%h.%n", method) + map.toString();
         }
     }
 
@@ -190,7 +190,7 @@
         Parameter[] parameterAnnotations = new Parameter[parameterCount];
         ConstantNode[] placeholders = new ConstantNode[parameterCount];
         for (int i = 0; i < parameterCount; i++) {
-            ConstantParameter c = CiUtil.getParameterAnnotation(ConstantParameter.class, i, method);
+            ConstantParameter c = CodeUtil.getParameterAnnotation(ConstantParameter.class, i, method);
             if (c != null) {
                 String name = c.value();
                 Object arg = key.get(name);
@@ -199,7 +199,7 @@
                 assert checkConstantArgument(method, signature, i, name, arg, kind);
                 replacements.put(snippetGraph.getLocal(i), ConstantNode.forCiConstant(Constant.forBoxed(kind, arg), runtime, snippetCopy));
             } else {
-                Parameter p = CiUtil.getParameterAnnotation(Parameter.class, i, method);
+                Parameter p = CodeUtil.getParameterAnnotation(Parameter.class, i, method);
                 assert p != null : method + ": parameter " + i + " must be annotated with either @Constant or @Parameter";
                 String name = p.value();
                 if (p.multiple()) {
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java	Sat Jun 09 20:10:05 2012 +0200
@@ -43,7 +43,7 @@
  */
 public class Snippets {
 
-    public static void install(ExtendedRiRuntime runtime, CiTarget target, SnippetsInterface obj) {
+    public static void install(ExtendedRiRuntime runtime, TargetDescription target, SnippetsInterface obj) {
         Class<? extends SnippetsInterface> clazz = obj.getClass();
         BoxingMethodPool pool = new BoxingMethodPool(runtime);
         if (clazz.isAnnotationPresent(ClassSubstitution.class)) {
@@ -53,7 +53,7 @@
         }
     }
 
-    private static void installSnippets(ExtendedRiRuntime runtime, CiTarget target, Class< ? extends SnippetsInterface> clazz, BoxingMethodPool pool) {
+    private static void installSnippets(ExtendedRiRuntime runtime, TargetDescription target, Class< ? extends SnippetsInterface> clazz, BoxingMethodPool pool) {
         for (Method method : clazz.getDeclaredMethods()) {
             if (method.getAnnotation(Snippet.class) != null) {
                 Method snippet = method;
@@ -69,7 +69,7 @@
         }
     }
 
-    private static void installSubstitution(ExtendedRiRuntime runtime, CiTarget target, Class< ? extends SnippetsInterface> clazz,
+    private static void installSubstitution(ExtendedRiRuntime runtime, TargetDescription target, Class< ? extends SnippetsInterface> clazz,
                     BoxingMethodPool pool, Class<?> original) throws GraalInternalError {
         for (Method snippet : clazz.getDeclaredMethods()) {
             try {
@@ -90,7 +90,7 @@
         }
     }
 
-    private static StructuredGraph buildSnippetGraph(final ResolvedJavaMethod snippetRiMethod, final ExtendedRiRuntime runtime, final CiTarget target, final BoxingMethodPool pool) {
+    private static StructuredGraph buildSnippetGraph(final ResolvedJavaMethod snippetRiMethod, final ExtendedRiRuntime runtime, final TargetDescription target, final BoxingMethodPool pool) {
         final StructuredGraph graph = new StructuredGraph(snippetRiMethod);
         return Debug.scope("BuildSnippetGraph", new Object[] {snippetRiMethod, graph}, new Callable<StructuredGraph>() {
             @Override
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64MathIntrinsicOp.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64MathIntrinsicOp.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.graal.snippets.target.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.util.*;
 
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/AbstractAssembler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/AbstractAssembler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -23,16 +23,16 @@
 package com.oracle.max.asm;
 
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiArchitecture.*;
+import com.oracle.graal.api.code.Architecture.*;
 
 /**
  * The platform-independent base class for the assembler.
  */
 public abstract class AbstractAssembler {
-    public final CiTarget target;
+    public final TargetDescription target;
     public final Buffer codeBuffer;
 
-    public AbstractAssembler(CiTarget target) {
+    public AbstractAssembler(TargetDescription target) {
         this.target = target;
 
         if (target.arch.byteOrder == ByteOrder.BigEndian) {
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,67 +22,67 @@
  */
 package com.oracle.max.asm.target.amd64;
 
-import static com.oracle.graal.api.code.CiRegister.RegisterFlag.*;
+import static com.oracle.graal.api.code.Register.RegisterFlag.*;
 import static com.oracle.graal.api.meta.Kind.*;
 import static com.oracle.max.cri.util.MemoryBarriers.*;
 
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiRegister.*;
+import com.oracle.graal.api.code.Register.*;
 
 /**
  * Represents the AMD64 architecture.
  */
-public class AMD64 extends CiArchitecture {
+public class AMD64 extends Architecture {
 
     // General purpose CPU registers
-    public static final CiRegister rax = new CiRegister(0, 0, 8, "rax", CPU, RegisterFlag.Byte);
-    public static final CiRegister rcx = new CiRegister(1, 1, 8, "rcx", CPU, RegisterFlag.Byte);
-    public static final CiRegister rdx = new CiRegister(2, 2, 8, "rdx", CPU, RegisterFlag.Byte);
-    public static final CiRegister rbx = new CiRegister(3, 3, 8, "rbx", CPU, RegisterFlag.Byte);
-    public static final CiRegister rsp = new CiRegister(4, 4, 8, "rsp", CPU, RegisterFlag.Byte);
-    public static final CiRegister rbp = new CiRegister(5, 5, 8, "rbp", CPU, RegisterFlag.Byte);
-    public static final CiRegister rsi = new CiRegister(6, 6, 8, "rsi", CPU, RegisterFlag.Byte);
-    public static final CiRegister rdi = new CiRegister(7, 7, 8, "rdi", CPU, RegisterFlag.Byte);
+    public static final Register rax = new Register(0, 0, 8, "rax", CPU, RegisterFlag.Byte);
+    public static final Register rcx = new Register(1, 1, 8, "rcx", CPU, RegisterFlag.Byte);
+    public static final Register rdx = new Register(2, 2, 8, "rdx", CPU, RegisterFlag.Byte);
+    public static final Register rbx = new Register(3, 3, 8, "rbx", CPU, RegisterFlag.Byte);
+    public static final Register rsp = new Register(4, 4, 8, "rsp", CPU, RegisterFlag.Byte);
+    public static final Register rbp = new Register(5, 5, 8, "rbp", CPU, RegisterFlag.Byte);
+    public static final Register rsi = new Register(6, 6, 8, "rsi", CPU, RegisterFlag.Byte);
+    public static final Register rdi = new Register(7, 7, 8, "rdi", CPU, RegisterFlag.Byte);
 
-    public static final CiRegister r8  = new CiRegister(8,  8,  8, "r8", CPU, RegisterFlag.Byte);
-    public static final CiRegister r9  = new CiRegister(9,  9,  8, "r9", CPU, RegisterFlag.Byte);
-    public static final CiRegister r10 = new CiRegister(10, 10, 8, "r10", CPU, RegisterFlag.Byte);
-    public static final CiRegister r11 = new CiRegister(11, 11, 8, "r11", CPU, RegisterFlag.Byte);
-    public static final CiRegister r12 = new CiRegister(12, 12, 8, "r12", CPU, RegisterFlag.Byte);
-    public static final CiRegister r13 = new CiRegister(13, 13, 8, "r13", CPU, RegisterFlag.Byte);
-    public static final CiRegister r14 = new CiRegister(14, 14, 8, "r14", CPU, RegisterFlag.Byte);
-    public static final CiRegister r15 = new CiRegister(15, 15, 8, "r15", CPU, RegisterFlag.Byte);
+    public static final Register r8  = new Register(8,  8,  8, "r8", CPU, RegisterFlag.Byte);
+    public static final Register r9  = new Register(9,  9,  8, "r9", CPU, RegisterFlag.Byte);
+    public static final Register r10 = new Register(10, 10, 8, "r10", CPU, RegisterFlag.Byte);
+    public static final Register r11 = new Register(11, 11, 8, "r11", CPU, RegisterFlag.Byte);
+    public static final Register r12 = new Register(12, 12, 8, "r12", CPU, RegisterFlag.Byte);
+    public static final Register r13 = new Register(13, 13, 8, "r13", CPU, RegisterFlag.Byte);
+    public static final Register r14 = new Register(14, 14, 8, "r14", CPU, RegisterFlag.Byte);
+    public static final Register r15 = new Register(15, 15, 8, "r15", CPU, RegisterFlag.Byte);
 
-    public static final CiRegister[] cpuRegisters = {
+    public static final Register[] cpuRegisters = {
         rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi,
         r8, r9, r10, r11, r12, r13, r14, r15
     };
 
     // XMM registers
-    public static final CiRegister xmm0 = new CiRegister(16, 0, 8, "xmm0", FPU);
-    public static final CiRegister xmm1 = new CiRegister(17, 1, 8, "xmm1", FPU);
-    public static final CiRegister xmm2 = new CiRegister(18, 2, 8, "xmm2", FPU);
-    public static final CiRegister xmm3 = new CiRegister(19, 3, 8, "xmm3", FPU);
-    public static final CiRegister xmm4 = new CiRegister(20, 4, 8, "xmm4", FPU);
-    public static final CiRegister xmm5 = new CiRegister(21, 5, 8, "xmm5", FPU);
-    public static final CiRegister xmm6 = new CiRegister(22, 6, 8, "xmm6", FPU);
-    public static final CiRegister xmm7 = new CiRegister(23, 7, 8, "xmm7", FPU);
+    public static final Register xmm0 = new Register(16, 0, 8, "xmm0", FPU);
+    public static final Register xmm1 = new Register(17, 1, 8, "xmm1", FPU);
+    public static final Register xmm2 = new Register(18, 2, 8, "xmm2", FPU);
+    public static final Register xmm3 = new Register(19, 3, 8, "xmm3", FPU);
+    public static final Register xmm4 = new Register(20, 4, 8, "xmm4", FPU);
+    public static final Register xmm5 = new Register(21, 5, 8, "xmm5", FPU);
+    public static final Register xmm6 = new Register(22, 6, 8, "xmm6", FPU);
+    public static final Register xmm7 = new Register(23, 7, 8, "xmm7", FPU);
 
-    public static final CiRegister xmm8 =  new CiRegister(24,  8, 8, "xmm8",  FPU);
-    public static final CiRegister xmm9 =  new CiRegister(25,  9, 8, "xmm9",  FPU);
-    public static final CiRegister xmm10 = new CiRegister(26, 10, 8, "xmm10", FPU);
-    public static final CiRegister xmm11 = new CiRegister(27, 11, 8, "xmm11", FPU);
-    public static final CiRegister xmm12 = new CiRegister(28, 12, 8, "xmm12", FPU);
-    public static final CiRegister xmm13 = new CiRegister(29, 13, 8, "xmm13", FPU);
-    public static final CiRegister xmm14 = new CiRegister(30, 14, 8, "xmm14", FPU);
-    public static final CiRegister xmm15 = new CiRegister(31, 15, 8, "xmm15", FPU);
+    public static final Register xmm8 =  new Register(24,  8, 8, "xmm8",  FPU);
+    public static final Register xmm9 =  new Register(25,  9, 8, "xmm9",  FPU);
+    public static final Register xmm10 = new Register(26, 10, 8, "xmm10", FPU);
+    public static final Register xmm11 = new Register(27, 11, 8, "xmm11", FPU);
+    public static final Register xmm12 = new Register(28, 12, 8, "xmm12", FPU);
+    public static final Register xmm13 = new Register(29, 13, 8, "xmm13", FPU);
+    public static final Register xmm14 = new Register(30, 14, 8, "xmm14", FPU);
+    public static final Register xmm15 = new Register(31, 15, 8, "xmm15", FPU);
 
-    public static final CiRegister[] xmmRegisters = {
+    public static final Register[] xmmRegisters = {
         xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
         xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
     };
 
-    public static final CiRegister[] cpuxmmRegisters = {
+    public static final Register[] cpuxmmRegisters = {
         rax,  rcx,  rdx,   rbx,   rsp,   rbp,   rsi,   rdi,
         r8,   r9,   r10,   r11,   r12,   r13,   r14,   r15,
         xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
@@ -92,9 +92,9 @@
     /**
      * Register used to construct an instruction-relative address.
      */
-    public static final CiRegister rip = new CiRegister(32, -1, 0, "rip");
+    public static final Register rip = new Register(32, -1, 0, "rip");
 
-    public static final CiRegister[] allRegisters = {
+    public static final Register[] allRegisters = {
         rax,  rcx,  rdx,   rbx,   rsp,   rbp,   rsi,   rdi,
         r8,   r9,   r10,   r11,   r12,   r13,   r14,   r15,
         xmm0, xmm1, xmm2,  xmm3,  xmm4,  xmm5,  xmm6,  xmm7,
@@ -102,7 +102,7 @@
         rip
     };
 
-    public static final CiRegisterValue RSP = rsp.asValue(Long);
+    public static final RegisterValue RSP = rsp.asValue(Long);
 
     public AMD64() {
         super("AMD64",
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.asm.target.amd64;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 import static com.oracle.max.asm.NumUtil.*;
 import static com.oracle.max.asm.target.amd64.AMD64.*;
 import static com.oracle.max.cri.util.MemoryBarriers.*;
@@ -125,28 +125,28 @@
     }
 
     /**
-     * The register to which {@link CiRegister#Frame} and {@link CiRegister#CallerFrame} are bound.
+     * The register to which {@link Register#Frame} and {@link Register#CallerFrame} are bound.
      */
-    public final CiRegister frameRegister;
+    public final Register frameRegister;
 
     /**
      * Constructs an assembler for the AMD64 architecture.
      *
-     * @param registerConfig the register configuration used to bind {@link CiRegister#Frame} and
-     *            {@link CiRegister#CallerFrame} to physical registers. This value can be null if this assembler
+     * @param registerConfig the register configuration used to bind {@link Register#Frame} and
+     *            {@link Register#CallerFrame} to physical registers. This value can be null if this assembler
      *            instance will not be used to assemble instructions using these logical registers.
      */
-    public AMD64Assembler(CiTarget target, CiRegisterConfig registerConfig) {
+    public AMD64Assembler(TargetDescription target, RegisterConfig registerConfig) {
         super(target);
         this.frameRegister = registerConfig == null ? null : registerConfig.getFrameRegister();
     }
 
-    private static int encode(CiRegister r) {
+    private static int encode(Register r) {
         assert r.encoding < 16 && r.encoding >= 0 : "encoding out of range: " + r.encoding;
         return r.encoding & 0x7;
     }
 
-    private void emitArithB(int op1, int op2, CiRegister dst, int imm8) {
+    private void emitArithB(int op1, int op2, Register dst, int imm8) {
         assert dst.isByte() : "must have byte register";
         assert isUByte(op1) && isUByte(op2) : "wrong opcode";
         assert isUByte(imm8) : "not a byte";
@@ -156,7 +156,7 @@
         emitByte(imm8);
     }
 
-    private void emitArith(int op1, int op2, CiRegister dst, int imm32) {
+    private void emitArith(int op1, int op2, Register dst, int imm32) {
         assert isUByte(op1) && isUByte(op2) : "wrong opcode";
         assert (op1 & 0x01) == 1 : "should be 32bit operation";
         assert (op1 & 0x02) == 0 : "sign-extension bit should not be set";
@@ -172,7 +172,7 @@
     }
 
     // immediate-to-memory forms
-    private void emitArithOperand(int op1, CiRegister rm, CiAddress adr, int imm32) {
+    private void emitArithOperand(int op1, Register rm, Address adr, int imm32) {
         assert (op1 & 0x01) == 1 : "should be 32bit operation";
         assert (op1 & 0x02) == 0 : "sign-extension bit should not be set";
         if (isByte(imm32)) {
@@ -186,21 +186,21 @@
         }
     }
 
-    private void emitArith(int op1, int op2, CiRegister dst, CiRegister src) {
+    private void emitArith(int op1, int op2, Register dst, Register src) {
         assert isUByte(op1) && isUByte(op2) : "wrong opcode";
         emitByte(op1);
         emitByte(op2 | encode(dst) << 3 | encode(src));
     }
 
-    private void emitOperandHelper(CiRegister reg, CiAddress addr) {
-        CiRegister base = isLegal(addr.base) ? asRegister(addr.base) : CiRegister.None;
-        CiRegister index = isLegal(addr.index) ? asRegister(addr.index) : CiRegister.None;
-
-        CiAddress.Scale scale = addr.scale;
+    private void emitOperandHelper(Register reg, Address addr) {
+        Register base = isLegal(addr.base) ? asRegister(addr.base) : Register.None;
+        Register index = isLegal(addr.index) ? asRegister(addr.index) : Register.None;
+
+        Address.Scale scale = addr.scale;
         int disp = addr.displacement;
 
-        if (base == CiRegister.Frame) {
-            assert frameRegister != null : "cannot use register " + CiRegister.Frame + " in assembler with null register configuration";
+        if (base == Register.Frame) {
+            assert frameRegister != null : "cannot use register " + Register.Frame + " in assembler with null register configuration";
             base = frameRegister;
 //        } else if (base == CiRegister.CallerFrame) {
 //            assert frameRegister != null : "cannot use register " + CiRegister.Frame + " in assembler with null register configuration";
@@ -210,14 +210,14 @@
 
         // Encode the registers as needed in the fields they are used in
 
-        assert reg != CiRegister.None;
+        assert reg != Register.None;
         int regenc = encode(reg) << 3;
 
         if (base == AMD64.rip) {
             // [00 000 101] disp32
             emitByte(0x05 | regenc);
             emitInt(disp);
-        } else if (addr == CiAddress.Placeholder) {
+        } else if (addr == Address.Placeholder) {
             // [00 000 101] disp32
             emitByte(0x05 | regenc);
             emitInt(0);
@@ -306,29 +306,29 @@
         }
     }
 
-    public final void addl(CiAddress dst, int imm32) {
+    public final void addl(Address dst, int imm32) {
         prefix(dst);
         emitArithOperand(0x81, rax, dst, imm32);
     }
 
-    public final void addl(CiAddress dst, CiRegister src) {
+    public final void addl(Address dst, Register src) {
         prefix(dst, src);
         emitByte(0x01);
         emitOperandHelper(src, dst);
     }
 
-    public final void addl(CiRegister dst, int imm32) {
+    public final void addl(Register dst, int imm32) {
         prefix(dst);
         emitArith(0x81, 0xC0, dst, imm32);
     }
 
-    public final void addl(CiRegister dst, CiAddress src) {
+    public final void addl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x03);
         emitOperandHelper(dst, src);
     }
 
-    public final void addl(CiRegister dst, CiRegister src) {
+    public final void addl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x03, 0xC0, dst, src);
     }
@@ -367,7 +367,7 @@
         emitInt(0); // 32-bits offset (4 bytes)
     }
 
-    public final void addsd(CiRegister dst, CiRegister src) {
+    public final void addsd(Register dst, Register src) {
         assert dst.isFpu() && src.isFpu();
         emitByte(0xF2);
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -376,7 +376,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void addsd(CiRegister dst, CiAddress src) {
+    public final void addsd(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF2);
         prefix(src, dst);
@@ -385,7 +385,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void addss(CiRegister dst, CiRegister src) {
+    public final void addss(Register dst, Register src) {
         assert dst.isFpu() && src.isFpu();
         emitByte(0xF3);
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -394,7 +394,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void addss(CiRegister dst, CiAddress src) {
+    public final void addss(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF3);
         prefix(src, dst);
@@ -403,36 +403,36 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void andl(CiRegister dst, int imm32) {
+    public final void andl(Register dst, int imm32) {
         prefix(dst);
         emitArith(0x81, 0xE0, dst, imm32);
     }
 
-    public final void andl(CiRegister dst, CiAddress src) {
+    public final void andl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x23);
         emitOperandHelper(dst, src);
     }
 
-    public final void andl(CiRegister dst, CiRegister src) {
+    public final void andl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x23, 0xC0, dst, src);
     }
 
-    public final void bsfq(CiRegister dst, CiRegister src) {
+    public final void bsfq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xBC);
         emitByte(0xC0 | encode);
     }
 
-    public final void bsfq(CiRegister dst, CiAddress src) {
+    public final void bsfq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0xBC);
         emitOperandHelper(dst, src);
     }
 
-    public final void bsrq(CiRegister dst, CiRegister src) {
+    public final void bsrq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xBD);
@@ -440,19 +440,19 @@
     }
 
 
-    public final void bsrq(CiRegister dst, CiAddress src) {
+    public final void bsrq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0xBD);
         emitOperandHelper(dst, src);
     }
 
-    public final void bswapl(CiRegister reg) { // bswap
+    public final void bswapl(Register reg) { // bswap
         int encode = prefixAndEncode(reg.encoding);
         emitByte(0x0F);
         emitByte(0xC8 | encode);
     }
 
-    public final void btli(CiAddress src, int imm8) {
+    public final void btli(Address src, int imm8) {
         prefixq(src);
         emitByte(0x0F);
         emitByte(0xBA);
@@ -464,45 +464,45 @@
         emitByte(0x99);
     }
 
-    public final void cmovl(ConditionFlag cc, CiRegister dst, CiRegister src) {
+    public final void cmovl(ConditionFlag cc, Register dst, Register src) {
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0x40 | cc.value);
         emitByte(0xC0 | encode);
     }
 
-    public final void cmovl(ConditionFlag cc, CiRegister dst, CiAddress src) {
+    public final void cmovl(ConditionFlag cc, Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x0F);
         emitByte(0x40 | cc.value);
         emitOperandHelper(dst, src);
     }
 
-    public final void cmpb(CiAddress dst, int imm8) {
+    public final void cmpb(Address dst, int imm8) {
         prefix(dst);
         emitByte(0x80);
         emitOperandHelper(rdi, dst);
         emitByte(imm8);
     }
 
-    public final void cmpl(CiAddress dst, int imm32) {
+    public final void cmpl(Address dst, int imm32) {
         prefix(dst);
         emitByte(0x81);
         emitOperandHelper(rdi, dst);
         emitInt(imm32);
     }
 
-    public final void cmpl(CiRegister dst, int imm32) {
+    public final void cmpl(Register dst, int imm32) {
         prefix(dst);
         emitArith(0x81, 0xF8, dst, imm32);
     }
 
-    public final void cmpl(CiRegister dst, CiRegister src) {
+    public final void cmpl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x3B, 0xC0, dst, src);
     }
 
-    public final void cmpl(CiRegister dst, CiAddress src) {
+    public final void cmpl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x3B);
         emitOperandHelper(dst, src);
@@ -511,7 +511,7 @@
     // The 32-bit cmpxchg compares the value at adr with the contents of X86.rax,
     // and stores reg into adr if so; otherwise, the value at adr is loaded into X86.rax,.
     // The ZF is set if the compared values were equal, and cleared otherwise.
-    public final void cmpxchgl(CiRegister reg, CiAddress adr) { // cmpxchg
+    public final void cmpxchgl(Register reg, Address adr) { // cmpxchg
         if ((AsmOptions.Atomics & 2) != 0) {
             // caveat: no instructionmark, so this isn't relocatable.
             // Emit a synthetic, non-atomic, CAS equivalent.
@@ -534,7 +534,7 @@
         }
     }
 
-    public final void comisd(CiRegister dst, CiAddress src) {
+    public final void comisd(Register dst, Address src) {
         assert dst.isFpu();
         // NOTE: dbx seems to decode this as comiss even though the
         // 0x66 is there. Strangly ucomisd comes out correct
@@ -542,7 +542,7 @@
         comiss(dst, src);
     }
 
-    public final void comiss(CiRegister dst, CiAddress src) {
+    public final void comiss(Register dst, Address src) {
         assert dst.isFpu();
 
         prefix(src, dst);
@@ -551,7 +551,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void cvtdq2pd(CiRegister dst, CiRegister src) {
+    public final void cvtdq2pd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
 
@@ -562,7 +562,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvtdq2ps(CiRegister dst, CiRegister src) {
+    public final void cvtdq2ps(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -571,7 +571,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvtsd2ss(CiRegister dst, CiRegister src) {
+    public final void cvtsd2ss(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF2);
@@ -581,7 +581,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvtsi2sdl(CiRegister dst, CiRegister src) {
+    public final void cvtsi2sdl(Register dst, Register src) {
         assert dst.isFpu();
         emitByte(0xF2);
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -590,7 +590,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvtsi2ssl(CiRegister dst, CiRegister src) {
+    public final void cvtsi2ssl(Register dst, Register src) {
         assert dst.isFpu();
         emitByte(0xF3);
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -599,7 +599,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvtss2sd(CiRegister dst, CiRegister src) {
+    public final void cvtss2sd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF3);
@@ -609,7 +609,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvttsd2sil(CiRegister dst, CiRegister src) {
+    public final void cvttsd2sil(Register dst, Register src) {
         assert src.isFpu();
         emitByte(0xF2);
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -618,7 +618,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvttss2sil(CiRegister dst, CiRegister src) {
+    public final void cvttss2sil(Register dst, Register src) {
         assert src.isFpu();
         emitByte(0xF3);
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -627,14 +627,14 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void decl(CiAddress dst) {
+    public final void decl(Address dst) {
         // Don't use it directly. Use Macrodecrement() instead.
         prefix(dst);
         emitByte(0xFF);
         emitOperandHelper(rcx, dst);
     }
 
-    public final void divsd(CiRegister dst, CiAddress src) {
+    public final void divsd(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF2);
         prefix(src, dst);
@@ -643,7 +643,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void divsd(CiRegister dst, CiRegister src) {
+    public final void divsd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF2);
@@ -653,7 +653,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void divss(CiRegister dst, CiAddress src) {
+    public final void divss(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF3);
         prefix(src, dst);
@@ -662,7 +662,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void divss(CiRegister dst, CiRegister src) {
+    public final void divss(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF3);
@@ -676,26 +676,26 @@
         emitByte(0xF4);
     }
 
-    public final void idivl(CiRegister src) {
+    public final void idivl(Register src) {
         int encode = prefixAndEncode(src.encoding);
         emitByte(0xF7);
         emitByte(0xF8 | encode);
     }
 
-    public final void divl(CiRegister src) {
+    public final void divl(Register src) {
         int encode = prefixAndEncode(src.encoding);
         emitByte(0xF7);
         emitByte(0xF0 | encode);
     }
 
-    public final void imull(CiRegister dst, CiRegister src) {
+    public final void imull(Register dst, Register src) {
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xAF);
         emitByte(0xC0 | encode);
     }
 
-    public final void imull(CiRegister dst, CiRegister src, int value) {
+    public final void imull(Register dst, Register src, int value) {
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         if (isByte(value)) {
             emitByte(0x6B);
@@ -708,7 +708,7 @@
         }
     }
 
-    public final void incl(CiAddress dst) {
+    public final void incl(Address dst) {
         // Don't use it directly. Use Macroincrement() instead.
         prefix(dst);
         emitByte(0xFF);
@@ -766,7 +766,7 @@
         }
     }
 
-    public final void jmp(CiAddress adr) {
+    public final void jmp(Address adr) {
         prefix(adr);
         emitByte(0xFF);
         emitOperandHelper(rsp, adr);
@@ -801,7 +801,7 @@
         }
     }
 
-    public final void jmp(CiRegister entry) {
+    public final void jmp(Register entry) {
         int encode = prefixAndEncode(entry.encoding);
         emitByte(0xFF);
         emitByte(0xE0 | encode);
@@ -823,7 +823,7 @@
         }
     }
 
-    public final void leaq(CiRegister dst, CiAddress src) {
+    public final void leaq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x8D);
         emitOperandHelper(dst, src);
@@ -855,11 +855,11 @@
         emitByte(0xF0);
     }
 
-    public final void mov(CiRegister dst, CiRegister src) {
+    public final void mov(Register dst, Register src) {
         movq(dst, src);
     }
 
-    public final void movapd(CiRegister dst, CiRegister src) {
+    public final void movapd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         int dstenc = dst.encoding;
@@ -884,7 +884,7 @@
         emitByte(0xC0 | dstenc << 3 | srcenc);
     }
 
-    public final void movaps(CiRegister dst, CiRegister src) {
+    public final void movaps(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         int dstenc = dst.encoding;
@@ -908,27 +908,27 @@
         emitByte(0xC0 | dstenc << 3 | srcenc);
     }
 
-    public final void movb(CiRegister dst, CiAddress src) {
+    public final void movb(Register dst, Address src) {
         prefix(src, dst); // , true)
         emitByte(0x8A);
         emitOperandHelper(dst, src);
     }
 
-    public final void movb(CiAddress dst, int imm8) {
+    public final void movb(Address dst, int imm8) {
         prefix(dst);
         emitByte(0xC6);
         emitOperandHelper(rax, dst);
         emitByte(imm8);
     }
 
-    public final void movb(CiAddress dst, CiRegister src) {
+    public final void movb(Address dst, Register src) {
         assert src.isByte() : "must have byte register";
         prefix(dst, src); // , true)
         emitByte(0x88);
         emitOperandHelper(src, dst);
     }
 
-    public final void movdl(CiRegister dst, CiRegister src) {
+    public final void movdl(Register dst, Register src) {
         if (dst.isFpu()) {
             assert !src.isFpu() : "does this hold?";
             emitByte(0x66);
@@ -947,7 +947,7 @@
         }
     }
 
-    public final void movdqa(CiRegister dst, CiAddress src) {
+    public final void movdqa(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0x66);
         prefix(src, dst);
@@ -956,7 +956,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void movdqa(CiRegister dst, CiRegister src) {
+    public final void movdqa(Register dst, Register src) {
         assert dst.isFpu();
         emitByte(0x66);
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
@@ -965,7 +965,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void movdqa(CiAddress dst, CiRegister src) {
+    public final void movdqa(Address dst, Register src) {
         assert src.isFpu();
         emitByte(0x66);
         prefix(dst, src);
@@ -974,7 +974,7 @@
         emitOperandHelper(src, dst);
     }
 
-    public final void movdqu(CiRegister dst, CiAddress src) {
+    public final void movdqu(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF3);
         prefix(src, dst);
@@ -983,7 +983,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void movdqu(CiRegister dst, CiRegister src) {
+    public final void movdqu(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
 
@@ -994,7 +994,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void movdqu(CiAddress dst, CiRegister src) {
+    public final void movdqu(Address dst, Register src) {
         assert src.isFpu();
 
         emitByte(0xF3);
@@ -1004,32 +1004,32 @@
         emitOperandHelper(src, dst);
     }
 
-    public final void movl(CiRegister dst, int imm32) {
+    public final void movl(Register dst, int imm32) {
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0xB8 | encode);
         emitInt(imm32);
     }
 
-    public final void movl(CiRegister dst, CiRegister src) {
+    public final void movl(Register dst, Register src) {
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x8B);
         emitByte(0xC0 | encode);
     }
 
-    public final void movl(CiRegister dst, CiAddress src) {
+    public final void movl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x8B);
         emitOperandHelper(dst, src);
     }
 
-    public final void movl(CiAddress dst, int imm32) {
+    public final void movl(Address dst, int imm32) {
         prefix(dst);
         emitByte(0xC7);
         emitOperandHelper(rax, dst);
         emitInt(imm32);
     }
 
-    public final void movl(CiAddress dst, CiRegister src) {
+    public final void movl(Address dst, Register src) {
         prefix(dst, src);
         emitByte(0x89);
         emitOperandHelper(src, dst);
@@ -1038,10 +1038,10 @@
     /**
      * New CPUs require use of movsd and movss to avoid partial register stall
      * when loading from memory. But for old Opteron use movlpd instead of movsd.
-     * The selection is done in {@link AMD64MacroAssembler#movdbl(CiRegister, CiAddress)}
-     * and {@link AMD64MacroAssembler#movflt(CiRegister, CiRegister)}.
+     * The selection is done in {@link AMD64MacroAssembler#movdbl(Register, Address)}
+     * and {@link AMD64MacroAssembler#movflt(Register, Register)}.
      */
-    public final void movlpd(CiRegister dst, CiAddress src) {
+    public final void movlpd(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0x66);
         prefix(src, dst);
@@ -1050,7 +1050,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void movlpd(CiAddress dst, CiRegister src) {
+    public final void movlpd(Address dst, Register src) {
         assert src.isFpu();
         emitByte(0x66);
         prefix(dst, src);
@@ -1059,7 +1059,7 @@
         emitOperandHelper(src, dst);
     }
 
-    public final void movq(CiRegister dst, CiAddress src) {
+    public final void movq(Register dst, Address src) {
         if (dst.isFpu()) {
             emitByte(0xF3);
             prefixq(src, dst);
@@ -1073,13 +1073,13 @@
         }
     }
 
-    public final void movq(CiRegister dst, CiRegister src) {
+    public final void movq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x8B);
         emitByte(0xC0 | encode);
     }
 
-    public final void movq(CiAddress dst, CiRegister src) {
+    public final void movq(Address dst, Register src) {
         if (src.isFpu()) {
             emitByte(0x66);
             prefixq(dst, src);
@@ -1093,21 +1093,21 @@
         }
     }
 
-    public final void movsxb(CiRegister dst, CiAddress src) { // movsxb
+    public final void movsxb(Register dst, Address src) { // movsxb
         prefix(src, dst);
         emitByte(0x0F);
         emitByte(0xBE);
         emitOperandHelper(dst, src);
     }
 
-    public final void movsxb(CiRegister dst, CiRegister src) { // movsxb
+    public final void movsxb(Register dst, Register src) { // movsxb
         int encode = prefixAndEncode(dst.encoding, src.encoding, true);
         emitByte(0x0F);
         emitByte(0xBE);
         emitByte(0xC0 | encode);
     }
 
-    public final void movsd(CiRegister dst, CiRegister src) {
+    public final void movsd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF2);
@@ -1117,7 +1117,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void movsd(CiRegister dst, CiAddress src) {
+    public final void movsd(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF2);
         prefix(src, dst);
@@ -1126,7 +1126,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void movsd(CiAddress dst, CiRegister src) {
+    public final void movsd(Address dst, Register src) {
         assert src.isFpu();
         emitByte(0xF2);
         prefix(dst, src);
@@ -1135,7 +1135,7 @@
         emitOperandHelper(src, dst);
     }
 
-    public final void movss(CiRegister dst, CiRegister src) {
+    public final void movss(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF3);
@@ -1145,7 +1145,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void movss(CiRegister dst, CiAddress src) {
+    public final void movss(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF3);
         prefix(src, dst);
@@ -1154,7 +1154,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void movss(CiAddress dst, CiRegister src) {
+    public final void movss(Address dst, Register src) {
         assert src.isFpu();
         emitByte(0xF3);
         prefix(dst, src);
@@ -1163,40 +1163,40 @@
         emitOperandHelper(src, dst);
     }
 
-    public final void movswl(CiRegister dst, CiAddress src) {
+    public final void movswl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x0F);
         emitByte(0xBF);
         emitOperandHelper(dst, src);
     }
 
-    public final void movsxw(CiRegister dst, CiRegister src) { // movsxw
+    public final void movsxw(Register dst, Register src) { // movsxw
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xBF);
         emitByte(0xC0 | encode);
     }
 
-    public final void movsxw(CiRegister dst, CiAddress src) { // movsxw
+    public final void movsxw(Register dst, Address src) { // movsxw
         prefix(src, dst);
         emitByte(0x0F);
         emitByte(0xBF);
         emitOperandHelper(dst, src);
     }
 
-    public final void movzxd(CiRegister dst, CiRegister src) { // movzxd
+    public final void movzxd(Register dst, Register src) { // movzxd
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x63);
         emitByte(0xC0 | encode);
     }
 
-    public final void movzxd(CiRegister dst, CiAddress src) { // movzxd
+    public final void movzxd(Register dst, Address src) { // movzxd
         prefix(src, dst);
         emitByte(0x63);
         emitOperandHelper(dst, src);
     }
 
-    public final void movw(CiAddress dst, int imm16) {
+    public final void movw(Address dst, int imm16) {
         emitByte(0x66); // switch to 16-bit mode
         prefix(dst);
         emitByte(0xC7);
@@ -1204,55 +1204,55 @@
         emitShort(imm16);
     }
 
-    public final void movw(CiRegister dst, CiAddress src) {
+    public final void movw(Register dst, Address src) {
         emitByte(0x66);
         prefix(src, dst);
         emitByte(0x8B);
         emitOperandHelper(dst, src);
     }
 
-    public final void movw(CiAddress dst, CiRegister src) {
+    public final void movw(Address dst, Register src) {
         emitByte(0x66);
         prefix(dst, src);
         emitByte(0x89);
         emitOperandHelper(src, dst);
     }
 
-    public final void movzxb(CiRegister dst, CiAddress src) { // movzxb
+    public final void movzxb(Register dst, Address src) { // movzxb
         prefix(src, dst);
         emitByte(0x0F);
         emitByte(0xB6);
         emitOperandHelper(dst, src);
     }
 
-    public final void movzxb(CiRegister dst, CiRegister src) { // movzxb
+    public final void movzxb(Register dst, Register src) { // movzxb
         int encode = prefixAndEncode(dst.encoding, src.encoding, true);
         emitByte(0x0F);
         emitByte(0xB6);
         emitByte(0xC0 | encode);
     }
 
-    public final void movzxl(CiRegister dst, CiAddress src) { // movzxw
+    public final void movzxl(Register dst, Address src) { // movzxw
         prefix(src, dst);
         emitByte(0x0F);
         emitByte(0xB7);
         emitOperandHelper(dst, src);
     }
 
-    public final void movzxl(CiRegister dst, CiRegister src) { // movzxw
+    public final void movzxl(Register dst, Register src) { // movzxw
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xB7);
         emitByte(0xC0 | encode);
     }
 
-    public final void mull(CiAddress src) {
+    public final void mull(Address src) {
         prefix(src);
         emitByte(0xF7);
         emitOperandHelper(rsp, src);
     }
 
-    public final void mulsd(CiRegister dst, CiAddress src) {
+    public final void mulsd(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0xF2);
         prefix(src, dst);
@@ -1261,7 +1261,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void mulsd(CiRegister dst, CiRegister src) {
+    public final void mulsd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
 
@@ -1272,7 +1272,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void mulss(CiRegister dst, CiAddress src) {
+    public final void mulss(Register dst, Address src) {
         assert dst.isFpu();
 
         emitByte(0xF3);
@@ -1282,7 +1282,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void mulss(CiRegister dst, CiRegister src) {
+    public final void mulss(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF3);
@@ -1292,7 +1292,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void negl(CiRegister dst) {
+    public final void negl(Register dst) {
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0xF7);
         emitByte(0xD8 | encode);
@@ -1508,84 +1508,84 @@
         }
     }
 
-    public final void notl(CiRegister dst) {
+    public final void notl(Register dst) {
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0xF7);
         emitByte(0xD0 | encode);
     }
 
-    public final void orl(CiAddress dst, int imm32) {
+    public final void orl(Address dst, int imm32) {
         prefix(dst);
         emitByte(0x81);
         emitOperandHelper(rcx, dst);
         emitInt(imm32);
     }
 
-    public final void orl(CiRegister dst, int imm32) {
+    public final void orl(Register dst, int imm32) {
         prefix(dst);
         emitArith(0x81, 0xC8, dst, imm32);
     }
 
-    public final void orl(CiRegister dst, CiAddress src) {
+    public final void orl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x0B);
         emitOperandHelper(dst, src);
     }
 
-    public final void orl(CiRegister dst, CiRegister src) {
+    public final void orl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x0B, 0xC0, dst, src);
     }
 
     // generic
-    public final void pop(CiRegister dst) {
+    public final void pop(Register dst) {
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0x58 | encode);
     }
 
-    public final void prefetchPrefix(CiAddress src) {
+    public final void prefetchPrefix(Address src) {
         prefix(src);
         emitByte(0x0F);
     }
 
-    public final void prefetchnta(CiAddress src) {
+    public final void prefetchnta(Address src) {
         prefetchPrefix(src);
         emitByte(0x18);
         emitOperandHelper(rax, src); // 0, src
     }
 
-    public final void prefetchr(CiAddress src) {
+    public final void prefetchr(Address src) {
         prefetchPrefix(src);
         emitByte(0x0D);
         emitOperandHelper(rax, src); // 0, src
     }
 
-    public final void prefetcht0(CiAddress src) {
+    public final void prefetcht0(Address src) {
         prefetchPrefix(src);
         emitByte(0x18);
         emitOperandHelper(rcx, src); // 1, src
 
     }
 
-    public final void prefetcht1(CiAddress src) {
+    public final void prefetcht1(Address src) {
         prefetchPrefix(src);
         emitByte(0x18);
         emitOperandHelper(rdx, src); // 2, src
     }
 
-    public final void prefetcht2(CiAddress src) {
+    public final void prefetcht2(Address src) {
         prefetchPrefix(src);
         emitByte(0x18);
         emitOperandHelper(rbx, src); // 3, src
     }
 
-    public final void prefetchw(CiAddress src) {
+    public final void prefetchw(Address src) {
         prefetchPrefix(src);
         emitByte(0x0D);
         emitOperandHelper(rcx, src); // 1, src
     }
 
-    public final void pshufd(CiRegister dst, CiRegister src, int mode) {
+    public final void pshufd(Register dst, Register src, int mode) {
         assert dst.isFpu();
         assert src.isFpu();
         assert isUByte(mode) : "invalid value";
@@ -1598,7 +1598,7 @@
         emitByte(mode & 0xFF);
     }
 
-    public final void pshufd(CiRegister dst, CiAddress src, int mode) {
+    public final void pshufd(Register dst, Address src, int mode) {
         assert dst.isFpu();
         assert isUByte(mode) : "invalid value";
 
@@ -1611,7 +1611,7 @@
 
     }
 
-    public final void pshuflw(CiRegister dst, CiRegister src, int mode) {
+    public final void pshuflw(Register dst, Register src, int mode) {
         assert dst.isFpu();
         assert src.isFpu();
         assert isUByte(mode) : "invalid value";
@@ -1624,7 +1624,7 @@
         emitByte(mode & 0xFF);
     }
 
-    public final void pshuflw(CiRegister dst, CiAddress src, int mode) {
+    public final void pshuflw(Register dst, Address src, int mode) {
         assert dst.isFpu();
         assert isUByte(mode) : "invalid value";
 
@@ -1636,7 +1636,7 @@
         emitByte(mode & 0xFF);
     }
 
-    public final void psrlq(CiRegister dst, int shift) {
+    public final void psrlq(Register dst, int shift) {
         assert dst.isFpu();
         // HMM Table D-1 says sse2 or mmx
 
@@ -1648,7 +1648,7 @@
         emitByte(shift);
     }
 
-    public final void punpcklbw(CiRegister dst, CiRegister src) {
+    public final void punpcklbw(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0x66);
@@ -1665,7 +1665,7 @@
         emitInt(imm32);
     }
 
-    public final void push(CiRegister src) {
+    public final void push(Register src) {
         int encode = prefixAndEncode(src.encoding);
         emitByte(0x50 | encode);
     }
@@ -1674,7 +1674,7 @@
         emitByte(0x9C);
     }
 
-    public final void pxor(CiRegister dst, CiAddress src) {
+    public final void pxor(Register dst, Address src) {
         assert dst.isFpu();
 
         emitByte(0x66);
@@ -1684,7 +1684,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void pxor(CiRegister dst, CiRegister src) {
+    public final void pxor(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
 
@@ -1696,7 +1696,7 @@
 
     }
 
-    public final void rcll(CiRegister dst, int imm8) {
+    public final void rcll(Register dst, int imm8) {
         assert isShiftCount(imm8) : "illegal shift count";
         int encode = prefixAndEncode(dst.encoding);
         if (imm8 == 1) {
@@ -1763,7 +1763,7 @@
         }
     }
 
-    public final void sarl(CiRegister dst, int imm8) {
+    public final void sarl(Register dst, int imm8) {
         int encode = prefixAndEncode(dst.encoding);
         assert isShiftCount(imm8) : "illegal shift count";
         if (imm8 == 1) {
@@ -1776,34 +1776,34 @@
         }
     }
 
-    public final void sarl(CiRegister dst) {
+    public final void sarl(Register dst) {
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0xD3);
         emitByte(0xF8 | encode);
     }
 
-    public final void sbbl(CiAddress dst, int imm32) {
+    public final void sbbl(Address dst, int imm32) {
         prefix(dst);
         emitArithOperand(0x81, rbx, dst, imm32);
     }
 
-    public final void sbbl(CiRegister dst, int imm32) {
+    public final void sbbl(Register dst, int imm32) {
         prefix(dst);
         emitArith(0x81, 0xD8, dst, imm32);
     }
 
-    public final void sbbl(CiRegister dst, CiAddress src) {
+    public final void sbbl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x1B);
         emitOperandHelper(dst, src);
     }
 
-    public final void sbbl(CiRegister dst, CiRegister src) {
+    public final void sbbl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x1B, 0xC0, dst, src);
     }
 
-    public final void setb(ConditionFlag cc, CiRegister dst) {
+    public final void setb(ConditionFlag cc, Register dst) {
         assert 0 <= cc.value && cc.value < 16 : "illegal cc";
         int encode = prefixAndEncode(dst.encoding, true);
         emitByte(0x0F);
@@ -1811,7 +1811,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void shll(CiRegister dst, int imm8) {
+    public final void shll(Register dst, int imm8) {
         assert isShiftCount(imm8) : "illegal shift count";
         int encode = prefixAndEncode(dst.encoding);
         if (imm8 == 1) {
@@ -1824,13 +1824,13 @@
         }
     }
 
-    public final void shll(CiRegister dst) {
+    public final void shll(Register dst) {
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0xD3);
         emitByte(0xE0 | encode);
     }
 
-    public final void shrl(CiRegister dst, int imm8) {
+    public final void shrl(Register dst, int imm8) {
         assert isShiftCount(imm8) : "illegal shift count";
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0xC1);
@@ -1838,7 +1838,7 @@
         emitByte(imm8);
     }
 
-    public final void shrl(CiRegister dst) {
+    public final void shrl(Register dst) {
         int encode = prefixAndEncode(dst.encoding);
         emitByte(0xD3);
         emitByte(0xE8 | encode);
@@ -1849,7 +1849,7 @@
         emitByte(0xA5);
     }
 
-    public final void sqrtsd(CiRegister dst, CiRegister src) {
+    public final void sqrtsd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         // HMM Table D-1 says sse2
@@ -1861,7 +1861,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void subl(CiAddress dst, int imm32) {
+    public final void subl(Address dst, int imm32) {
         prefix(dst);
         if (isByte(imm32)) {
             emitByte(0x83);
@@ -1874,29 +1874,29 @@
         }
     }
 
-    public final void subl(CiRegister dst, int imm32) {
+    public final void subl(Register dst, int imm32) {
         prefix(dst);
         emitArith(0x81, 0xE8, dst, imm32);
     }
 
-    public final void subl(CiAddress dst, CiRegister src) {
+    public final void subl(Address dst, Register src) {
         prefix(dst, src);
         emitByte(0x29);
         emitOperandHelper(src, dst);
     }
 
-    public final void subl(CiRegister dst, CiAddress src) {
+    public final void subl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x2B);
         emitOperandHelper(dst, src);
     }
 
-    public final void subl(CiRegister dst, CiRegister src) {
+    public final void subl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x2B, 0xC0, dst, src);
     }
 
-    public final void subsd(CiRegister dst, CiRegister src) {
+    public final void subsd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF2);
@@ -1906,7 +1906,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void subsd(CiRegister dst, CiAddress src) {
+    public final void subsd(Register dst, Address src) {
         assert dst.isFpu();
 
         emitByte(0xF2);
@@ -1916,7 +1916,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void subss(CiRegister dst, CiRegister src) {
+    public final void subss(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0xF3);
@@ -1926,7 +1926,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void subss(CiRegister dst, CiAddress src) {
+    public final void subss(Register dst, Address src) {
         assert dst.isFpu();
 
         emitByte(0xF3);
@@ -1936,12 +1936,12 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void testb(CiRegister dst, int imm8) {
+    public final void testb(Register dst, int imm8) {
         prefixAndEncode(dst.encoding, true);
         emitArithB(0xF6, 0xC0, dst, imm8);
     }
 
-    public final void testl(CiRegister dst, int imm32) {
+    public final void testl(Register dst, int imm32) {
         // not using emitArith because test
         // doesn't support sign-extension of
         // 8bit operands
@@ -1956,31 +1956,31 @@
         emitInt(imm32);
     }
 
-    public final void testl(CiRegister dst, CiRegister src) {
+    public final void testl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x85, 0xC0, dst, src);
     }
 
-    public final void testl(CiRegister dst, CiAddress src) {
+    public final void testl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x85);
         emitOperandHelper(dst, src);
     }
 
-    public final void ucomisd(CiRegister dst, CiAddress src) {
+    public final void ucomisd(Register dst, Address src) {
         assert dst.isFpu();
         emitByte(0x66);
         ucomiss(dst, src);
     }
 
-    public final void ucomisd(CiRegister dst, CiRegister src) {
+    public final void ucomisd(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         emitByte(0x66);
         ucomiss(dst, src);
     }
 
-    public final void ucomiss(CiRegister dst, CiAddress src) {
+    public final void ucomiss(Register dst, Address src) {
         assert dst.isFpu();
 
         prefix(src, dst);
@@ -1989,7 +1989,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void ucomiss(CiRegister dst, CiRegister src) {
+    public final void ucomiss(Register dst, Register src) {
         assert dst.isFpu();
         assert src.isFpu();
         int encode = prefixAndEncode(dst.encoding, src.encoding);
@@ -1998,7 +1998,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void xaddl(CiAddress dst, CiRegister src) {
+    public final void xaddl(Address dst, Register src) {
         assert src.isFpu();
 
         prefix(dst, src);
@@ -2007,45 +2007,45 @@
         emitOperandHelper(src, dst);
     }
 
-    public final void xchgl(CiRegister dst, CiAddress src) { // xchg
+    public final void xchgl(Register dst, Address src) { // xchg
         prefix(src, dst);
         emitByte(0x87);
         emitOperandHelper(dst, src);
     }
 
-    public final void xchgl(CiRegister dst, CiRegister src) {
+    public final void xchgl(Register dst, Register src) {
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x87);
         emitByte(0xc0 | encode);
     }
 
-    public final void xorl(CiRegister dst, int imm32) {
+    public final void xorl(Register dst, int imm32) {
         prefix(dst);
         emitArith(0x81, 0xF0, dst, imm32);
     }
 
-    public final void xorl(CiRegister dst, CiAddress src) {
+    public final void xorl(Register dst, Address src) {
         prefix(src, dst);
         emitByte(0x33);
         emitOperandHelper(dst, src);
     }
 
-    public final void xorl(CiRegister dst, CiRegister src) {
+    public final void xorl(Register dst, Register src) {
         prefixAndEncode(dst.encoding, src.encoding);
         emitArith(0x33, 0xC0, dst, src);
     }
 
-    public final void andpd(CiRegister dst, CiRegister src) {
+    public final void andpd(Register dst, Register src) {
         emitByte(0x66);
         andps(dst, src);
     }
 
-    public final void andpd(CiRegister dst, CiAddress src) {
+    public final void andpd(Register dst, Address src) {
         emitByte(0x66);
         andps(dst, src);
     }
 
-    public final void andps(CiRegister dst, CiRegister src) {
+    public final void andps(Register dst, Register src) {
         assert dst.isFpu() && src.isFpu();
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
@@ -2053,7 +2053,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void andps(CiRegister dst, CiAddress src) {
+    public final void andps(Register dst, Address src) {
         assert dst.isFpu();
         prefix(src, dst);
         emitByte(0x0F);
@@ -2061,17 +2061,17 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void orpd(CiRegister dst, CiRegister src) {
+    public final void orpd(Register dst, Register src) {
         emitByte(0x66);
         orps(dst, src);
     }
 
-    public final void orpd(CiRegister dst, CiAddress src) {
+    public final void orpd(Register dst, Address src) {
         emitByte(0x66);
         orps(dst, src);
     }
 
-    public final void orps(CiRegister dst, CiRegister src) {
+    public final void orps(Register dst, Register src) {
         assert dst.isFpu() && src.isFpu();
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
@@ -2079,7 +2079,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void orps(CiRegister dst, CiAddress src) {
+    public final void orps(Register dst, Address src) {
         assert dst.isFpu();
         prefix(src, dst);
         emitByte(0x0F);
@@ -2087,17 +2087,17 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void xorpd(CiRegister dst, CiRegister src) {
+    public final void xorpd(Register dst, Register src) {
         emitByte(0x66);
         xorps(dst, src);
     }
 
-    public final void xorpd(CiRegister dst, CiAddress src) {
+    public final void xorpd(Register dst, Address src) {
         emitByte(0x66);
         xorps(dst, src);
     }
 
-    public final void xorps(CiRegister dst, CiRegister src) {
+    public final void xorps(Register dst, Register src) {
         assert dst.isFpu() && src.isFpu();
         int encode = prefixAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
@@ -2105,7 +2105,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void xorps(CiRegister dst, CiAddress src) {
+    public final void xorps(Register dst, Address src) {
         assert dst.isFpu();
         prefix(src, dst);
         emitByte(0x0F);
@@ -2115,7 +2115,7 @@
 
     // 32bit only pieces of the assembler
 
-    public final void decl(CiRegister dst) {
+    public final void decl(Register dst) {
         // Don't use it directly. Use Macrodecrementl() instead.
         // Use two-byte form (one-byte form is a REX prefix in 64-bit mode)
         int encode = prefixAndEncode(dst.encoding);
@@ -2123,7 +2123,7 @@
         emitByte(0xC8 | encode);
     }
 
-    public final void incl(CiRegister dst) {
+    public final void incl(Register dst) {
         // Don't use it directly. Use Macroincrementl() instead.
         // Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
         int encode = prefixAndEncode(dst.encoding);
@@ -2211,7 +2211,7 @@
         return regEnc << 3 | rmEnc;
     }
 
-    private void prefix(CiRegister reg) {
+    private void prefix(Register reg) {
         if (reg.encoding >= 8) {
             emitByte(Prefix.REXB);
         }
@@ -2222,7 +2222,7 @@
     }
 
 
-    private void prefix(CiAddress adr) {
+    private void prefix(Address adr) {
         if (needsRex(adr.base)) {
             if (needsRex(adr.index)) {
                 emitByte(Prefix.REXXB);
@@ -2236,7 +2236,7 @@
         }
     }
 
-    private void prefixq(CiAddress adr) {
+    private void prefixq(Address adr) {
         if (needsRex(adr.base)) {
             if (needsRex(adr.index)) {
                 emitByte(Prefix.REXWXB);
@@ -2252,7 +2252,7 @@
         }
     }
 
-    private void prefix(CiAddress adr, CiRegister reg) {
+    private void prefix(Address adr, Register reg) {
         if (reg.encoding < 8) {
             if (needsRex(adr.base)) {
                 if (needsRex(adr.index)) {
@@ -2284,7 +2284,7 @@
         }
     }
 
-    private void prefixq(CiAddress adr, CiRegister src) {
+    private void prefixq(Address adr, Register src) {
         if (src.encoding < 8) {
             if (needsRex(adr.base)) {
                 if (needsRex(adr.index)) {
@@ -2316,50 +2316,50 @@
         }
     }
 
-    public final void addq(CiAddress dst, int imm32) {
+    public final void addq(Address dst, int imm32) {
         prefixq(dst);
         emitArithOperand(0x81, rax, dst, imm32);
     }
 
-    public final void addq(CiAddress dst, CiRegister src) {
+    public final void addq(Address dst, Register src) {
         prefixq(dst, src);
         emitByte(0x01);
         emitOperandHelper(src, dst);
     }
 
-    public final void addq(CiRegister dst, int imm32) {
+    public final void addq(Register dst, int imm32) {
         prefixqAndEncode(dst.encoding);
         emitArith(0x81, 0xC0, dst, imm32);
     }
 
-    public final void addq(CiRegister dst, CiAddress src) {
+    public final void addq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x03);
         emitOperandHelper(dst, src);
     }
 
-    public final void addq(CiRegister dst, CiRegister src) {
+    public final void addq(Register dst, Register src) {
         prefixqAndEncode(dst.encoding, src.encoding);
         emitArith(0x03, 0xC0, dst, src);
     }
 
-    public final void andq(CiRegister dst, int imm32) {
+    public final void andq(Register dst, int imm32) {
         prefixqAndEncode(dst.encoding);
         emitArith(0x81, 0xE0, dst, imm32);
     }
 
-    public final void andq(CiRegister dst, CiAddress src) {
+    public final void andq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x23);
         emitOperandHelper(dst, src);
     }
 
-    public final void andq(CiRegister dst, CiRegister src) {
+    public final void andq(Register dst, Register src) {
         prefixqAndEncode(dst.encoding, src.encoding);
         emitArith(0x23, 0xC0, dst, src);
     }
 
-    public final void bswapq(CiRegister reg) {
+    public final void bswapq(Register reg) {
         int encode = prefixqAndEncode(reg.encoding);
         emitByte(0x0F);
         emitByte(0xC8 | encode);
@@ -2370,57 +2370,57 @@
         emitByte(0x99);
     }
 
-    public final void cmovq(ConditionFlag cc, CiRegister dst, CiRegister src) {
+    public final void cmovq(ConditionFlag cc, Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0x40 | cc.value);
         emitByte(0xC0 | encode);
     }
 
-    public final void cmovq(ConditionFlag cc, CiRegister dst, CiAddress src) {
+    public final void cmovq(ConditionFlag cc, Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x0F);
         emitByte(0x40 | cc.value);
         emitOperandHelper(dst, src);
     }
 
-    public final void cmpq(CiAddress dst, int imm32) {
+    public final void cmpq(Address dst, int imm32) {
         prefixq(dst);
         emitByte(0x81);
         emitOperandHelper(rdi, dst);
         emitInt(imm32);
     }
 
-    public final void cmpq(CiRegister dst, int imm32) {
+    public final void cmpq(Register dst, int imm32) {
         prefixqAndEncode(dst.encoding);
         emitArith(0x81, 0xF8, dst, imm32);
     }
 
-    public final void cmpq(CiAddress dst, CiRegister src) {
+    public final void cmpq(Address dst, Register src) {
         prefixq(dst, src);
         emitByte(0x3B);
         emitOperandHelper(src, dst);
     }
 
-    public final void cmpq(CiRegister dst, CiRegister src) {
+    public final void cmpq(Register dst, Register src) {
         prefixqAndEncode(dst.encoding, src.encoding);
         emitArith(0x3B, 0xC0, dst, src);
     }
 
-    public final void cmpq(CiRegister dst, CiAddress src) {
+    public final void cmpq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x3B);
         emitOperandHelper(dst, src);
     }
 
-    public final void cmpxchgq(CiRegister reg, CiAddress adr) {
+    public final void cmpxchgq(Register reg, Address adr) {
         prefixq(adr, reg);
         emitByte(0x0F);
         emitByte(0xB1);
         emitOperandHelper(reg, adr);
     }
 
-    public final void cvtsi2sdq(CiRegister dst, CiRegister src) {
+    public final void cvtsi2sdq(Register dst, Register src) {
         assert dst.isFpu();
         emitByte(0xF2);
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
@@ -2429,7 +2429,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvtsi2ssq(CiRegister dst, CiRegister src) {
+    public final void cvtsi2ssq(Register dst, Register src) {
         assert dst.isFpu();
         emitByte(0xF3);
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
@@ -2438,7 +2438,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvttsd2siq(CiRegister dst, CiRegister src) {
+    public final void cvttsd2siq(Register dst, Register src) {
         assert src.isFpu();
         emitByte(0xF2);
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
@@ -2447,7 +2447,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void cvttss2siq(CiRegister dst, CiRegister src) {
+    public final void cvttss2siq(Register dst, Register src) {
         assert src.isFpu();
         emitByte(0xF3);
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
@@ -2456,7 +2456,7 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void decq(CiRegister dst) {
+    public final void decq(Register dst) {
         // Don't use it directly. Use Macrodecrementq() instead.
         // Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
         int encode = prefixqAndEncode(dst.encoding);
@@ -2464,33 +2464,33 @@
         emitByte(0xC8 | encode);
     }
 
-    public final void decq(CiAddress dst) {
+    public final void decq(Address dst) {
         // Don't use it directly. Use Macrodecrementq() instead.
         prefixq(dst);
         emitByte(0xFF);
         emitOperandHelper(rcx, dst);
     }
 
-    public final void divq(CiRegister src) {
+    public final void divq(Register src) {
         int encode = prefixqAndEncode(src.encoding);
         emitByte(0xF7);
         emitByte(0xF0 | encode);
     }
 
-    public final void idivq(CiRegister src) {
+    public final void idivq(Register src) {
         int encode = prefixqAndEncode(src.encoding);
         emitByte(0xF7);
         emitByte(0xF8 | encode);
     }
 
-    public final void imulq(CiRegister dst, CiRegister src) {
+    public final void imulq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xAF);
         emitByte(0xC0 | encode);
     }
 
-    public final void imulq(CiRegister dst, CiRegister src, int value) {
+    public final void imulq(Register dst, Register src, int value) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         if (isByte(value)) {
             emitByte(0x6B);
@@ -2503,7 +2503,7 @@
         }
     }
 
-    public final void incq(CiRegister dst) {
+    public final void incq(Register dst) {
         // Don't use it directly. Use Macroincrementq() instead.
         // Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
         int encode = prefixqAndEncode(dst.encoding);
@@ -2511,20 +2511,20 @@
         emitByte(0xC0 | encode);
     }
 
-    public final void incq(CiAddress dst) {
+    public final void incq(Address dst) {
         // Don't use it directly. Use Macroincrementq() instead.
         prefixq(dst);
         emitByte(0xFF);
         emitOperandHelper(rax, dst);
     }
 
-    public final void movq(CiRegister dst, long imm64) {
+    public final void movq(Register dst, long imm64) {
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xB8 | encode);
         emitLong(imm64);
     }
 
-    public final void movdq(CiRegister dst, CiRegister src) {
+    public final void movdq(Register dst, Register src) {
 
         // table D-1 says MMX/SSE2
         emitByte(0x66);
@@ -2547,21 +2547,21 @@
         }
     }
 
-    public final void movsbq(CiRegister dst, CiAddress src) {
+    public final void movsbq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x0F);
         emitByte(0xBE);
         emitOperandHelper(dst, src);
     }
 
-    public final void movsbq(CiRegister dst, CiRegister src) {
+    public final void movsbq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xBE);
         emitByte(0xC0 | encode);
     }
 
-    public final void movslq(CiRegister dst, int imm32) {
+    public final void movslq(Register dst, int imm32) {
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xC7 | encode);
         emitInt(imm32);
@@ -2571,115 +2571,115 @@
         throw new InternalError("untested");
     }
 
-    public final void movslq(CiAddress dst, int imm32) {
+    public final void movslq(Address dst, int imm32) {
         prefixq(dst);
         emitByte(0xC7);
         emitOperandHelper(rax, dst);
         emitInt(imm32);
     }
 
-    public final void movslq(CiRegister dst, CiAddress src) {
+    public final void movslq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x63);
         emitOperandHelper(dst, src);
     }
 
-    public final void movslq(CiRegister dst, CiRegister src) {
+    public final void movslq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x63);
         emitByte(0xC0 | encode);
     }
 
-    public final void movswq(CiRegister dst, CiAddress src) {
+    public final void movswq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x0F);
         emitByte(0xBF);
         emitOperandHelper(dst, src);
     }
 
-    public final void movswq(CiRegister dst, CiRegister src) {
+    public final void movswq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xBF);
         emitByte(0xC0 | encode);
     }
 
-    public final void movzbq(CiRegister dst, CiAddress src) {
+    public final void movzbq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x0F);
         emitByte(0xB6);
         emitOperandHelper(dst, src);
     }
 
-    public final void movzbq(CiRegister dst, CiRegister src) {
+    public final void movzbq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xB6);
         emitByte(0xC0 | encode);
     }
 
-    public final void movzwq(CiRegister dst, CiAddress src) {
+    public final void movzwq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x0F);
         emitByte(0xB7);
         emitOperandHelper(dst, src);
     }
 
-    public final void movzwq(CiRegister dst, CiRegister src) {
+    public final void movzwq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x0F);
         emitByte(0xB7);
         emitByte(0xC0 | encode);
     }
 
-    public final void negq(CiRegister dst) {
+    public final void negq(Register dst) {
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xF7);
         emitByte(0xD8 | encode);
     }
 
-    public final void notq(CiRegister dst) {
+    public final void notq(Register dst) {
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xF7);
         emitByte(0xD0 | encode);
     }
 
-    public final void orq(CiAddress dst, int imm32) {
+    public final void orq(Address dst, int imm32) {
         prefixq(dst);
         emitByte(0x81);
         emitOperandHelper(rcx, dst);
         emitInt(imm32);
     }
 
-    public final void orq(CiRegister dst, int imm32) {
+    public final void orq(Register dst, int imm32) {
         prefixqAndEncode(dst.encoding);
         emitArith(0x81, 0xC8, dst, imm32);
     }
 
-    public final void orq(CiRegister dst, CiAddress src) {
+    public final void orq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x0B);
         emitOperandHelper(dst, src);
     }
 
-    public final void orq(CiRegister dst, CiRegister src) {
+    public final void orq(Register dst, Register src) {
         prefixqAndEncode(dst.encoding, src.encoding);
         emitArith(0x0B, 0xC0, dst, src);
     }
 
-    public final void popq(CiAddress dst) {
+    public final void popq(Address dst) {
         prefixq(dst);
         emitByte(0x8F);
         emitOperandHelper(rax, dst);
     }
 
-    public final void pushq(CiAddress src) {
+    public final void pushq(Address src) {
         prefixq(src);
         emitByte(0xFF);
         emitOperandHelper(rsi, src);
     }
 
-    public final void rclq(CiRegister dst, int imm8) {
+    public final void rclq(Register dst, int imm8) {
         assert isShiftCount(imm8 >> 1) : "illegal shift count";
         int encode = prefixqAndEncode(dst.encoding);
         if (imm8 == 1) {
@@ -2692,7 +2692,7 @@
         }
     }
 
-    public final void sarq(CiRegister dst, int imm8) {
+    public final void sarq(Register dst, int imm8) {
         assert isShiftCount(imm8 >> 1) : "illegal shift count";
         int encode = prefixqAndEncode(dst.encoding);
         if (imm8 == 1) {
@@ -2705,13 +2705,13 @@
         }
     }
 
-    public final void sarq(CiRegister dst) {
+    public final void sarq(Register dst) {
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xD3);
         emitByte(0xF8 | encode);
     }
 
-    public final void shlq(CiRegister dst, int imm8) {
+    public final void shlq(Register dst, int imm8) {
         assert isShiftCount(imm8 >> 1) : "illegal shift count";
         int encode = prefixqAndEncode(dst.encoding);
         if (imm8 == 1) {
@@ -2724,13 +2724,13 @@
         }
     }
 
-    public final void shlq(CiRegister dst) {
+    public final void shlq(Register dst) {
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xD3);
         emitByte(0xE0 | encode);
     }
 
-    public final void shrq(CiRegister dst, int imm8) {
+    public final void shrq(Register dst, int imm8) {
         assert isShiftCount(imm8 >> 1) : "illegal shift count";
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xC1);
@@ -2738,13 +2738,13 @@
         emitByte(imm8);
     }
 
-    public final void shrq(CiRegister dst) {
+    public final void shrq(Register dst) {
         int encode = prefixqAndEncode(dst.encoding);
         emitByte(0xD3);
         emitByte(0xE8 | encode);
     }
 
-    public final void sqrtsd(CiRegister dst, CiAddress src) {
+    public final void sqrtsd(Register dst, Address src) {
         assert dst.isFpu();
 
         emitByte(0xF2);
@@ -2754,7 +2754,7 @@
         emitOperandHelper(dst, src);
     }
 
-    public final void subq(CiAddress dst, int imm32) {
+    public final void subq(Address dst, int imm32) {
         prefixq(dst);
         if (isByte(imm32)) {
             emitByte(0x83);
@@ -2767,29 +2767,29 @@
         }
     }
 
-    public final void subq(CiRegister dst, int imm32) {
+    public final void subq(Register dst, int imm32) {
         prefixqAndEncode(dst.encoding);
         emitArith(0x81, 0xE8, dst, imm32);
     }
 
-    public final void subq(CiAddress dst, CiRegister src) {
+    public final void subq(Address dst, Register src) {
         prefixq(dst, src);
         emitByte(0x29);
         emitOperandHelper(src, dst);
     }
 
-    public final void subq(CiRegister dst, CiAddress src) {
+    public final void subq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x2B);
         emitOperandHelper(dst, src);
     }
 
-    public final void subq(CiRegister dst, CiRegister src) {
+    public final void subq(Register dst, Register src) {
         prefixqAndEncode(dst.encoding, src.encoding);
         emitArith(0x2B, 0xC0, dst, src);
     }
 
-    public final void testq(CiRegister dst, int imm32) {
+    public final void testq(Register dst, int imm32) {
         // not using emitArith because test
         // doesn't support sign-extension of
         // 8bit operands
@@ -2805,41 +2805,41 @@
         emitInt(imm32);
     }
 
-    public final void testq(CiRegister dst, CiRegister src) {
+    public final void testq(Register dst, Register src) {
         prefixqAndEncode(dst.encoding, src.encoding);
         emitArith(0x85, 0xC0, dst, src);
     }
 
-    public final void xaddq(CiAddress dst, CiRegister src) {
+    public final void xaddq(Address dst, Register src) {
         prefixq(dst, src);
         emitByte(0x0F);
         emitByte(0xC1);
         emitOperandHelper(src, dst);
     }
 
-    public final void xchgq(CiRegister dst, CiAddress src) {
+    public final void xchgq(Register dst, Address src) {
         prefixq(src, dst);
         emitByte(0x87);
         emitOperandHelper(dst, src);
     }
 
-    public final void xchgq(CiRegister dst, CiRegister src) {
+    public final void xchgq(Register dst, Register src) {
         int encode = prefixqAndEncode(dst.encoding, src.encoding);
         emitByte(0x87);
         emitByte(0xc0 | encode);
     }
 
-    public final void xorq(CiRegister dst, int imm32) {
+    public final void xorq(Register dst, int imm32) {
         prefixqAndEncode(dst.encoding);
         emitArith(0x81, 0xF0, dst, imm32);
     }
 
-    public final void xorq(CiRegister dst, CiRegister src) {
+    public final void xorq(Register dst, Register src) {
         prefixqAndEncode(dst.encoding, src.encoding);
         emitArith(0x33, 0xC0, dst, src);
     }
 
-    public final void xorq(CiRegister dst, CiAddress src) {
+    public final void xorq(Register dst, Address src) {
 
         prefixq(src, dst);
         emitByte(0x33);
@@ -2860,7 +2860,7 @@
                 // the code where this idiom is used, in particular the
                 // orderAccess code.
                 lock();
-                addl(new CiAddress(Word, RSP, 0), 0); // Assert the lock# signal here
+                addl(new Address(Word, RSP, 0), 0); // Assert the lock# signal here
             }
         }
     }
@@ -2899,8 +2899,8 @@
         }
     }
 
-    public void nullCheck(CiRegister r) {
-        testl(AMD64.rax, new CiAddress(Word, r.asValue(Word), 0));
+    public void nullCheck(Register r) {
+        testl(AMD64.rax, new Address(Word, r.asValue(Word), 0));
     }
 
     @Override
@@ -2940,7 +2940,7 @@
         emitInt(0);
     }
 
-    public final void call(CiRegister src) {
+    public final void call(Register src) {
         int encode = prefixAndEncode(src.encoding);
         emitByte(0xFF);
         emitByte(0xD0 | encode);
@@ -2964,7 +2964,7 @@
         emitByte(b2 + i);
     }
 
-    public void fld(CiAddress src) {
+    public void fld(Address src) {
         emitByte(0xDD);
         emitOperandHelper(rax, src);
     }
@@ -2988,7 +2988,7 @@
         emitByte(0xF1);
     }
 
-    public void fstp(CiAddress src) {
+    public void fstp(Address src) {
         emitByte(0xDD);
         emitOperandHelper(rbx, src);
     }
@@ -3014,6 +3014,6 @@
 
     @Override
     public void bangStack(int disp) {
-        movq(new CiAddress(target.wordKind, AMD64.RSP, -disp), AMD64.rax);
+        movq(new Address(target.wordKind, AMD64.RSP, -disp), AMD64.rax);
     }
 }
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -31,30 +31,30 @@
  */
 public class AMD64MacroAssembler extends AMD64Assembler {
 
-    public AMD64MacroAssembler(CiTarget target, CiRegisterConfig registerConfig) {
+    public AMD64MacroAssembler(TargetDescription target, RegisterConfig registerConfig) {
         super(target, registerConfig);
     }
 
-    public void pushptr(CiAddress src) {
+    public void pushptr(Address src) {
         pushq(src);
     }
 
-    public void popptr(CiAddress src) {
+    public void popptr(Address src) {
         popq(src);
     }
 
-    public void xorptr(CiRegister dst, CiRegister src) {
+    public void xorptr(Register dst, Register src) {
         xorq(dst, src);
     }
 
-    public void xorptr(CiRegister dst, CiAddress src) {
+    public void xorptr(Register dst, Address src) {
         xorq(dst, src);
     }
 
     // 64 bit versions
 
 
-    public void decrementq(CiRegister reg, int value) {
+    public void decrementq(Register reg, int value) {
         if (value == Integer.MIN_VALUE) {
             subq(reg, value);
             return;
@@ -73,7 +73,7 @@
         }
     }
 
-    public void incrementq(CiRegister reg, int value) {
+    public void incrementq(Register reg, int value) {
         if (value == Integer.MIN_VALUE) {
             addq(reg, value);
             return;
@@ -93,19 +93,19 @@
     }
 
     // These are mostly for initializing null
-    public void movptr(CiAddress dst, int src) {
+    public void movptr(Address dst, int src) {
         movslq(dst, src);
     }
 
-    public final void cmp32(CiRegister src1, int imm) {
+    public final void cmp32(Register src1, int imm) {
         cmpl(src1, imm);
     }
 
-    public final void cmp32(CiRegister src1, CiAddress src2) {
+    public final void cmp32(Register src1, Address src2) {
         cmpl(src1, src2);
     }
 
-    public void cmpsd2int(CiRegister opr1, CiRegister opr2, CiRegister dst, boolean unorderedIsLess) {
+    public void cmpsd2int(Register opr1, Register opr2, Register dst, boolean unorderedIsLess) {
         assert opr1.isFpu() && opr2.isFpu();
         ucomisd(opr1, opr2);
 
@@ -128,7 +128,7 @@
         bind(l);
     }
 
-    public void cmpss2int(CiRegister opr1, CiRegister opr2, CiRegister dst, boolean unorderedIsLess) {
+    public void cmpss2int(Register opr1, Register opr2, Register dst, boolean unorderedIsLess) {
         assert opr1.isFpu();
         assert opr2.isFpu();
         ucomiss(opr1, opr2);
@@ -152,23 +152,23 @@
         bind(l);
     }
 
-    public void cmpptr(CiRegister src1, CiRegister src2) {
+    public void cmpptr(Register src1, Register src2) {
         cmpq(src1, src2);
     }
 
-    public void cmpptr(CiRegister src1, CiAddress src2) {
+    public void cmpptr(Register src1, Address src2) {
         cmpq(src1, src2);
     }
 
-    public void cmpptr(CiRegister src1, int src2) {
+    public void cmpptr(Register src1, int src2) {
         cmpq(src1, src2);
     }
 
-    public void cmpptr(CiAddress src1, int src2) {
+    public void cmpptr(Address src1, int src2) {
         cmpq(src1, src2);
     }
 
-    public void decrementl(CiRegister reg, int value) {
+    public void decrementl(Register reg, int value) {
         if (value == Integer.MIN_VALUE) {
             subl(reg, value);
             return;
@@ -187,7 +187,7 @@
         }
     }
 
-    public void decrementl(CiAddress dst, int value) {
+    public void decrementl(Address dst, int value) {
         if (value == Integer.MIN_VALUE) {
             subl(dst, value);
             return;
@@ -206,7 +206,7 @@
         }
     }
 
-    public void incrementl(CiRegister reg, int value) {
+    public void incrementl(Register reg, int value) {
         if (value == Integer.MIN_VALUE) {
             addl(reg, value);
             return;
@@ -225,7 +225,7 @@
         }
     }
 
-    public void incrementl(CiAddress dst, int value) {
+    public void incrementl(Address dst, int value) {
         if (value == Integer.MIN_VALUE) {
             addl(dst, value);
             return;
@@ -244,7 +244,7 @@
         }
     }
 
-    public void signExtendByte(CiRegister reg) {
+    public void signExtendByte(Register reg) {
         if (reg.isByte()) {
             movsxb(reg, reg); // movsxb
         } else {
@@ -253,12 +253,12 @@
         }
     }
 
-    public void signExtendShort(CiRegister reg) {
+    public void signExtendShort(Register reg) {
         movsxw(reg, reg); // movsxw
     }
 
     // Support optimal SSE move instructions.
-    public void movflt(CiRegister dst, CiRegister src) {
+    public void movflt(Register dst, Register src) {
         assert dst.isFpu() && src.isFpu();
         if (AsmOptions.UseXmmRegToRegMoveAll) {
             movaps(dst, src);
@@ -267,17 +267,17 @@
         }
     }
 
-    public void movflt(CiRegister dst, CiAddress src) {
+    public void movflt(Register dst, Address src) {
         assert dst.isFpu();
         movss(dst, src);
     }
 
-    public void movflt(CiAddress dst, CiRegister src) {
+    public void movflt(Address dst, Register src) {
         assert src.isFpu();
         movss(dst, src);
     }
 
-    public void movdbl(CiRegister dst, CiRegister src) {
+    public void movdbl(Register dst, Register src) {
         assert dst.isFpu() && src.isFpu();
         if (AsmOptions.UseXmmRegToRegMoveAll) {
             movapd(dst, src);
@@ -286,7 +286,7 @@
         }
     }
 
-    public void movdbl(CiRegister dst, CiAddress src) {
+    public void movdbl(Register dst, Address src) {
         assert dst.isFpu();
         if (AsmOptions.UseXmmLoadAndClearUpper) {
             movsd(dst, src);
@@ -295,7 +295,7 @@
         }
     }
 
-    public void movdbl(CiAddress dst, CiRegister src) {
+    public void movdbl(Address dst, Register src) {
         assert src.isFpu();
         movsd(dst, src);
     }
@@ -304,20 +304,20 @@
      * Non-atomic write of a 64-bit constant to memory. Do not use
      * if the address might be a volatile field!
      */
-    public void movlong(CiAddress dst, long src) {
-        CiAddress high = new CiAddress(dst.kind, dst.base, dst.index, dst.scale, dst.displacement + 4);
+    public void movlong(Address dst, long src) {
+        Address high = new Address(dst.kind, dst.base, dst.index, dst.scale, dst.displacement + 4);
         movl(dst, (int) (src & 0xFFFFFFFF));
         movl(high, (int) (src >> 32));
     }
 
-    public void xchgptr(CiRegister src1, CiRegister src2) {
+    public void xchgptr(Register src1, Register src2) {
         xchgq(src1, src2);
     }
 
-    public void flog(CiRegister dest, CiRegister value, boolean base10) {
+    public void flog(Register dest, Register value, boolean base10) {
         assert value.spillSlotSize == dest.spillSlotSize;
 
-        CiAddress tmp = new CiAddress(Kind.Double, AMD64.RSP);
+        Address tmp = new Address(Kind.Double, AMD64.RSP);
         if (base10) {
             fldlg2();
         } else {
@@ -332,22 +332,22 @@
         addq(AMD64.rsp, dest.spillSlotSize);
     }
 
-    public void fsin(CiRegister dest, CiRegister value) {
+    public void fsin(Register dest, Register value) {
         ftrig(dest, value, 's');
     }
 
-    public void fcos(CiRegister dest, CiRegister value) {
+    public void fcos(Register dest, Register value) {
         ftrig(dest, value, 'c');
     }
 
-    public void ftan(CiRegister dest, CiRegister value) {
+    public void ftan(Register dest, Register value) {
         ftrig(dest, value, 't');
     }
 
-    private void ftrig(CiRegister dest, CiRegister value, char op) {
+    private void ftrig(Register dest, Register value, char op) {
         assert value.spillSlotSize == dest.spillSlotSize;
 
-        CiAddress tmp = new CiAddress(Kind.Double, AMD64.RSP);
+        Address tmp = new Address(Kind.Double, AMD64.RSP);
         subq(AMD64.rsp, value.spillSlotSize);
         movsd(tmp, value);
         fld(tmp);
@@ -368,23 +368,23 @@
 
     /**
      * Emit code to save a given set of callee save registers in the
-     * {@linkplain CiCalleeSaveLayout CSA} within the frame.
+     * {@linkplain CalleeSaveLayout CSA} within the frame.
      * @param csl the description of the CSA
      * @param frameToCSA offset from the frame pointer to the CSA
      */
-    public void save(CiCalleeSaveLayout csl, int frameToCSA) {
-        CiRegisterValue frame = frameRegister.asValue();
-        for (CiRegister r : csl.registers) {
+    public void save(CalleeSaveLayout csl, int frameToCSA) {
+        RegisterValue frame = frameRegister.asValue();
+        for (Register r : csl.registers) {
             int offset = csl.offsetOf(r);
-            movq(new CiAddress(target.wordKind, frame, frameToCSA + offset), r);
+            movq(new Address(target.wordKind, frame, frameToCSA + offset), r);
         }
     }
 
-    public void restore(CiCalleeSaveLayout csl, int frameToCSA) {
-        CiRegisterValue frame = frameRegister.asValue();
-        for (CiRegister r : csl.registers) {
+    public void restore(CalleeSaveLayout csl, int frameToCSA) {
+        RegisterValue frame = frameRegister.asValue();
+        for (Register r : csl.registers) {
             int offset = csl.offsetOf(r);
-            movq(r, new CiAddress(target.wordKind, frame, frameToCSA + offset));
+            movq(r, new Address(target.wordKind, frame, frameToCSA + offset));
         }
     }
 }
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java	Sat Jun 09 20:10:05 2012 +0200
@@ -27,7 +27,7 @@
 import java.util.*;
 
 import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.code.CiAddress.*;
+import com.oracle.graal.api.code.Address.*;
 import com.oracle.graal.api.meta.*;
 
 /**
@@ -58,9 +58,9 @@
      */
     protected boolean finished = true;
 
-    protected final CiTarget target;
+    protected final TargetDescription target;
 
-    public CiXirAssembler(CiTarget target) {
+    public CiXirAssembler(TargetDescription target) {
         this.target = target;
     }
 
@@ -248,7 +248,7 @@
     public static class XirRegister extends XirTemp {
         public final Value register;
 
-        XirRegister(CiXirAssembler asm, String name, CiRegisterValue register, boolean reserve) {
+        XirRegister(CiXirAssembler asm, String name, RegisterValue register, boolean reserve) {
             super(asm, name, register.kind, reserve);
             this.register = register;
         }
@@ -834,15 +834,15 @@
         return temp;
     }
 
-    public XirOperand createRegister(String name, Kind kind, CiRegister register) {
+    public XirOperand createRegister(String name, Kind kind, Register register) {
         return createRegister(name, kind, register, false);
     }
 
-    public XirOperand createRegisterTemp(String name, Kind kind, CiRegister register) {
+    public XirOperand createRegisterTemp(String name, Kind kind, Register register) {
         return createRegister(name, kind, register, true);
     }
 
-    private XirOperand createRegister(String name, Kind kind, CiRegister register, boolean reserve) {
+    private XirOperand createRegister(String name, Kind kind, Register register, boolean reserve) {
         assert !finished;
         XirRegister fixed = new XirRegister(this, name, register.asValue(kind), reserve);
         temps.add(fixed);
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSite.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSite.java	Sat Jun 09 20:10:05 2012 +0200
@@ -72,5 +72,5 @@
      * The object for recording speculations made during compilation.
      * May be null.
      */
-    CiAssumptions assumptions();
+    Assumptions assumptions();
 }
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseProfilingInfo.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseProfilingInfo.java	Sat Jun 09 20:10:05 2012 +0200
@@ -84,6 +84,6 @@
 
     @Override
     public String toString() {
-        return "BaseProfilingInfo<" + CiUtil.profileToString(this, null, "; ") + ">";
+        return "BaseProfilingInfo<" + CodeUtil.profileToString(this, null, "; ") + ">";
     }
 }
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java	Sat Jun 09 20:10:05 2012 +0200
@@ -71,6 +71,6 @@
      */
     @Override
     public String toString() {
-        return CiUtil.format("%H.%n [unresolved]", this);
+        return CodeUtil.format("%H.%n [unresolved]", this);
     }
 }
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java	Sat Jun 09 20:10:05 2012 +0200
@@ -64,6 +64,6 @@
 
     @Override
     public String toString() {
-        return CiUtil.format("%H.%n(%p) [unresolved]", this);
+        return CodeUtil.format("%H.%n(%p) [unresolved]", this);
     }
 }
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java	Sat Jun 09 20:10:05 2012 +0200
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.criutils;
 
-import static com.oracle.graal.api.code.CiValueUtil.*;
+import static com.oracle.graal.api.code.ValueUtil.*;
 
 import java.io.*;
 import java.util.*;
@@ -97,8 +97,8 @@
      */
     public void printCompilation(JavaMethod method) {
         begin("compilation");
-        out.print("name \" ").print(CiUtil.format("%H::%n", method)).println('"');
-        out.print("method \"").print(CiUtil.format("%f %r %H.%n(%p)", method)).println('"');
+        out.print("name \" ").print(CodeUtil.format("%H::%n", method)).println('"');
+        out.print("method \"").print(CodeUtil.format("%f %r %H.%n(%p)", method)).println('"');
         out.print("date ").println(System.currentTimeMillis());
         end("compilation");
     }
@@ -106,7 +106,7 @@
     /**
      * Formats a given {@linkplain FrameState JVM frame state} as a multi line string.
      */
-    protected String debugInfoToString(CiCodePos codePos, BitSet registerRefMap, BitSet frameRefMap, CiArchitecture arch) {
+    protected String debugInfoToString(BytecodePosition codePos, BitSet registerRefMap, BitSet frameRefMap, Architecture arch) {
         StringBuilder sb = new StringBuilder();
 
         if (registerRefMap != null) {
@@ -126,13 +126,13 @@
         }
 
         if (codePos != null) {
-            CiCodePos curCodePos = codePos;
-            List<CiVirtualObject> virtualObjects = new ArrayList<>();
+            BytecodePosition curCodePos = codePos;
+            List<VirtualObject> virtualObjects = new ArrayList<>();
             do {
-                sb.append(CiUtil.toLocation(curCodePos.method, curCodePos.bci));
+                sb.append(CodeUtil.toLocation(curCodePos.method, curCodePos.bci));
                 sb.append('\n');
-                if (curCodePos instanceof CiFrame) {
-                    CiFrame frame = (CiFrame) curCodePos;
+                if (curCodePos instanceof BytecodeFrame) {
+                    BytecodeFrame frame = (BytecodeFrame) curCodePos;
                     if (frame.numStack > 0) {
                         sb.append("stack: ");
                         for (int i = 0; i < frame.numStack; i++) {
@@ -158,7 +158,7 @@
             } while (curCodePos != null);
 
             for (int i = 0; i < virtualObjects.size(); i++) {
-                CiVirtualObject obj = virtualObjects.get(i);
+                VirtualObject obj = virtualObjects.get(i);
                 sb.append(obj).append(" ").append(obj.type().name()).append(" ");
                 for (int j = 0; j < obj.values().length; j++) {
                     sb.append(valueToString(obj.values()[j], virtualObjects)).append(' ');
@@ -170,7 +170,7 @@
         return sb.toString();
     }
 
-    protected String valueToString(Value value, List<CiVirtualObject> virtualObjects) {
+    protected String valueToString(Value value, List<VirtualObject> virtualObjects) {
         if (value == null) {
             return "-";
         }
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java	Sat Jun 09 20:10:05 2012 +0200
@@ -84,7 +84,7 @@
  */
 public class HexCodeFile {
 
-    public static final String NEW_LINE = CiUtil.NEW_LINE;
+    public static final String NEW_LINE = CodeUtil.NEW_LINE;
     public static final String SECTION_DELIM = " <||@";
     public static final Pattern SECTION = Pattern.compile("(\\S+)\\s+(.*)", Pattern.DOTALL);
     public static final Pattern COMMENT = Pattern.compile("(\\d+)\\s+(.*)", Pattern.DOTALL);
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/SnapshotProfilingInfo.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/SnapshotProfilingInfo.java	Sat Jun 09 20:10:05 2012 +0200
@@ -88,7 +88,7 @@
 
     @Override
     public String toString() {
-        return CiUtil.profileToString(this, null, "; ");
+        return CodeUtil.profileToString(this, null, "; ");
     }
 
     /**
@@ -126,7 +126,7 @@
         if (txtFile != null) {
             PrintStream out = new PrintStream(txtFile);
             try {
-                out.println(CiUtil.profileToString(this, null, CiUtil.NEW_LINE));
+                out.println(CodeUtil.profileToString(this, null, CodeUtil.NEW_LINE));
             } finally {
                 out.close();
             }
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TypeCheckHints.java	Sat Jun 09 18:01:23 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TypeCheckHints.java	Sat Jun 09 20:10:05 2012 +0200
@@ -58,7 +58,7 @@
      *            {@code maxHints}) is below this value, then {@link #types} will be null
      * @param maxHints the maximum length of {@link #types}
      */
-    public TypeCheckHints(ResolvedJavaType type, JavaTypeProfile profile, CiAssumptions assumptions, double minHintHitProbability, int maxHints) {
+    public TypeCheckHints(ResolvedJavaType type, JavaTypeProfile profile, Assumptions assumptions, double minHintHitProbability, int maxHints) {
         if (type != null && isFinalClass(type)) {
             types = new ResolvedJavaType[] {type};
             exact = true;
--- a/src/share/vm/classfile/systemDictionary.hpp	Sat Jun 09 18:01:23 2012 +0200
+++ b/src/share/vm/classfile/systemDictionary.hpp	Sat Jun 09 20:10:05 2012 +0200
@@ -197,7 +197,6 @@
   template(HotSpotMethodResolved_klass,           com_oracle_graal_hotspot_ri_HotSpotMethodResolved,            Opt) \
   template(HotSpotMethodData_klass,               com_oracle_graal_hotspot_ri_HotSpotMethodData,                Opt) \
   template(HotSpotTargetMethod_klass,             com_oracle_graal_hotspot_HotSpotTargetMethod,                 Opt) \
-  template(HotSpotExceptionHandler_klass,         com_oracle_graal_hotspot_HotSpotExceptionHandler,             Opt) \
   template(HotSpotProxy_klass,                    com_oracle_graal_hotspot_HotSpotProxy,                        Opt) \
   template(CiAssumptions_klass,                   com_oracle_max_cri_ci_CiAssumptions,                              Opt) \
   template(CiAssumptions_MethodContents_klass,    com_oracle_max_cri_ci_CiAssumptions_MethodContents,               Opt) \
--- a/src/share/vm/classfile/vmSymbols.hpp	Sat Jun 09 18:01:23 2012 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Sat Jun 09 20:10:05 2012 +0200
@@ -280,7 +280,6 @@
   template(com_oracle_graal_hotspot_HotSpotTypeResolved,          "com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl")          \
   template(com_oracle_graal_hotspot_HotSpotType,                  "com/oracle/graal/hotspot/ri/HotSpotType")                      \
   template(com_oracle_graal_hotspot_HotSpotKlassOop,              "com/oracle/graal/hotspot/ri/HotSpotKlassOop")                  \
-  template(com_oracle_graal_hotspot_HotSpotExceptionHandler,      "com/oracle/graal/api/meta/ExceptionHandler")          \
   template(com_oracle_graal_hotspot_HotSpotProxy,                 "com/oracle/graal/hotspot/HotSpotProxy")                        \
   template(com_oracle_graal_hotspot_CompilerImpl,                 "com/oracle/graal/hotspot/HotSpotGraalRuntime")                        \
   template(com_oracle_max_cri_ri_RiMethod,                            "com/oracle/graal/api/meta/JavaMethod")                                   \
@@ -288,11 +287,11 @@
   template(com_oracle_max_cri_ri_RiType,                              "com/oracle/graal/api/meta/JavaType")                                     \
   template(com_oracle_max_cri_ri_RiConstantPool,                      "com/oracle/graal/api/meta/ConstantPool")                             \
   template(com_oracle_max_cri_ri_RiExceptionHandler,                  "com/oracle/graal/api/meta/ExceptionHandler")                         \
-  template(com_oracle_max_cri_ci_CiAssumptions,                       "com/oracle/graal/api/code/CiAssumptions")                              \
-  template(com_oracle_max_cri_ci_CiAssumptions_MethodContents,        "com/oracle/graal/api/code/CiAssumptions$MethodContents")               \
-  template(com_oracle_max_cri_ci_CiAssumptions_ConcreteSubtype,       "com/oracle/graal/api/code/CiAssumptions$ConcreteSubtype")              \
-  template(com_oracle_max_cri_ci_CiAssumptions_ConcreteMethod,        "com/oracle/graal/api/code/CiAssumptions$ConcreteMethod")               \
-  template(com_oracle_max_cri_ci_CiGenericCallback,                   "com/oracle/graal/api/code/CiGenericCallback")                          \
+  template(com_oracle_max_cri_ci_CiAssumptions,                       "com/oracle/graal/api/code/Assumptions")                              \
+  template(com_oracle_max_cri_ci_CiAssumptions_MethodContents,        "com/oracle/graal/api/code/Assumptions$MethodContents")               \
+  template(com_oracle_max_cri_ci_CiAssumptions_ConcreteSubtype,       "com/oracle/graal/api/code/Assumptions$ConcreteSubtype")              \
+  template(com_oracle_max_cri_ci_CiAssumptions_ConcreteMethod,        "com/oracle/graal/api/code/Assumptions$ConcreteMethod")               \
+  template(com_oracle_max_cri_ci_CiGenericCallback,                   "com/oracle/graal/api/code/GenericCallback")                          \
   template(com_oracle_max_cri_ci_CiTargetMethod,                      "com/oracle/graal/api/code/CompilationResult")                             \
   template(com_oracle_max_cri_ci_CiTargetMethod_Site,                 "com/oracle/graal/api/code/CompilationResult$Site")                        \
   template(com_oracle_max_cri_ci_CiTargetMethod_Call,                 "com/oracle/graal/api/code/CompilationResult$Call")                        \
@@ -301,18 +300,18 @@
   template(com_oracle_max_cri_ci_CiTargetMethod_ExceptionHandler,     "com/oracle/graal/api/code/CompilationResult$ExceptionHandler")            \
   template(com_oracle_max_cri_ci_CiTargetMethod_Mark,                 "com/oracle/graal/api/code/CompilationResult$Mark")                        \
   template(com_oracle_max_cri_ci_CiBitMap,	                          "java/util/BitSet")                                   \
-  template(com_oracle_max_cri_ci_CiDebugInfo,                         "com/oracle/graal/api/code/CiDebugInfo")                                \
-  template(com_oracle_max_cri_ci_CiFrame,                             "com/oracle/graal/api/code/CiFrame")                                    \
+  template(com_oracle_max_cri_ci_CiDebugInfo,                         "com/oracle/graal/api/code/DebugInfo")                                \
+  template(com_oracle_max_cri_ci_CiFrame,                             "com/oracle/graal/api/code/BytecodeFrame")                                    \
   template(com_oracle_max_cri_ci_CiValue,                             "com/oracle/graal/api/meta/Value")                                    \
-  template(com_oracle_max_cri_ci_CiStackSlot,                         "com/oracle/graal/api/code/CiStackSlot")                                \
-  template(com_oracle_max_cri_ci_CiRegisterValue,                     "com/oracle/graal/api/code/CiRegisterValue")                            \
-  template(com_oracle_max_cri_ci_CiRegister,                          "com/oracle/graal/api/code/CiRegister")                                 \
-  template(com_oracle_max_cri_ci_CiCodePos,                           "com/oracle/graal/api/code/CiCodePos")                                  \
+  template(com_oracle_max_cri_ci_CiStackSlot,                         "com/oracle/graal/api/code/StackSlot")                                \
+  template(com_oracle_max_cri_ci_CiRegisterValue,                     "com/oracle/graal/api/code/RegisterValue")                            \
+  template(com_oracle_max_cri_ci_CiRegister,                          "com/oracle/graal/api/code/Register")                                 \
+  template(com_oracle_max_cri_ci_CiCodePos,                           "com/oracle/graal/api/code/BytecodePosition")                                  \
   template(com_oracle_max_cri_ci_CiConstant,                          "com/oracle/graal/api/meta/Constant")                                 \
-  template(com_oracle_max_cri_ci_CiVirtualObject,                     "com/oracle/graal/api/code/CiVirtualObject")                            \
-  template(com_oracle_max_cri_ci_CiMonitorValue,                      "com/oracle/graal/api/code/CiMonitorValue")                             \
+  template(com_oracle_max_cri_ci_CiVirtualObject,                     "com/oracle/graal/api/code/VirtualObject")                            \
+  template(com_oracle_max_cri_ci_CiMonitorValue,                      "com/oracle/graal/api/code/MonitorValue")                             \
   template(com_oracle_max_cri_ci_CiKind,                              "com/oracle/graal/api/meta/Kind")                                     \
-  template(com_oracle_max_cri_ci_CiRuntimeCall,                       "com/oracle/graal/api/code/CiRuntimeCall")                              \
+  template(com_oracle_max_cri_ci_CiRuntimeCall,                       "com/oracle/graal/api/code/RuntimeCall")                              \
   template(startCompiler_name,                        "startCompiler")                                                  \
   template(bootstrap_name,                            "bootstrap")                                                      \
   template(shutdownCompiler_name,                     "shutdownCompiler")                                               \
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Sat Jun 09 18:01:23 2012 +0200
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Sat Jun 09 20:10:05 2012 +0200
@@ -103,30 +103,30 @@
   typeArrayHandle handlers = method->exception_table();
   int handler_count = handlers.is_null() ? 0 : handlers->length() / 4;
 
-  instanceKlass::cast(HotSpotExceptionHandler::klass())->initialize(CHECK_NULL);
+  instanceKlass::cast(RiExceptionHandler::klass())->initialize(CHECK_NULL);
   objArrayHandle array = oopFactory::new_objArray(SystemDictionary::RiExceptionHandler_klass(), handler_count, CHECK_NULL);
 
   for (int i = 0; i < handler_count; i++) {
     // exception handlers are stored as four integers: start bci, end bci, handler bci, catch class constant pool index
     int base = i * 4;
-    Handle entry = instanceKlass::cast(HotSpotExceptionHandler::klass())->allocate_instance(CHECK_NULL);
-    HotSpotExceptionHandler::set_startBCI(entry, handlers->int_at(base + 0));
-    HotSpotExceptionHandler::set_endBCI(entry, handlers->int_at(base + 1));
-    HotSpotExceptionHandler::set_handlerBCI(entry, handlers->int_at(base + 2));
+    Handle entry = instanceKlass::cast(RiExceptionHandler::klass())->allocate_instance(CHECK_NULL);
+    RiExceptionHandler::set_startBCI(entry, handlers->int_at(base + 0));
+    RiExceptionHandler::set_endBCI(entry, handlers->int_at(base + 1));
+    RiExceptionHandler::set_handlerBCI(entry, handlers->int_at(base + 2));
     int catch_class_index = handlers->int_at(base + 3);
-    HotSpotExceptionHandler::set_catchTypeCPI(entry, catch_class_index);
+    RiExceptionHandler::set_catchTypeCPI(entry, catch_class_index);
 
     if (catch_class_index == 0) {
-      HotSpotExceptionHandler::set_catchType(entry, NULL);
+      RiExceptionHandler::set_catchType(entry, NULL);
     } else {
       constantPoolOop cp = instanceKlass::cast(method->method_holder())->constants();
       KlassHandle loading_klass = method->method_holder();
       Handle catch_class = GraalCompiler::get_RiType(cp, catch_class_index, loading_klass, CHECK_NULL);
       if (catch_class->klass() == HotSpotTypeResolved::klass() && java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(catch_class)) == SystemDictionary::Throwable_klass()) {
-        HotSpotExceptionHandler::set_catchType(entry, NULL);
-        HotSpotExceptionHandler::set_catchTypeCPI(entry, 0);
+        RiExceptionHandler::set_catchType(entry, NULL);
+        RiExceptionHandler::set_catchTypeCPI(entry, 0);
       } else {
-        HotSpotExceptionHandler::set_catchType(entry, catch_class());
+        RiExceptionHandler::set_catchType(entry, catch_class());
       }
     }
     array->obj_at_put(i, entry());
@@ -1139,7 +1139,7 @@
 #define METHOD_DATA     "Lcom/oracle/graal/hotspot/ri/HotSpotMethodData;"
 #define CI_CONSTANT     "Lcom/oracle/graal/api/meta/Constant;"
 #define CI_KIND         "Lcom/oracle/graal/api/meta/Kind;"
-#define CI_RUNTIME_CALL "Lcom/oracle/graal/api/code/CiRuntimeCall;"
+#define CI_RUNTIME_CALL "Lcom/oracle/graal/api/code/RuntimeCall;"
 #define STRING          "Ljava/lang/String;"
 #define OBJECT          "Ljava/lang/Object;"
 #define CLASS           "Ljava/lang/Class;"
--- a/src/share/vm/graal/graalJavaAccess.hpp	Sat Jun 09 18:01:23 2012 +0200
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Sat Jun 09 20:10:05 2012 +0200
@@ -101,22 +101,22 @@
     oop_field(HotSpotTargetMethod, sites, "[Lcom/oracle/graal/api/code/CompilationResult$Site;") \
     oop_field(HotSpotTargetMethod, exceptionHandlers, "[Lcom/oracle/graal/api/code/CompilationResult$ExceptionHandler;") \
   end_class                                                                             \
-  start_class(HotSpotExceptionHandler)                                                  \
-    int_field(HotSpotExceptionHandler, startBCI)                                        \
-    int_field(HotSpotExceptionHandler, endBCI)                                          \
-    int_field(HotSpotExceptionHandler, handlerBCI)                                      \
-    int_field(HotSpotExceptionHandler, catchTypeCPI)                                 \
-    oop_field(HotSpotExceptionHandler, catchType, "Lcom/oracle/graal/api/meta/JavaType;")    \
+  start_class(RiExceptionHandler)                                                  \
+    int_field(RiExceptionHandler, startBCI)                                        \
+    int_field(RiExceptionHandler, endBCI)                                          \
+    int_field(RiExceptionHandler, handlerBCI)                                      \
+    int_field(RiExceptionHandler, catchTypeCPI)                                 \
+    oop_field(RiExceptionHandler, catchType, "Lcom/oracle/graal/api/meta/JavaType;")    \
   end_class                                                                             \
   start_class(CiTargetMethod)                                                           \
     int_field(CiTargetMethod, frameSize)                                                \
     int_field(CiTargetMethod, customStackAreaOffset)                                    \
     oop_field(CiTargetMethod, targetCode, "[B")                                         \
-    oop_field(CiTargetMethod, assumptions, "Lcom/oracle/graal/api/code/CiAssumptions;")     \
+    oop_field(CiTargetMethod, assumptions, "Lcom/oracle/graal/api/code/Assumptions;")     \
     int_field(CiTargetMethod, targetCodeSize)                                           \
   end_class                                                                             \
   start_class(CiAssumptions)                                                            \
-    oop_field(CiAssumptions, list, "[Lcom/oracle/graal/api/code/CiAssumptions$Assumption;") \
+    oop_field(CiAssumptions, list, "[Lcom/oracle/graal/api/code/Assumptions$Assumption;") \
   end_class                                                                             \
   start_class(CiAssumptions_MethodContents)                                             \
     oop_field(CiAssumptions_MethodContents, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \
@@ -135,14 +135,14 @@
   end_class                                                                             \
   start_class(CiTargetMethod_Call)                                                      \
     oop_field(CiTargetMethod_Call, target, "Ljava/lang/Object;")                        \
-    oop_field(CiTargetMethod_Call, debugInfo, "Lcom/oracle/graal/api/code/CiDebugInfo;")    \
+    oop_field(CiTargetMethod_Call, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;")    \
   end_class                                                                             \
   start_class(CiTargetMethod_DataPatch)                                                 \
     oop_field(CiTargetMethod_DataPatch, constant, "Lcom/oracle/graal/api/meta/Constant;") \
     int_field(CiTargetMethod_DataPatch, alignment)                                      \
   end_class                                                                             \
   start_class(CiTargetMethod_Safepoint)                                                 \
-    oop_field(CiTargetMethod_Safepoint, debugInfo, "Lcom/oracle/graal/api/code/CiDebugInfo;") \
+    oop_field(CiTargetMethod_Safepoint, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;") \
   end_class                                                                             \
   start_class(CiTargetMethod_ExceptionHandler)                                          \
     int_field(CiTargetMethod_ExceptionHandler, handlerPos)                              \
@@ -152,7 +152,7 @@
     oop_field(CiTargetMethod_Mark, references, "[Lcom/oracle/graal/api/code/CompilationResult$Mark;") \
   end_class                                                                             \
   start_class(CiDebugInfo)                                                              \
-    oop_field(CiDebugInfo, codePos, "Lcom/oracle/graal/api/code/CiCodePos;")                \
+    oop_field(CiDebugInfo, codePos, "Lcom/oracle/graal/api/code/BytecodePosition;")                \
     oop_field(CiDebugInfo, registerRefMap, "Ljava/util/BitSet;")          \
     oop_field(CiDebugInfo, frameRefMap, "Ljava/util/BitSet;")             \
   end_class                                                                             \
@@ -169,7 +169,7 @@
     boolean_field(CiFrame, duringCall)                                                  \
   end_class                                                                             \
   start_class(CiCodePos)                                                                \
-    oop_field(CiCodePos, caller, "Lcom/oracle/graal/api/code/CiCodePos;")                   \
+    oop_field(CiCodePos, caller, "Lcom/oracle/graal/api/code/BytecodePosition;")                   \
     oop_field(CiCodePos, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;")            \
     int_field(CiCodePos, bci)                                                           \
   end_class                                                                             \
@@ -188,21 +188,21 @@
     static_oop_field(CiKind, Long, "Lcom/oracle/graal/api/meta/Kind;");                   \
   end_class                                                                             \
   start_class(CiRuntimeCall)                                                            \
-    static_oop_field(CiRuntimeCall, UnwindException, "Lcom/oracle/graal/api/code/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, RegisterFinalizer, "Lcom/oracle/graal/api/code/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, SetDeoptInfo, "Lcom/oracle/graal/api/code/CiRuntimeCall;");    \
-    static_oop_field(CiRuntimeCall, CreateNullPointerException, "Lcom/oracle/graal/api/code/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, CreateOutOfBoundsException, "Lcom/oracle/graal/api/code/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, JavaTimeMillis, "Lcom/oracle/graal/api/code/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, JavaTimeNanos, "Lcom/oracle/graal/api/code/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, Debug, "Lcom/oracle/graal/api/code/CiRuntimeCall;");           \
-    static_oop_field(CiRuntimeCall, ArithmeticFrem, "Lcom/oracle/graal/api/code/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticDrem, "Lcom/oracle/graal/api/code/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticCos, "Lcom/oracle/graal/api/code/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticTan, "Lcom/oracle/graal/api/code/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticSin, "Lcom/oracle/graal/api/code/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, Deoptimize, "Lcom/oracle/graal/api/code/CiRuntimeCall;");      \
-    static_oop_field(CiRuntimeCall, GenericCallback, "Lcom/oracle/graal/api/code/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, UnwindException, "Lcom/oracle/graal/api/code/RuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, RegisterFinalizer, "Lcom/oracle/graal/api/code/RuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, SetDeoptInfo, "Lcom/oracle/graal/api/code/RuntimeCall;");    \
+    static_oop_field(CiRuntimeCall, CreateNullPointerException, "Lcom/oracle/graal/api/code/RuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, CreateOutOfBoundsException, "Lcom/oracle/graal/api/code/RuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, JavaTimeMillis, "Lcom/oracle/graal/api/code/RuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, JavaTimeNanos, "Lcom/oracle/graal/api/code/RuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, Debug, "Lcom/oracle/graal/api/code/RuntimeCall;");           \
+    static_oop_field(CiRuntimeCall, ArithmeticFrem, "Lcom/oracle/graal/api/code/RuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticDrem, "Lcom/oracle/graal/api/code/RuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticCos, "Lcom/oracle/graal/api/code/RuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticTan, "Lcom/oracle/graal/api/code/RuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticSin, "Lcom/oracle/graal/api/code/RuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, Deoptimize, "Lcom/oracle/graal/api/code/RuntimeCall;");      \
+    static_oop_field(CiRuntimeCall, GenericCallback, "Lcom/oracle/graal/api/code/RuntimeCall;"); \
   end_class                                                                             \
   start_class(RiMethod)                                                                 \
   end_class                                                                             \
@@ -211,7 +211,7 @@
     static_oop_field(CiValue, IllegalValue, "Lcom/oracle/graal/api/meta/Value;");         \
   end_class                                                                             \
   start_class(CiRegisterValue)                                                          \
-    oop_field(CiRegisterValue, reg, "Lcom/oracle/graal/api/code/CiRegister;")               \
+    oop_field(CiRegisterValue, reg, "Lcom/oracle/graal/api/code/Register;")               \
   end_class                                                                             \
   start_class(CiRegister)                                                               \
     int_field(CiRegister, number)                                                       \