changeset 4199:aaac4894175c

Renamed cri packages from sun to oracle.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 03 Jan 2012 16:29:28 +0100
parents 8c9c0e1eaab1
children 816ac0e579fb
files 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/ci/CiAddress.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiArchitecture.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiAssumptions.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiBailout.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiBitMap.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCalleeSaveLayout.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCallingConvention.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCodePos.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCompiler.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiConstant.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiDebugInfo.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiExceptionHandler.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiFrame.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiGenericCallback.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiKind.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiMonitorValue.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiRegister.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiRegisterConfig.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiRegisterValue.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiResult.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiRuntimeCall.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiStackSlot.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiStatistics.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiTarget.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiTargetMethod.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiUtil.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValue.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValueUtil.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiVariable.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiVirtualObject.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/package-info.java graal/com.oracle.max.cri/src/com/oracle/max/cri/package-info.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiCompiledMethod.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiConstantPool.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiExceptionHandler.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiField.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiMethod.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRegisterAttributes.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRegisterConfig.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedField.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedType.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRuntime.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiSignature.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiType.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiTypeProfile.java graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/package-info.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/RiXirGenerator.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirArgument.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSite.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSnippet.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirTemplate.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/package-info.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiAddress.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiArchitecture.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiAssumptions.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiBailout.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiBitMap.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiCalleeSaveLayout.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiCallingConvention.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiCodePos.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiCompiler.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiConstant.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiDebugInfo.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiExceptionHandler.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiFrame.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiGenericCallback.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiKind.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiMonitorValue.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiRegister.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiRegisterConfig.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiRegisterValue.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiResult.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiRuntimeCall.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiStackSlot.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiStatistics.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiTarget.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiTargetMethod.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiUtil.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiValue.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiValueUtil.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiVariable.java graal/com.oracle.max.cri/src/com/sun/cri/ci/CiVirtualObject.java graal/com.oracle.max.cri/src/com/sun/cri/ci/package-info.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiCompiledMethod.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiConstantPool.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiExceptionHandler.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiField.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiMethod.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRegisterAttributes.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRegisterConfig.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiResolvedField.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiResolvedMethod.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiResolvedType.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRuntime.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiSignature.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiType.java graal/com.oracle.max.cri/src/com/sun/cri/ri/RiTypeProfile.java graal/com.oracle.max.cri/src/com/sun/cri/ri/package-info.java graal/com.oracle.max.cri/src/com/sun/cri/xir/CiXirAssembler.java graal/com.oracle.max.cri/src/com/sun/cri/xir/RiXirGenerator.java graal/com.oracle.max.cri/src/com/sun/cri/xir/XirArgument.java graal/com.oracle.max.cri/src/com/sun/cri/xir/XirSite.java graal/com.oracle.max.cri/src/com/sun/cri/xir/XirSnippet.java graal/com.oracle.max.cri/src/com/sun/cri/xir/XirTemplate.java graal/com.oracle.max.cri/src/com/sun/cri/xir/package-info.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.graal.compiler/src/com/oracle/max/graal/alloc/simple/AssignRegisters.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/DataFlowAnalysis.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/ResolveDataFlow.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/Location.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LocationMap.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/MoveResolver.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/RegisterVerifier.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/ValueUtil.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/ControlFlowOptimizer.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/Interval.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScanWalker.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/OperandPool.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinterObserver.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinterObserver.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/PhiResolver.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/BlockMap.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/FrameStateBuilder.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/GraphBuilderPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/JsrNotSupportedBailout.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/FrameMap.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRBranch.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRCall.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRDebugInfo.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRInstruction.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRPhiMapping.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRXirInstruction.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/StandardOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/CanonicalizerPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FindInductionVariablesPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FloatingReadPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IdentifyBoxingPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IntrinsificationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/SnippetIntrinsificationPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/stub/CompilerStub.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/Backend.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ArithmeticOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CallOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareToIntOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompilerStubEmitter.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ControlFlowOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFIOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFLOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DeoptimizationStub.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DivOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRInstruction.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LogicFloatOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MoveOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MulOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Op1Opcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ShiftOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirAssembler.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirOpcode.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/Compiler.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/CompilerImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotCompiledMethod.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotConstantPool.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotExceptionHandler.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotField.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRegisterConfig.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRuntime.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotSignature.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotTargetMethod.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotXirGenerator.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMEntries.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMEntriesNative.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMExits.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMExitsNative.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/ArrayWriteBarrier.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/CurrentThread.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/FieldWriteBarrier.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/WriteBarrier.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethod.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodUnresolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotType.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypePrimitive.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolvedImpl.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeUnresolved.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/server/ReplacingStreams.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/cri/GraalRuntime.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/CallTargetNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ConstantNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeWithExceptionNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LocalNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LoopBeginNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/PhiNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ReturnNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/UnwindNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ValueNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ValueUtil.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/AndNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ArithmeticNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/BinaryNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/CompareNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/Condition.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConditionalNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConvertNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatAddNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatArithmeticNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatDivNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatMulNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatRemNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatSubNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerAddNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerArithmeticNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerDivNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerMulNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerRemNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerSubNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/LeftShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/LogicNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NormalizeCompareNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NullCheckNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/OrNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/RightShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/UnsignedRightShiftNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/XorNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/AccessNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/BoxNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/BoxingMethodPool.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/IndexedLocationNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/LocationNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ReadNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/RuntimeCallNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeAccessNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeReadNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeWriteNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnboxNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeCastNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeLoadNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeStoreNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ValueAnchorNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/WriteNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/AccessFieldNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/AccessIndexedNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ArrayLengthNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CheckCastNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CompareAndSwapNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ExceptionObjectNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/InstanceOfNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/IsTypeNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/LoadFieldNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/LoadIndexedNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/MethodCallTargetNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewInstanceNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewMultiArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewObjectArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewTypeArrayNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/RegisterFinalizerNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/StoreFieldNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/StoreIndexedNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/TypeCheckNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/BasicInductionVariableNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/DerivedInductionVariableNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/InductionVariableNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/LinearInductionVariableNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/LoopCounterNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/CanonicalizerTool.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/EscapeField.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/EscapeOp.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/LIRGeneratorTool.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/Stamp.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/StampFactory.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/virtual/BoxedVirtualObjectNode.java graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/virtual/VirtualObjectNode.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/ArrayCopySnippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/GraalIntrinsics.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/IntrinsifyArrayCopyPhase.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/MathSnippetsX86.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/NodeClassSnippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/SystemSnippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/UnsafeSnippets.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/nodes/ArrayHeaderSizeNode.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/nodes/MathIntrinsicNode.java graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/target/amd64/AMD64MathIntrinsicOpcode.java graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/EscapeAnalysisTest.java graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/GraphTest.java src/share/vm/classfile/vmSymbols.hpp src/share/vm/graal/graalJavaAccess.hpp src/share/vm/graal/graalVMEntries.cpp
diffstat 327 files changed, 9747 insertions(+), 9769 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/AbstractAssembler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/AbstractAssembler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.asm;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiArchitecture.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiArchitecture.*;
 
 /**
  * The platform-independent base class for the assembler.
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.asm.target.amd64;
 
+import static com.oracle.max.cri.ci.CiKind.*;
+import static com.oracle.max.cri.ci.CiRegister.RegisterFlag.*;
 import static com.oracle.max.cri.util.MemoryBarriers.*;
-import static com.sun.cri.ci.CiKind.*;
-import static com.sun.cri.ci.CiRegister.RegisterFlag.*;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiRegister.*;
 
 /**
  * Represents the AMD64 architecture.
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,14 +22,14 @@
  */
 package com.oracle.max.asm.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
 import static com.oracle.max.asm.NumUtil.*;
 import static com.oracle.max.asm.target.amd64.AMD64.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static com.oracle.max.cri.util.MemoryBarriers.*;
 
 import com.oracle.max.asm.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 /**
  * This class implements an assembler that can encode most X86 instructions.
--- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -23,8 +23,8 @@
 package com.oracle.max.asm.target.amd64;
 
 import com.oracle.max.asm.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 /**
  * This class implements commonly used X86 code patterns.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiAddress.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,237 @@
+/*
+ * 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.max.cri.ci;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+
+/**
+ * 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 {@link CiVariable variable}, that is as yet
+ * unassigned to target machine registers.
+ */
+public final class CiAddress extends CiValue {
+    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(CiKind.Illegal, CiValue.IllegalValue);
+
+    /**
+     * Base register that defines the start of the address computation; always present.
+     */
+    public final CiValue base;
+    /**
+     * Optional index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}.
+     * If not present, is denoted by {@link CiValue#IllegalValue}.
+     */
+    public final CiValue 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(CiKind kind, CiValue 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(CiKind kind, CiValue base, int displacement) {
+        this(kind, base, IllegalValue, Scale.Times1, displacement);
+    }
+
+    /**
+     * Creates a {@code CiAddress} with given base and offset registers, no scaling and no displacement.
+     * @param kind the kind of the value being addressed
+     * @param base the base register
+     * @param offset the offset register
+     */
+    public CiAddress(CiKind kind, CiValue base, CiValue offset) {
+        this(kind, base, offset, Scale.Times1, 0);
+    }
+
+    /**
+     * 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(CiKind kind, CiValue base, CiValue index, Scale scale, int displacement) {
+        super(kind);
+
+        this.base = base;
+        if (isConstant(index)) {
+            long longIndex = ((CiConstant) index).asLong();
+            long longDisp = displacement + longIndex * scale.value;
+            if ((int) longIndex != longIndex || (int) longDisp != longDisp) {
+                throw new Error("integer overflow when computing constant displacement");
+            }
+            this.displacement = (int) longDisp;
+            this.index = IllegalValue;
+            this.scale = Scale.Times1;
+        } else {
+            assert isIllegal(base) || isVariable(base) || isRegister(base);
+            assert isIllegal(index) || isVariable(index) || isRegister(index);
+
+            this.index = index;
+            this.scale = scale;
+            this.displacement = displacement;
+        }
+    }
+
+    /**
+     * 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);
+
+        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) {
+            // Checkstyle: stop
+            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));
+            }
+            // Checkstyle: resume
+        }
+
+        public static Scale fromShift(int shift) {
+            return fromInt(1 << shift);
+        }
+    }
+
+    /**
+     * Encodes the possible addressing modes as a simple value.
+     */
+    public enum Format {
+        BASE,
+        BASE_DISP,
+        BASE_INDEX,
+        BASE_INDEX_DISP,
+        PLACEHOLDER;
+    }
+
+    /**
+     * Returns the {@link Format encoded addressing mode} that this {@code CiAddress} represents.
+     * @return the encoded addressing mode
+     */
+    public Format format() {
+        if (this == Placeholder) {
+            return Format.PLACEHOLDER;
+        }
+        assert isLegal(base);
+        if (isLegal(index)) {
+            if (displacement != 0) {
+                return Format.BASE_INDEX_DISP;
+            } else {
+                return Format.BASE_INDEX;
+            }
+        } else {
+            if (displacement != 0) {
+                return Format.BASE_DISP;
+            } else {
+                return Format.BASE;
+            }
+        }
+    }
+
+    private static String s(CiValue location) {
+        if (isRegister(location)) {
+            return asRegister(location).name;
+        }
+        assert isVariable(location);
+        return "v" + ((CiVariable) location).index;
+    }
+
+    private static String signed(int i) {
+        if (i >= 0) {
+            return "+" + i;
+        }
+        return String.valueOf(i);
+    }
+
+    @Override
+    public String toString() {
+        // Checkstyle: stop
+        switch (format()) {
+            case BASE            : return "[" + s(base) + kindSuffix() + "]";
+            case BASE_DISP       : return "[" + s(base) + signed(displacement) + kindSuffix() + "]";
+            case BASE_INDEX      : return "[" + s(base) + "+" + s(index) + kindSuffix() + "]";
+            case BASE_INDEX_DISP : return "[" + s(base) + "+(" + s(index) + "*" + scale.value + ")" + signed(displacement) + kindSuffix() + "]";
+            case PLACEHOLDER     : return "[<placeholder>]";
+            default              : throw new IllegalArgumentException("unknown format: " + format());
+        }
+        // Checkstyle: resume
+    }
+
+    @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() << 4) | kind.ordinal();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiArchitecture.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.CiRegister.*;
+import com.oracle.max.cri.util.*;
+
+
+/**
+ * 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;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiAssumptions.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+import java.util.*;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * 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 RiResolvedType context;
+
+        /**
+         * Assumed unique concrete sub-type of the context type.
+         */
+        public final RiResolvedType subtype;
+
+        public ConcreteSubtype(RiResolvedType context, RiResolvedType 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 RiResolvedMethod method;
+
+        /**
+         * A receiver type.
+         */
+        public final RiResolvedType context;
+
+        /**
+         * The unique implementation of {@link #method} for {@link #context}.
+         */
+        public final RiResolvedMethod impl;
+
+        public ConcreteMethod(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod 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;
+        }
+    }
+
+    /**
+     * 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(RiResolvedType receiverType) {
+        // TODO(tw): 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(RiResolvedType context, RiResolvedType 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(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl) {
+        record(new ConcreteMethod(method, context, impl));
+    }
+
+    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.max.cri/src/com/oracle/max/cri/ci/CiBailout.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ci;
+
+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);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiBitMap.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,682 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Implements a bitmap that stores a single bit for a range of integers (0-n).
+ */
+public final class CiBitMap implements Serializable {
+
+    private static final long serialVersionUID = 2471441272241401105L;
+    private static final int ADDRESS_BITS_PER_WORD = 6;
+    private static final int BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;
+    private static final int BIT_INDEX_MASK = BITS_PER_WORD - 1;
+
+    public static final int DEFAULT_LENGTH = BITS_PER_WORD;
+
+    public static int roundUpLength(int length) {
+        return ((length + (BITS_PER_WORD - 1)) >> ADDRESS_BITS_PER_WORD) << ADDRESS_BITS_PER_WORD;
+    }
+
+    private int size;
+    private long low;
+    private long[] extra;
+
+    /**
+     * Constructs a new bit map with the {@linkplain #DEFAULT_LENGTH default length}.
+     */
+    public CiBitMap() {
+        this(DEFAULT_LENGTH);
+    }
+
+    /**
+     * Constructs a new bit map from a byte array encoded bit map.
+     *
+     * @param bitmap the bit map to convert
+     */
+    public CiBitMap(byte[] bitmap) {
+        this(bitmap, 0, bitmap.length);
+    }
+
+    /**
+     * Constructs a copy of the given bit map.
+     *
+     * @param bitmap the bit map to copy.
+     */
+    public CiBitMap(CiBitMap bitmap) {
+        this.size = bitmap.size;
+        this.low = bitmap.low;
+        if (bitmap.extra != null) {
+            this.extra = Arrays.copyOf(bitmap.extra, bitmap.extra.length);
+        }
+    }
+
+    /**
+     * Constructs a new bit map from a byte array encoded bit map.
+     *
+     * @param arr the byte array containing the bit map to convert
+     * @param off the byte index in {@code arr} at which the bit map starts
+     * @param numberOfBytes the number of bytes worth of bits to copy from {@code arr}
+     */
+    public CiBitMap(byte[] arr, int off, int numberOfBytes) {
+        this(numberOfBytes * 8);
+        int byteIndex = off;
+        int end = off + numberOfBytes;
+        assert end <= arr.length;
+        while (byteIndex < end && (byteIndex - off) < 8) {
+            long bite = (long) arr[byteIndex] & 0xff;
+            low |= bite << ((byteIndex - off) * 8);
+            byteIndex++;
+        }
+        if (byteIndex < end) {
+            assert (byteIndex - off) == 8;
+            int remBytes = end - byteIndex;
+            int remWords = (remBytes + 7) / 8;
+            for (int word = 0; word < remWords; word++) {
+                long w = 0L;
+                for (int i = 0; i < 8 && byteIndex < end; i++) {
+                    long bite = (long) arr[byteIndex] & 0xff;
+                    w |= bite << (i * 8);
+                    byteIndex++;
+                }
+                extra[word] = w;
+            }
+        }
+    }
+
+    /**
+     * Converts a {@code long} to a {@link CiBitMap}.
+     */
+    public static CiBitMap fromLong(long bitmap) {
+        CiBitMap bm = new CiBitMap(64);
+        bm.low = bitmap;
+        return bm;
+    }
+
+    /**
+     * Constructs a new bit map with the specified length.
+     *
+     * @param length the length of the bitmap
+     */
+    public CiBitMap(int length) {
+        assert length >= 0;
+        this.size = length;
+        if (length > BITS_PER_WORD) {
+            extra = new long[length >> ADDRESS_BITS_PER_WORD];
+        }
+    }
+
+    /**
+     * Sets the bit at the specified index.
+     *
+     * @param i the index of the bit to set
+     */
+    public void set(int i) {
+        if (checkIndex(i) < BITS_PER_WORD) {
+            low |= 1L << i;
+        } else {
+            int pos = wordIndex(i);
+            int index = bitInWord(i);
+            extra[pos] |= 1L << index;
+        }
+    }
+
+    /**
+     * Grows this bitmap to a new size, appending necessary zero bits.
+     *
+     * @param newLength the new length of the bitmap
+     */
+    public void grow(int newLength) {
+        if (newLength > size) {
+            // grow this bitmap to the new length
+            int newSize = newLength >> ADDRESS_BITS_PER_WORD;
+            if (newLength > 0) {
+                if (extra == null) {
+                    // extra just needs to be allocated now
+                    extra = new long[newSize];
+                } else {
+                    if (extra.length < newSize) {
+                        // extra needs to be copied
+                        long[] newExtra = new long[newSize];
+                        for (int i = 0; i < extra.length; i++) {
+                            newExtra[i] = extra[i];
+                        }
+                        extra = newExtra;
+                    } else {
+                        // nothing to do, extra is already the right size
+                    }
+                }
+            }
+            size = newLength;
+        }
+    }
+
+    private static int bitInWord(int i) {
+        return i & BIT_INDEX_MASK;
+    }
+
+    private static int wordIndex(int i) {
+        return (i >> ADDRESS_BITS_PER_WORD) - 1;
+    }
+
+    /**
+     * Clears the bit at the specified index.
+     * @param i the index of the bit to clear
+     */
+    public void clear(int i) {
+        if (checkIndex(i) < BITS_PER_WORD) {
+            low &= ~(1L << i);
+        } else {
+            int pos = wordIndex(i);
+            int index = bitInWord(i);
+            extra[pos] &= ~(1L << index);
+        }
+    }
+
+    /**
+     * Sets all the bits in this bitmap.
+     */
+    public void setAll() {
+        low = -1;
+        if (extra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                extra[i] = -1;
+            }
+        }
+    }
+
+    /**
+     * Clears all the bits in this bitmap.
+     */
+    public void clearAll() {
+        low = 0;
+        if (extra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                extra[i] = 0;
+            }
+        }
+    }
+
+    /**
+     * Gets the value of the bit at the specified index.
+     *
+     * @param i the index of the bit to get
+     * @return {@code true} if the bit at the specified position is {@code 1}
+     */
+    public boolean get(int i) {
+        if (checkIndex(i) < BITS_PER_WORD) {
+            return ((low >> i) & 1) != 0;
+        }
+        int pos = wordIndex(i);
+        int index = bitInWord(i);
+        long bits = extra[pos];
+        return ((bits >> index) & 1) != 0;
+    }
+
+    /**
+     * Gets the value of the bit at the specified index, returning {@code false} if the
+     * bitmap does not cover the specified index.
+     *
+     * @param i the index of the bit to get
+     * @return {@code true} if the bit at the specified position is {@code 1}
+     */
+    public boolean getDefault(int i) {
+        if (i < 0 || i >= size) {
+            return false;
+        }
+        if (i < BITS_PER_WORD) {
+            return ((low >> i) & 1) != 0;
+        }
+        int pos = wordIndex(i);
+        int index = bitInWord(i);
+        long bits = extra[pos];
+        return ((bits >> index) & 1) != 0;
+    }
+
+    /**
+     * Performs the union operation on this bitmap with the specified bitmap. That is, all bits set in either of the two
+     * bitmaps will be set in this bitmap following this operation.
+     *
+     * @param other the other bitmap for the union operation
+     */
+    public void setUnion(CiBitMap other) {
+        low |= other.low;
+        if (extra != null && other.extra != null) {
+            for (int i = 0; i < extra.length && i < other.extra.length; i++) {
+                extra[i] |= other.extra[i];
+            }
+        }
+    }
+
+    /**
+     * Performs the union operation on this bitmap with the specified bitmap. That is, a bit is set in this
+     * bitmap if and only if it is set in both this bitmap and the specified bitmap.
+     *
+     * @param other the other bitmap for this operation
+     * @return {@code true} if any bits were cleared as a result of this operation
+     */
+    public boolean setIntersect(CiBitMap other) {
+        boolean same = true;
+        long intx = low & other.low;
+        if (low != intx) {
+            same = false;
+            low = intx;
+        }
+        long[] oxtra = other.extra;
+        if (extra != null && oxtra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                long a = extra[i];
+                if (i < oxtra.length) {
+                    // zero bits out of this map
+                    long ax = a & oxtra[i];
+                    if (a != ax) {
+                        same = false;
+                        extra[i] = ax;
+                    }
+                } else {
+                    // this bitmap is larger than the specified bitmap; zero remaining bits
+                    if (a != 0) {
+                        same = false;
+                        extra[i] = 0;
+                    }
+                }
+            }
+        }
+        return !same;
+    }
+
+    /**
+     * Gets the number of addressable bits in this bitmap.
+     *
+     * @return the size of this bitmap
+     */
+    public int size() {
+        return size;
+    }
+
+    private int checkIndex(int i) {
+        if (i < 0 || i >= size) {
+            throw new IndexOutOfBoundsException();
+        }
+        return i;
+    }
+
+    public void setFrom(CiBitMap other) {
+        assert this.size == other.size : "must have same size";
+
+        low = other.low;
+        if (extra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                extra[i] = other.extra[i];
+            }
+        }
+    }
+
+    public void setDifference(CiBitMap other) {
+        assert this.size == other.size : "must have same size";
+
+        low &= ~other.low;
+        if (extra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                extra[i] &= ~other.extra[i];
+            }
+        }
+    }
+
+    public boolean isSame(CiBitMap other) {
+        if (this.size != other.size || this.low != other.low) {
+            return false;
+        }
+
+        if (extra != null) {
+            for (int i = 0; i < extra.length; i++) {
+                if (extra[i] != other.extra[i]) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Returns the index of the first set bit that occurs on or after a specified start index.
+     * If no such bit exists then -1 is returned.
+     * <p>
+     * To iterate over the set bits in a {@code BitMap}, use the following loop:
+     *
+     * <pre>
+     * for (int i = bitMap.nextSetBit(0); i &gt;= 0; i = bitMap.nextSetBit(i + 1)) {
+     *     // operate on index i here
+     * }
+     * </pre>
+     *
+     * @param fromIndex the index to start checking from (inclusive)
+     * @return the index of the lowest set bit between {@code [fromIndex .. size())} or -1 if there is no set bit in this range
+     * @throws IndexOutOfBoundsException if the specified index is negative.
+     */
+    public int nextSetBit(int fromIndex) {
+        return nextSetBit(fromIndex, size());
+    }
+
+    /**
+     * Returns the index of the first set bit that occurs on or after a specified start index
+     * and before a specified end index. If no such bit exists then -1 is returned.
+     * <p>
+     * To iterate over the set bits in a {@code BitMap}, use the following loop:
+     *
+     * <pre>
+     * for (int i = bitMap.nextSetBit(0, bitMap.size()); i &gt;= 0; i = bitMap.nextSetBit(i + 1, bitMap.size())) {
+     *     // operate on index i here
+     * }
+     * </pre>
+     *
+     * @param fromIndex the index to start checking from (inclusive)
+     * @param toIndex the index at which to stop checking (exclusive)
+     * @return the index of the lowest set bit between {@code [fromIndex .. toIndex)} or -1 if there is no set bit in this range
+     * @throws IndexOutOfBoundsException if the specified index is negative.
+     */
+    public int nextSetBit(int fromIndex, int toIndex) {
+        assert fromIndex <= size() : "index out of bounds";
+        assert toIndex <= size() : "index out of bounds";
+        assert fromIndex <= toIndex : "fromIndex > toIndex";
+
+        if (fromIndex == toIndex) {
+            return -1;
+        }
+        int fromWordIndex = wordIndex(fromIndex);
+        int toWordIndex = wordIndex(toIndex - 1) + 1;
+        int resultIndex = fromIndex;
+
+        // check bits including and to the left_ of offset's position
+        int pos = bitInWord(resultIndex);
+        long res = map(fromWordIndex) >> pos;
+        if (res != 0) {
+            resultIndex += Long.numberOfTrailingZeros(res);
+            assert resultIndex >= fromIndex && resultIndex < toIndex : "just checking";
+            if (resultIndex < toIndex) {
+                return resultIndex;
+            }
+            return -1;
+        }
+        // skip over all word length 0-bit runs
+        for (fromWordIndex++; fromWordIndex < toWordIndex; fromWordIndex++) {
+            res = map(fromWordIndex);
+            if (res != 0) {
+                // found a 1, return the offset
+                resultIndex = bitIndex(fromWordIndex) + Long.numberOfTrailingZeros(res);
+                assert resultIndex >= fromIndex : "just checking";
+                if (resultIndex < toIndex) {
+                    return resultIndex;
+                }
+                return -1;
+            }
+        }
+        return -1;
+    }
+
+    private static int bitIndex(int index) {
+        return (index + 1) << ADDRESS_BITS_PER_WORD;
+    }
+
+    private long map(int index) {
+        if (index == -1) {
+            return low;
+        }
+        return extra[index];
+    }
+
+    private static boolean allZeros(int start, long[] arr) {
+        for (int i = start; i < arr.length; i++) {
+            if (arr[i] != 0) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Compares this object against the specified object.
+     * The result is {@code true} if and only if {@code obj} is
+     * not {@code null} and is a {@code CiBitMap} object that has
+     * exactly the same set of bits set to {@code true} as this bit
+     * set.
+     *
+     * @param   obj   the object to compare with.
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof CiBitMap) {
+            CiBitMap bm = (CiBitMap) obj;
+            if (bm.low == low) {
+                if (bm.extra == null) {
+                    if (extra == null) {
+                        // Common case
+                        return true;
+                    }
+                    return allZeros(0, extra);
+                }
+                if (extra == null) {
+                    return allZeros(0, bm.extra);
+                }
+                // both 'extra' array non null:
+                int i = 0;
+                int length = Math.min(extra.length, bm.extra.length);
+                while (i < length) {
+                    if (extra[i] != bm.extra[i]) {
+                        return false;
+                    }
+                    i++;
+                }
+                if (extra.length > bm.extra.length) {
+                    return allZeros(length, extra);
+                }
+                if (extra.length < bm.extra.length) {
+                    return allZeros(length, bm.extra);
+                }
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return (int) low ^ size;
+    }
+
+    /**
+     * Returns a string representation of this bit map
+     * that is the same as the string returned by {@link BitSet#toString()}
+     * for a bit set with the same bits set as this bit map.
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder(size * 2);
+        sb.append('{');
+
+        int bit = nextSetBit(0);
+        if (bit != -1) {
+            sb.append(bit);
+            for (bit = nextSetBit(bit + 1); bit >= 0; bit = nextSetBit(bit + 1)) {
+                sb.append(", ").append(bit);
+            }
+        }
+
+        sb.append('}');
+        return sb.toString();
+    }
+
+    public static int highestOneBitIndex(long value) {
+        int bit = Long.numberOfTrailingZeros(Long.highestOneBit(value));
+        if (bit == 64) {
+            return -1;
+        }
+        return bit;
+    }
+
+    /**
+     * Returns the number of bits set to {@code true} in this bit map.
+     */
+    public int cardinality() {
+        int sum = Long.bitCount(low);
+        if (extra != null) {
+            for (long word : extra) {
+                sum += Long.bitCount(word);
+            }
+        }
+        return sum;
+    }
+
+    /**
+     * Returns the "logical size" of this bit map: the index of
+     * the highest set bit in the bit map plus one. Returns zero
+     * if the bit map contains no set bits.
+     *
+     * @return  the logical size of this bit map
+     */
+    public int length() {
+        if (extra != null) {
+            for (int i = extra.length - 1; i >= 0; i--) {
+                if (extra[i] != 0) {
+                    return (highestOneBitIndex(extra[i]) + ((i + 1) * 64)) + 1;
+                }
+            }
+        }
+        return highestOneBitIndex(low) + 1;
+    }
+
+    /**
+     * Returns a string representation of this bit map with every set bit represented as {@code '1'}
+     * and every unset bit represented as {@code '0'}. The first character in the returned string represents
+     * bit 0 in this bit map.
+     *
+     * @param length the number of bits represented in the returned string. If {@code length < 0 || length > size()},
+     *            then the value of {@link #length()} is used.
+     */
+    public String toBinaryString() {
+        int length = length();
+        if (length == 0) {
+            return "";
+        }
+        StringBuilder sb = new StringBuilder(length);
+        for (int i = 0; i < length; ++i) {
+            sb.append(get(i) ? '1' : '0');
+        }
+        return sb.toString();
+    }
+
+    static final char[] hexDigits = {
+        '0', '1', '2', '3', '4', '5', '6', '7',
+        '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
+    };
+
+    /**
+     * Returns a string representation of this bit map in hex.
+     */
+    public String toHexString() {
+        if (size == 0) {
+            return "";
+        }
+        int hexSize = CiUtil.align(this.size, 4);
+        StringBuilder sb = new StringBuilder(hexSize / 4);
+        for (int i = 0; i < hexSize; i += 4) {
+            int nibble = get(i) ? 1 : 0;
+            if (get(i + 1)) {
+                nibble |= 2;
+            }
+            if (get(i + 2)) {
+                nibble |= 4;
+            }
+            if (get(i + 3)) {
+                nibble |= 8;
+            }
+
+            sb.append(hexDigits[nibble]);
+        }
+        return sb.toString();
+    }
+
+    public CiBitMap copy() {
+        CiBitMap n = new CiBitMap(BITS_PER_WORD);
+        n.low = low;
+        if (extra != null) {
+            n.extra = Arrays.copyOf(extra, extra.length);
+        }
+        n.size = size;
+        return n;
+    }
+
+    /**
+     * Copies this bit map into a given byte array.
+     *
+     * @param arr the destination
+     * @param off the byte index in {@code arr} at which to start writing
+     * @param numberOfBytes the number of bytes worth of bits to copy from this bit map.
+     *        The number of bits copied is {@code numberOfBytes * 8}. If {@code numberOfBytes}
+     *        is -1, then {@code ((size() + 7) / 8)} is used instead.
+     * @return the number of bytes written to {@code arr}
+     */
+    public int copyTo(byte[] arr, int off, int numberOfBytes) {
+        for (int i = 0; i < numberOfBytes; ++i) {
+            long word = low;
+            int byteInWord;
+            if (i >= 8) {
+                int wordIndex = (i - 8) / 8;
+                word = extra[wordIndex];
+                byteInWord = i & 0x7;
+            } else {
+                byteInWord = i;
+            }
+            assert byteInWord < 8;
+            byte b = (byte) (word >> (byteInWord * 8));
+            arr[off + i] = b;
+        }
+        return numberOfBytes;
+    }
+
+    /**
+     * Converts this bit map to a byte array. The length of the returned
+     * byte array is {@code ((size() + 7) / 8)}.
+     */
+    public byte[] toByteArray() {
+        byte[] arr = new byte[(size + 7) / 8];
+        copyTo(arr, 0, arr.length);
+        return arr;
+    }
+
+    /**
+     * Converts this bit map to a long.
+     *
+     * @throws IllegalArgumentException if {@code (size() > 64)}
+     */
+    public long toLong() {
+        if (size > 64) {
+            throw new IllegalArgumentException("bit map of size " + size + " cannot be converted to long");
+        }
+        return low;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCalleeSaveLayout.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ci;
+
+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();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCallingConvention.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ci;
+
+import static com.oracle.max.cri.ci.CiValueUtil.*;
+
+import com.oracle.max.cri.ri.*;
+
+
+/**
+ * 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 RiRegisterConfig#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 CiValue[] locations;
+
+    public CiCallingConvention(CiValue[] locations, int stackSize) {
+        this.locations = locations;
+        this.stackSize = stackSize;
+        assert verify();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder result = new StringBuilder();
+        result.append("CallingConvention[");
+        for (CiValue op : locations) {
+            result.append(op.toString()).append(" ");
+        }
+        result.append("]");
+        return result.toString();
+    }
+
+    private boolean verify() {
+        for (int i = 0; i < locations.length; i++) {
+            CiValue location = locations[i];
+            assert isStackSlot(location) || isRegister(location);
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCodePos.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * 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 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 RiResolvedMethod 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, RiResolvedMethod 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;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiCompiler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import com.oracle.max.cri.ri.*;
+
+public interface CiCompiler {
+
+    /**
+     * Denotes the level of debug info for safepoints that should be generated by a compilation.
+     */
+    enum DebugInfoLevel {
+        /**
+         * Only ref maps are required.
+         */
+        REF_MAPS,
+
+        /**
+         * Code positions and ref maps are required.
+         */
+        CODE_POS_AND_REF_MAPS,
+
+        /**
+         * Frame info, code positions and ref maps are required.
+         * Only a compilation with level can make speculative optimizations.
+         */
+        FULL
+    }
+
+    /**
+     * Compile the specified method.
+     *
+     * @param method the method to compile
+     * @param osrBCI the bytecode index of the entrypoint for an on-stack-replacement or {@code -1} if this is not an
+     *            on-stack-replacement compilation
+     * @param debugInfoLevel TODO
+     */
+    CiResult compileMethod(RiResolvedMethod method, int osrBCI, CiStatistics stats, DebugInfoLevel debugInfoLevel);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiConstant.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,496 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+/**
+ * Represents a constant (boxed) value, such as an integer, floating point number, or object reference,
+ * within the compiler and across the compiler/runtime interface. Exports a set of {@code CiConstant}
+ * instances that represent frequently used constant values, such as {@link #ZERO}.
+ */
+public final class CiConstant extends CiValue {
+    private static final long serialVersionUID = -6355452536852663986L;
+
+    private static final CiConstant[] INT_CONSTANT_CACHE = new CiConstant[100];
+    static {
+        for (int i = 0; i < INT_CONSTANT_CACHE.length; ++i) {
+            INT_CONSTANT_CACHE[i] = new CiConstant(CiKind.Int, i);
+        }
+    }
+
+    public static final CiConstant NULL_OBJECT = new CiConstant(CiKind.Object, null);
+    public static final CiConstant INT_MINUS_1 = new CiConstant(CiKind.Int, -1);
+    public static final CiConstant INT_0 = forInt(0);
+    public static final CiConstant INT_1 = forInt(1);
+    public static final CiConstant INT_2 = forInt(2);
+    public static final CiConstant INT_3 = forInt(3);
+    public static final CiConstant INT_4 = forInt(4);
+    public static final CiConstant INT_5 = forInt(5);
+    public static final CiConstant LONG_0 = new CiConstant(CiKind.Long, 0L);
+    public static final CiConstant LONG_1 = new CiConstant(CiKind.Long, 1L);
+    public static final CiConstant FLOAT_0 = new CiConstant(CiKind.Float, Float.floatToRawIntBits(0.0F));
+    public static final CiConstant FLOAT_1 = new CiConstant(CiKind.Float, Float.floatToRawIntBits(1.0F));
+    public static final CiConstant FLOAT_2 = new CiConstant(CiKind.Float, Float.floatToRawIntBits(2.0F));
+    public static final CiConstant DOUBLE_0 = new CiConstant(CiKind.Double, Double.doubleToRawLongBits(0.0D));
+    public static final CiConstant DOUBLE_1 = new CiConstant(CiKind.Double, Double.doubleToRawLongBits(1.0D));
+    public static final CiConstant TRUE = new CiConstant(CiKind.Boolean, 1L);
+    public static final CiConstant FALSE = new CiConstant(CiKind.Boolean, 0L);
+
+    static {
+        assert NULL_OBJECT.isDefaultValue();
+        assert INT_0.isDefaultValue();
+        assert FLOAT_0.isDefaultValue();
+        assert DOUBLE_0.isDefaultValue();
+        assert FALSE.isDefaultValue();
+
+        // Ensure difference between 0.0f and -0.0f is preserved
+        assert FLOAT_0 != forFloat(-0.0F);
+        assert !forFloat(-0.0F).isDefaultValue();
+
+        // Ensure difference between 0.0d and -0.0d is preserved
+        assert DOUBLE_0 != forDouble(-0.0d);
+        assert !forDouble(-0.0D).isDefaultValue();
+
+        assert NULL_OBJECT.isNull();
+    }
+
+    /**
+     * The boxed object value. This is ignored iff {@code !kind.isObject()}.
+     */
+    private final Object object;
+
+    /**
+     * The boxed primitive value as a {@code long}. This is ignored iff {@code kind.isObject()}.
+     * For {@code float} and {@code double} values, this value is the result of
+     * {@link Float#floatToRawIntBits(float)} and {@link Double#doubleToRawLongBits(double)} respectively.
+     */
+    private final long primitive;
+
+    /**
+     * Create a new constant represented by the specified object reference.
+     *
+     * @param kind the type of this constant
+     * @param object the value of this constant
+     */
+    private CiConstant(CiKind kind, Object object) {
+        super(kind);
+        this.object = object;
+        this.primitive = 0L;
+    }
+
+    /**
+     * Create a new constant represented by the specified primitive.
+     *
+     * @param kind the type of this constant
+     * @param primitive the value of this constant
+     */
+    public CiConstant(CiKind kind, long primitive) {
+        super(kind);
+        this.object = null;
+        this.primitive = primitive;
+    }
+
+    /**
+     * Checks whether this constant is non-null.
+     * @return {@code true} if this constant is a primitive, or an object constant that is not null
+     */
+    public boolean isNonNull() {
+        return !kind.isObject() || object != null;
+    }
+
+    /**
+     * Checks whether this constant is null.
+     * @return {@code true} if this constant is the null constant
+     */
+    public boolean isNull() {
+        return kind.isObject() && object == null;
+    }
+
+    @Override
+    public String toString() {
+        return kind.javaName + "[" + kind.format(boxedValue()) + (kind != CiKind.Object ? "|0x" + Long.toHexString(primitive) : "") + "]";
+    }
+
+    /**
+     * Gets this constant's value as a string.
+     *
+     * @return this constant's value as a string
+     */
+    public String valueString() {
+        if (kind.isPrimitive()) {
+            return boxedValue().toString();
+        } else if (kind.isObject()) {
+            if (object == null) {
+                return "null";
+            } else if (object instanceof String) {
+                return "\"" + object + "\"";
+            } else {
+                return "<object: " + kind.format(object) + ">";
+            }
+        } else if (kind.isJsr()) {
+            return "bci:" + boxedValue().toString();
+        } else {
+            return "???";
+        }
+    }
+
+    /**
+     * Returns the value of this constant as a boxed Java value.
+     * @return the value of this constant
+     */
+    public Object boxedValue() {
+        // Checkstyle: stop
+        switch (kind) {
+            case Byte: return (byte) asInt();
+            case Boolean: return asInt() == 0 ? Boolean.FALSE : Boolean.TRUE;
+            case Short: return (short) asInt();
+            case Char: return (char) asInt();
+            case Jsr: return (int) primitive;
+            case Int: return asInt();
+            case Long: return asLong();
+            case Float: return asFloat();
+            case Double: return asDouble();
+            case Object: return object;
+        }
+        // Checkstyle: resume
+        throw new IllegalArgumentException();
+    }
+
+    private boolean valueEqual(CiConstant other, boolean ignoreKind) {
+        // must have equivalent kinds to be equal
+        if (!ignoreKind && kind != other.kind) {
+            return false;
+        }
+        if (kind.isObject()) {
+            return object == other.object;
+        }
+        return primitive == other.primitive;
+    }
+
+    /**
+     * Converts this constant to a primitive int.
+     * @return the int value of this constant
+     */
+    public int asInt() {
+        if (kind.stackKind().isInt() || kind.isJsr()) {
+            return (int) primitive;
+        }
+        throw new Error("Constant is not int: " + this);
+    }
+
+    /**
+     * Converts this constant to a primitive boolean.
+     * @return the boolean value of this constant
+     */
+    public boolean asBoolean() {
+        if (kind == CiKind.Boolean) {
+            return primitive != 0L;
+        }
+        throw new Error("Constant is not boolean: " + this);
+    }
+
+    /**
+     * Converts this constant to a primitive long.
+     * @return the long value of this constant
+     */
+    public long asLong() {
+        // Checkstyle: stop
+        switch (kind.stackKind()) {
+            case Jsr:
+            case Int:
+            case Long: return primitive;
+            case Float: return (long) asFloat();
+            case Double: return (long) asDouble();
+            default: throw new Error("Constant is not long: " + this);
+        }
+        // Checkstyle: resume
+    }
+
+    /**
+     * Converts this constant to a primitive float.
+     * @return the float value of this constant
+     */
+    public float asFloat() {
+        if (kind.isFloat()) {
+            return Float.intBitsToFloat((int) primitive);
+        }
+        throw new Error("Constant is not float: " + this);
+    }
+
+    /**
+     * Converts this constant to a primitive double.
+     * @return the double value of this constant
+     */
+    public double asDouble() {
+        if (kind.isFloat()) {
+            return Float.intBitsToFloat((int) primitive);
+        }
+        if (kind.isDouble()) {
+            return Double.longBitsToDouble(primitive);
+        }
+        throw new Error("Constant is not double: " + this);
+    }
+
+    /**
+     * Converts this constant to the object reference it represents.
+     * @return the object which this constant represents
+     */
+    public Object asObject() {
+        if (kind.isObject()) {
+            return object;
+        }
+        throw new Error("Constant is not object: " + this);
+    }
+
+    /**
+     * Converts this constant to the jsr reference it represents.
+     * @return the object which this constant represents
+     */
+    public int asJsr() {
+        if (kind.isJsr()) {
+            return (int) primitive;
+        }
+        throw new Error("Constant is not jsr: " + this);
+    }
+
+    /**
+     * Unchecked access to a primitive value.
+     * @return
+     */
+    public long asPrimitive() {
+        if (kind.isObject()) {
+            throw new Error("Constant is not primitive: " + this);
+        }
+        return primitive;
+    }
+
+    /**
+     * Computes the hashcode of this constant.
+     * @return a suitable hashcode for this constant
+     */
+    @Override
+    public int hashCode() {
+        if (kind.isObject()) {
+            return System.identityHashCode(object);
+        }
+        return (int) primitive;
+    }
+
+    /**
+     * Checks whether this constant equals another object. This is only
+     * true if the other object is a constant and has the same value.
+     * @param o the object to compare equality
+     * @return {@code true} if this constant is equivalent to the specified object
+     */
+    @Override
+    public boolean equals(Object o) {
+        return o == this || o instanceof CiConstant && valueEqual((CiConstant) o, false);
+    }
+
+    /**
+     * Checks whether this constant is identical to another constant or has the same value as it.
+     * @param other the constant to compare for equality against this constant
+     * @return {@code true} if this constant is equivalent to {@code other}
+     */
+    public boolean equivalent(CiConstant other) {
+        return other == this || valueEqual(other, false);
+    }
+
+    /**
+     * Checks whether this constant is the default value for its type.
+     * @return {@code true} if the value is the default value for its type; {@code false} otherwise
+     */
+    public boolean isDefaultValue() {
+        // Checkstyle: stop
+        switch (kind.stackKind()) {
+            case Int: return asInt() == 0;
+            case Long: return asLong() == 0;
+            case Float: return this == FLOAT_0;
+            case Double: return this == DOUBLE_0;
+            case Object: return object == null;
+        }
+        // Checkstyle: resume
+        throw new IllegalArgumentException("Cannot det default CiConstant for kind " + kind);
+    }
+
+    /**
+     * Gets the default value for a given kind.
+     *
+     * @return the default value for {@code kind}'s {@linkplain CiKind#stackKind() stack kind}
+     */
+    public static CiConstant defaultValue(CiKind kind) {
+        // Checkstyle: stop
+        switch (kind.stackKind()) {
+            case Int: return INT_0;
+            case Long: return LONG_0;
+            case Float: return FLOAT_0;
+            case Double: return DOUBLE_0;
+            case Object: return NULL_OBJECT;
+        }
+        // Checkstyle: resume
+        throw new IllegalArgumentException("Cannot get default CiConstant for kind " + kind);
+    }
+
+    /**
+     * Creates a boxed double constant.
+     * @param d the double value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forDouble(double d) {
+        if (Double.compare(0.0D, d) == 0) {
+            return DOUBLE_0;
+        }
+        if (Double.compare(d, 1.0D) == 0) {
+            return DOUBLE_1;
+        }
+        return new CiConstant(CiKind.Double, Double.doubleToRawLongBits(d));
+    }
+
+    /**
+     * Creates a boxed float constant.
+     * @param f the float value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forFloat(float f) {
+        if (Float.compare(f, 0.0F) == 0) {
+            return FLOAT_0;
+        }
+        if (Float.compare(f, 1.0F) == 0) {
+            return FLOAT_1;
+        }
+        if (Float.compare(f, 2.0F) == 0) {
+            return FLOAT_2;
+        }
+        return new CiConstant(CiKind.Float, Float.floatToRawIntBits(f));
+    }
+
+    /**
+     * Creates a boxed long constant.
+     * @param i the long value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forLong(long i) {
+        return i == 0 ? LONG_0 : i == 1 ? LONG_1 : new CiConstant(CiKind.Long, i);
+    }
+
+    /**
+     * Creates a boxed integer constant.
+     * @param i the integer value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forInt(int i) {
+        if (i == -1) {
+            return INT_MINUS_1;
+        }
+        if (i >= 0 && i < INT_CONSTANT_CACHE.length) {
+            return INT_CONSTANT_CACHE[i];
+        }
+        return new CiConstant(CiKind.Int, i);
+    }
+
+    /**
+     * Creates a boxed byte constant.
+     * @param i the byte value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forByte(byte i) {
+        return new CiConstant(CiKind.Byte, i);
+    }
+
+    /**
+     * Creates a boxed boolean constant.
+     * @param i the boolean value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forBoolean(boolean i) {
+        return i ? TRUE : FALSE;
+    }
+
+    /**
+     * Creates a boxed char constant.
+     * @param i the char value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forChar(char i) {
+        return new CiConstant(CiKind.Char, i);
+    }
+
+    /**
+     * Creates a boxed short constant.
+     * @param i the short value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forShort(short i) {
+        return new CiConstant(CiKind.Short, i);
+    }
+
+    /**
+     * Creates a boxed address (jsr/ret address) constant.
+     * @param i the address value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forJsr(int i) {
+        return new CiConstant(CiKind.Jsr, i);
+    }
+
+    /**
+     * Creates a boxed object constant.
+     * @param o the object value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static CiConstant forObject(Object o) {
+        if (o == null) {
+            return NULL_OBJECT;
+        }
+        return new CiConstant(CiKind.Object, o);
+    }
+
+    /**
+     * Creates a boxed constant for the given kind from an Object.
+     * The object needs to be of the Java boxed type corresponding to the kind.
+     * @param kind the kind of the constant to create
+     * @param value the Java boxed value: a Byte instance for CiKind Byte, etc.
+     * @return the boxed copy of {@code value}
+     */
+    public static CiConstant forBoxed(CiKind kind, Object value) {
+        switch (kind) {
+            case Byte:
+                return forByte((Byte) value);
+            case Char:
+                return forChar((Character) value);
+            case Short:
+                return forShort((Short) value);
+            case Int:
+                return forInt((Integer) value);
+            case Long:
+                return forLong((Long) value);
+            case Float:
+                return forFloat((Float) value);
+            case Double:
+                return forDouble((Double) value);
+            case Object:
+                return forObject(value);
+            default:
+                throw new RuntimeException("cannot create CiConstant for boxed " + kind + " value");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiDebugInfo.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+
+/**
+ * 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 CiBitMap 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 CiBitMap 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, CiBitMap registerRefMap, CiBitMap 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();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiExceptionHandler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * An implementation of the {@link RiExceptionHandler} interface.
+ */
+public class CiExceptionHandler implements RiExceptionHandler {
+
+    public static final CiExceptionHandler[] NONE = {};
+
+    public final int startBCI;
+    public final int endBCI;
+    public final int handlerBCI;
+    public final int catchTypeCPI;
+    public final RiType catchType;
+
+    /**
+     * Creates a new exception handler with the specified ranges.
+     * @param startBCI the start index of the protected range
+     * @param endBCI the end index of the protected range
+     * @param catchBCI the index of the handler
+     * @param catchTypeCPI the index of the throwable class in the constant pool
+     * @param catchType the type caught by this exception handler
+     */
+    public CiExceptionHandler(int startBCI, int endBCI, int catchBCI, int catchTypeCPI, RiType catchType) {
+        this.startBCI = startBCI;
+        this.endBCI = endBCI;
+        this.handlerBCI = catchBCI;
+        this.catchTypeCPI = catchTypeCPI;
+        this.catchType = catchType;
+    }
+
+    public int startBCI() {
+        return startBCI;
+    }
+
+    public int endBCI() {
+        return endBCI;
+    }
+
+    public int handlerBCI() {
+        return handlerBCI;
+    }
+
+    public int catchTypeCPI() {
+        return catchTypeCPI;
+    }
+
+    public boolean isCatchAll() {
+        return catchTypeCPI == 0;
+    }
+
+    public RiType catchType() {
+        return catchType;
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuilder(20).
+            append('[').
+            append(startBCI).
+            append(" - ").
+            append(endBCI).
+            append(") -> ").
+            append(handlerBCI).
+            append(" type=").
+            append(catchType == null ? "*any*" : catchType.name()).
+            toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiFrame.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * Represents the Java bytecode frame state(s) at a given position
+ * including {@link CiValue 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 CiValue[] 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;
+
+    public final boolean rethrowException;
+
+    /**
+     * 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, RiResolvedMethod method, int bci, boolean rethrowException, CiValue[] values, int numLocals, int numStack, int numLocks) {
+        super(caller, method, bci);
+        assert values != null;
+        this.rethrowException = rethrowException;
+        this.values = values;
+        this.numLocks = numLocks;
+        this.numLocals = numLocals;
+        this.numStack = numStack;
+        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 CiValue 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 CiValue 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 CiValue 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();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiGenericCallback.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+/**
+ * This interface is used for {@link CiRuntimeCall#GenericCallback} runtime calls.
+ */
+public abstract class CiGenericCallback {
+
+    @SuppressWarnings("unused")
+    private Object callbackInternal(Object arg) {
+        try {
+            return callback(arg);
+        } catch (Throwable t) {
+            t.printStackTrace();
+            return null;
+        }
+    }
+
+    public abstract Object callback(Object arg);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiKind.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,340 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import static com.oracle.max.cri.ci.CiKind.Flags.*;
+import sun.misc.*;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * Denotes the basic kinds of types in CRI, including the all the Java primitive types,
+ * for example, {@link CiKind#Int} for {@code int} and {@link CiKind#Object}
+ * for all object types.
+ * A kind has a single character short name, a Java name, and a set of flags
+ * further describing its behavior.
+ */
+public enum CiKind {
+    Boolean('z', "boolean", FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
+    Byte   ('b', "byte",    FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
+    Short  ('s', "short",   FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
+    Char   ('c', "char",    FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
+    Int    ('i', "int",     FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
+    Float  ('f', "float",   FIELD_TYPE | RETURN_TYPE | PRIMITIVE),
+    Long   ('j', "long",    FIELD_TYPE | RETURN_TYPE | PRIMITIVE),
+    Double ('d', "double",  FIELD_TYPE | RETURN_TYPE | PRIMITIVE),
+    Object ('a', "Object",  FIELD_TYPE | RETURN_TYPE),
+    Void   ('v', "void",    RETURN_TYPE),
+    /** Denote a bytecode address in a {@code JSR} bytecode. */
+    Jsr    ('r', "jsr",     0),
+    /** The non-type. */
+    Illegal('-', "illegal", 0);
+
+    public static final CiKind[] VALUES = values();
+    public static final CiKind[] JAVA_VALUES = new CiKind[] {CiKind.Boolean, CiKind.Byte, CiKind.Short, CiKind.Char, CiKind.Int, CiKind.Float, CiKind.Long, CiKind.Double, CiKind.Object};
+
+    CiKind(char ch, String name, int flags) {
+        this.typeChar = ch;
+        this.javaName = name;
+        this.flags = flags;
+    }
+
+    static class Flags {
+        /**
+         * Can be an object field type.
+         */
+        public static final int FIELD_TYPE  = 0x0001;
+        /**
+         * Can be result type of a method.
+         */
+        public static final int RETURN_TYPE = 0x0002;
+        /**
+         * Behaves as an integer when on Java evaluation stack.
+         */
+        public static final int STACK_INT   = 0x0004;
+        /**
+         * Represents a Java primitive type.
+         */
+        public static final int PRIMITIVE   = 0x0008;
+    }
+
+    /**
+     * The flags for this kind.
+     */
+    private final int flags;
+
+    /**
+     * The name of the kind as a single character.
+     */
+    public final char typeChar;
+
+    /**
+     * The name of this kind which will also be it Java programming language name if
+     * it is {@linkplain #isPrimitive() primitive} or {@code void}.
+     */
+    public final String javaName;
+
+    /**
+     * Checks whether this kind is valid as the type of a field.
+     * @return {@code true} if this kind is valid as the type of a Java field
+     */
+    public boolean isValidFieldType() {
+        return (flags & FIELD_TYPE) != 0;
+    }
+
+    /**
+     * Checks whether this kind is valid as the return type of a method.
+     * @return {@code true} if this kind is valid as the return type of a Java method
+     */
+    public boolean isValidReturnType() {
+        return (flags & RETURN_TYPE) != 0;
+    }
+
+    /**
+     * Checks whether this type is valid as an {@code int} on the Java operand stack.
+     * @return {@code true} if this type is represented by an {@code int} on the operand stack
+     */
+    public boolean isInt() {
+        return (flags & STACK_INT) != 0;
+    }
+
+    /**
+     * Checks whether this type is a Java primitive type.
+     * @return {@code true} if this is {@link #Boolean}, {@link #Byte}, {@link #Char}, {@link #Short},
+     *                                 {@link #Int}, {@link #Long}, {@link #Float} or {@link #Double}.
+     */
+    public boolean isPrimitive() {
+        return (flags & PRIMITIVE) != 0;
+    }
+
+    /**
+     * Gets the kind that represents this kind when on the Java operand stack.
+     * @return the kind used on the operand stack
+     */
+    public CiKind stackKind() {
+        if (isInt()) {
+            return Int;
+        }
+        return this;
+    }
+
+    public static CiKind fromTypeString(String typeString) {
+        assert typeString.length() > 0;
+        final char first = typeString.charAt(0);
+        if (first == '[' || first == 'L') {
+            return CiKind.Object;
+        }
+        return CiKind.fromPrimitiveOrVoidTypeChar(first);
+    }
+
+    /**
+     * Gets the kind from the character describing a primitive or void.
+     * @param ch the character
+     * @return the kind
+     */
+    public static CiKind fromPrimitiveOrVoidTypeChar(char ch) {
+        // Checkstyle: stop
+        switch (ch) {
+            case 'Z': return Boolean;
+            case 'C': return Char;
+            case 'F': return Float;
+            case 'D': return Double;
+            case 'B': return Byte;
+            case 'S': return Short;
+            case 'I': return Int;
+            case 'J': return Long;
+            case 'V': return Void;
+        }
+        // Checkstyle: resume
+        throw new IllegalArgumentException("unknown primitive or void type character: " + ch);
+    }
+
+    public Class< ? > toJavaClass() {
+        // Checkstyle: stop
+        switch(this) {
+            case Void:      return java.lang.Void.TYPE;
+            case Long:      return java.lang.Long.TYPE;
+            case Int:       return java.lang.Integer.TYPE;
+            case Byte:      return java.lang.Byte.TYPE;
+            case Char:      return java.lang.Character.TYPE;
+            case Double:    return java.lang.Double.TYPE;
+            case Float:     return java.lang.Float.TYPE;
+            case Short:     return java.lang.Short.TYPE;
+            case Boolean:   return java.lang.Boolean.TYPE;
+            default:        return null;
+        }
+        // Checkstyle: resume
+    }
+
+    public Class< ? > toUnboxedJavaClass() {
+        // Checkstyle: stop
+        switch(this) {
+            case Void:      return null;
+            case Long:      return java.lang.Long.class;
+            case Int:       return java.lang.Integer.class;
+            case Byte:      return java.lang.Byte.class;
+            case Char:      return java.lang.Character.class;
+            case Double:    return java.lang.Double.class;
+            case Float:     return java.lang.Float.class;
+            case Short:     return java.lang.Short.class;
+            case Boolean:   return java.lang.Boolean.class;
+            default:        return null;
+        }
+        // Checkstyle: resume
+    }
+
+    /**
+     * Checks whether this value type is void.
+     * @return {@code true} if this type is void
+     */
+    public final boolean isVoid() {
+        return this == CiKind.Void;
+    }
+
+    /**
+     * Checks whether this value type is long.
+     * @return {@code true} if this type is long
+     */
+    public final boolean isLong() {
+        return this == CiKind.Long;
+    }
+
+    /**
+     * Checks whether this value type is float.
+     * @return {@code true} if this type is float
+     */
+    public final boolean isFloat() {
+        return this == CiKind.Float;
+    }
+
+    /**
+     * Checks whether this value type is double.
+     * @return {@code true} if this type is double
+     */
+    public final boolean isDouble() {
+        return this == CiKind.Double;
+    }
+
+    /**
+     * Checks whether this value type is float or double.
+     * @return {@code true} if this type is float or double
+     */
+    public final boolean isFloatOrDouble() {
+        return this == CiKind.Double || this == CiKind.Float;
+    }
+
+   /**
+     * Checks whether this value type is an object type.
+     * @return {@code true} if this type is an object
+     */
+    public final boolean isObject() {
+        return this == CiKind.Object;
+    }
+
+    /**
+     * Checks whether this value type is an address type.
+     * @return {@code true} if this type is an address
+     */
+    public boolean isJsr() {
+        return this == CiKind.Jsr;
+    }
+
+    /**
+     * Converts this value type to a string.
+     */
+    @Override
+    public String toString() {
+        return javaName;
+    }
+
+    /**
+     * Marker interface for types that should be {@linkplain CiKind#format(Object) formatted}
+     * with their {@link Object#toString()} value.
+     */
+    public interface FormatWithToString {}
+
+    /**
+     * Gets a formatted string for a given value of this kind.
+     *
+     * @param value a value of this kind
+     * @return a formatted string for {@code value} based on this kind
+     */
+    public String format(Object value) {
+        if (isObject()) {
+            if (value == null) {
+                return "null";
+            } else {
+                if (value instanceof String) {
+                    String s = (String) value;
+                    if (s.length() > 50) {
+                        return "\"" + s.substring(0, 30) + "...\"";
+                    } else {
+                        return " \"" + s + '"';
+                    }
+                } else if (value instanceof RiType) {
+                    return "class " + CiUtil.toJavaName((RiType) value);
+                } else if (value instanceof Enum || value instanceof FormatWithToString) {
+                    return String.valueOf(value);
+                } else if (value instanceof Class< ? >) {
+                    return ((Class< ? >) value).getName() + ".class";
+                } else {
+                    return CiUtil.getSimpleName(value.getClass(), true) + "@" + System.identityHashCode(value);
+                }
+            }
+        } else {
+            return value.toString();
+        }
+    }
+
+    public final char signatureChar() {
+        return Character.toUpperCase(typeChar);
+    }
+
+    public CiConstant readUnsafeConstant(Object value, long displacement) {
+        Unsafe u = Unsafe.getUnsafe();
+        switch(this) {
+            case Boolean:
+                return CiConstant.forBoolean(u.getBoolean(value, displacement));
+            case Byte:
+                return CiConstant.forByte(u.getByte(value, displacement));
+            case Char:
+                return CiConstant.forChar(u.getChar(value, displacement));
+            case Short:
+                return CiConstant.forShort(u.getShort(value, displacement));
+            case Int:
+                return CiConstant.forInt(u.getInt(value, displacement));
+            case Long:
+                return CiConstant.forLong(u.getLong(value, displacement));
+            case Float:
+                return CiConstant.forFloat(u.getFloat(value, displacement));
+            case Double:
+                return CiConstant.forDouble(u.getDouble(value, displacement));
+            case Object:
+                return CiConstant.forObject(u.getObject(value, displacement));
+            default:
+                assert false : "unexpected kind: " + this;
+                return null;
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiMonitorValue.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+public final class CiMonitorValue extends CiValue {
+    private static final long serialVersionUID = 8241681800464483691L;
+
+    public CiValue owner;
+    public final CiValue lockData;
+    public final boolean eliminated;
+
+    public CiMonitorValue(CiValue owner, CiValue lockData, boolean eliminated) {
+        super(CiKind.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.max.cri/src/com/oracle/max/cri/ci/CiRegister.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * 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 CiKind}, indexed by {@link CiKind#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[CiKind.VALUES.length];
+        for (CiKind kind : CiKind.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(CiKind kind) {
+        return values[kind.ordinal()];
+    }
+
+    /**
+     * Gets this register as a {@linkplain CiRegisterValue value} with no particular kind.
+     * @return a {@link CiRegisterValue} with {@link CiKind#Illegal} kind.
+     */
+    public CiRegisterValue asValue() {
+        return asValue(CiKind.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;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiRegisterConfig.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ci;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.CiCallingConvention.*;
+import com.oracle.max.cri.ci.CiRegister.*;
+import com.oracle.max.cri.ri.*;
+
+/**
+ * A default implementation of {@link RiRegisterConfig}.
+ */
+public class CiRegisterConfig implements RiRegisterConfig {
+
+    /**
+     * 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 RiRegisterAttributes attributes} for this register configuration.
+     */
+    public final RiRegisterAttributes[] 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 CiRegisterConfig(
+                    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 = RiRegisterAttributes.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 CiRegisterConfig(CiRegisterConfig 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(CiKind 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, CiKind[] parameters, CiTarget target, boolean stackOnly) {
+        CiValue[] locations = new CiValue[parameters.length];
+
+        int currentGeneral = 0;
+        int currentXMM = 0;
+        int currentStackOffset = stackArg0Offsets[type.ordinal()];
+
+        for (int i = 0; i < parameters.length; i++) {
+            final CiKind 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 RiRegisterAttributes[] 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;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiRegisterValue.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+/**
+ * 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 CiKind}) pair. Use {@link CiRegister#asValue(CiKind)} to
+ * retrieve the canonical {@link CiRegisterValue} instance for a given (register,kind) pair.
+ */
+public final class CiRegisterValue extends CiValue {
+    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(CiKind 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();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiResult.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+/**
+ * Represents the result of compiling a method. The result can include a target method with machine code and metadata,
+ * and/or statistics. If the compiler bailed out due to malformed bytecode, an internal error, or other cause, it will
+ * supply the bailout object.
+ */
+public class CiResult {
+    private final CiTargetMethod targetMethod;
+    private final CiBailout bailout;
+    private final CiStatistics stats;
+
+    /**
+     * Creates a new compilation result.
+     * @param targetMethod the method that was produced, if any
+     * @param bailout the bailout condition that occurred
+     * @param stats statistics about the compilation
+     */
+    public CiResult(CiTargetMethod targetMethod, CiBailout bailout, CiStatistics stats) {
+        this.targetMethod = targetMethod;
+        this.bailout = bailout;
+        this.stats = stats;
+    }
+
+    /**
+     * Gets the target method that was produced by this compilation. If no target method was
+     * produced, but a bailout occured, then the bailout exception will be thrown at this point.
+     * @return the target method produced
+     * @throws {@link CiBailout} if a bailout occurred
+     */
+    public CiTargetMethod targetMethod() {
+        if (bailout != null) {
+            throw bailout;
+        }
+        return targetMethod;
+    }
+
+    /**
+     * Returns the statistics about the compilation that were produced, if any.
+     * @return the statistics
+     */
+    public CiStatistics statistics() {
+        return stats;
+    }
+
+    /**
+     * Returns the bailout condition that occurred for this compilation, if any.
+     * @return the bailout
+     */
+    public CiBailout bailout() {
+        return bailout;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiRuntimeCall.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ci;
+
+import static com.oracle.max.cri.ci.CiKind.*;
+
+/**
+ * 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),
+    HandleException(Void, Object),
+    SetDeoptInfo(Void, Object),
+    CreateNullPointerException(Object),
+    CreateOutOfBoundsException(Object, Int),
+    OSRMigrationEnd(Void),
+    JavaTimeMillis(Long),
+    JavaTimeNanos(Long),
+    Debug(Void),
+    ArithmethicLrem(Long, Long, Long),
+    ArithmeticLdiv(Long, Long, Long),
+    ArithmeticFrem(Float, Float, Float),
+    ArithmeticDrem(Double, Double, Double),
+    ArithmeticCos(Double, Double),
+    ArithmeticTan(Double, Double),
+    ArithmeticLog(Double, Double),
+    ArithmeticLog10(Double, Double),
+    ArithmeticSin(Double, Double),
+    GenericCallback(Object, Object, Object);
+
+    public final CiKind resultKind;
+    public final CiKind[] arguments;
+
+    private CiRuntimeCall(CiKind resultKind, CiKind... args) {
+        this.resultKind = resultKind;
+        this.arguments = args;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiStackSlot.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ci;
+
+import static com.oracle.max.cri.ci.CiKind.*;
+
+/**
+ * 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 CiValue {
+    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(CiKind 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(CiKind 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() {
+        String s;
+        if (!addFrameSize) {
+            s = "out:";
+        } else if (offset >= 0) {
+            s = "in:";
+        } else {
+            s = "spill:";
+        }
+        return s + 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[CiKind.VALUES.length][];
+        for (CiKind kind : new CiKind[] {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;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiStatistics.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+/**
+ * Contains statistics gathered during the compilation of a method and reported back
+ * from the compiler as the result of compilation.
+ */
+public class CiStatistics {
+
+    /**
+     * The total number of bytes of bytecode parsed during this compilation, including any inlined methods.
+     */
+    public int bytecodeCount;
+
+    /**
+     * The number of internal graph nodes created during this compilation.
+     */
+    public int nodeCount;
+
+    /**
+     * The number of basic blocks created during this compilation.
+     */
+    public int blockCount;
+
+    /**
+     * The number of loops in the compiled method.
+     */
+    public int loopCount;
+
+    /**
+     * The number of methods inlined.
+     */
+    public int inlineCount;
+
+    /**
+     * The number of methods folded (i.e. evaluated).
+     */
+    public int foldCount;
+
+    /**
+     * The number of intrinsics inlined in this compilation.
+     */
+    public int intrinsicCount;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiTarget.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+
+/**
+ * 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 CiKind 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 = CiKind.Long;
+        } else {
+            this.wordKind = CiKind.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(CiKind 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.max.cri/src/com/oracle/max/cri/ci/CiTargetMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,596 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+import java.util.*;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * 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}.
+ */
+public class CiTargetMethod implements Serializable {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = -1319947729753702434L;
+
+    /**
+     * Represents a code position with associated additional information.
+     */
+    public abstract static class Site implements Serializable {
+        /**
+         *
+         */
+        private static final long serialVersionUID = -8214214947651979102L;
+        /**
+         * The position (or offset) of this site with respect to the start of the target method.
+         */
+        public final int pcOffset;
+
+        public Site(int pos) {
+            this.pcOffset = pos;
+        }
+    }
+
+    /**
+     * Represents a safepoint with associated debug info.
+     */
+    public static class Safepoint extends Site implements Comparable<Safepoint> {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 2479806696381720162L;
+        public final CiDebugInfo debugInfo;
+
+        Safepoint(int pcOffset, CiDebugInfo debugInfo) {
+            super(pcOffset);
+            this.debugInfo = debugInfo;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append(pcOffset);
+            sb.append("[<safepoint>]");
+            appendDebugInfo(sb, debugInfo);
+            return sb.toString();
+        }
+
+        @Override
+        public int compareTo(Safepoint o) {
+            if (pcOffset < o.pcOffset) {
+                return -1;
+            } else if (pcOffset > o.pcOffset) {
+                return 1;
+            }
+            return 0;
+        }
+    }
+
+    /**
+     * Represents a call in the code.
+     */
+    public static final class Call extends Safepoint {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 1440741241631046954L;
+
+        /**
+         * The target of the call.
+         */
+        public final Object target;
+
+        /**
+         * The size of the call instruction.
+         */
+        public final int size;
+
+        /**
+         * Specifies if this call is direct or indirect. A direct call has an immediate operand encoding
+         * the absolute or relative (to the call itself) address of the target. An indirect call has a
+         * register or memory operand specifying the target address of the call.
+         */
+        public final boolean direct;
+
+        Call(Object target, int pcOffset, int size, boolean direct, CiDebugInfo debugInfo) {
+            super(pcOffset, debugInfo);
+            this.size = size;
+            this.target = target;
+            this.direct = direct;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append(pcOffset);
+            sb.append('[');
+            sb.append(target);
+            sb.append(']');
+
+            if (debugInfo != null) {
+                appendDebugInfo(sb, debugInfo);
+            }
+
+            return sb.toString();
+        }
+    }
+
+    /**
+     * Represents a reference to data from the code. The associated data can be any constant.
+     */
+    public static final class DataPatch extends Site {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 5771730331604867476L;
+        public final CiConstant constant;
+        public final int alignment;
+
+        DataPatch(int pcOffset, CiConstant data, int alignment) {
+            super(pcOffset);
+            this.constant = data;
+            this.alignment = alignment;
+        }
+
+        @Override
+        public String toString() {
+            return String.format("%d[<data patch referring to data %s>]", pcOffset, constant);
+        }
+    }
+
+    /**
+     * Provides extra information about instructions or data at specific positions in {@link CiTargetMethod#targetCode()}.
+     * This is optional information that can be used to enhance a disassembly of the code.
+     */
+    public abstract static class CodeAnnotation implements Serializable {
+        /**
+         *
+         */
+        private static final long serialVersionUID = -7903959680749520748L;
+        public final int position;
+
+        public CodeAnnotation(int position) {
+            this.position = position;
+        }
+    }
+
+    /**
+     * A string comment about one or more instructions at a specific position in the code.
+     */
+    public static final class CodeComment extends CodeAnnotation {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 6802287188701961401L;
+        public final String value;
+        public CodeComment(int position, String comment) {
+            super(position);
+            this.value = comment;
+        }
+
+        @Override
+        public String toString() {
+            return getClass().getSimpleName() + "@" + position + ": " + value;
+        }
+    }
+
+    /**
+     * Labels some inline data in the code.
+     */
+    public static final class InlineData extends CodeAnnotation {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 305997507263827108L;
+        public final int size;
+        public InlineData(int position, int size) {
+            super(position);
+            this.size = size;
+        }
+
+        @Override
+        public String toString() {
+            return getClass().getSimpleName() + "@" + position + ": size=" + size;
+        }
+    }
+
+    /**
+     * Describes a table of signed offsets embedded in the code. The offsets are relative to the starting
+     * address of the table. This type of table maybe generated when translating a multi-way branch
+     * based on a key value from a dense value set (e.g. the {@code tableswitch} JVM instruction).
+     *
+     * The table is indexed by the contiguous range of integers from {@link #low} to {@link #high} inclusive.
+     */
+    public static final class JumpTable extends CodeAnnotation {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 2222194398353801831L;
+
+        /**
+         * The low value in the key range (inclusive).
+         */
+        public final int low;
+
+        /**
+         * The high value in the key range (inclusive).
+         */
+        public final int high;
+
+        /**
+         * The size (in bytes) of each table entry.
+         */
+        public final int entrySize;
+
+        public JumpTable(int position, int low, int high, int entrySize) {
+            super(position);
+            this.low = low;
+            this.high = high;
+            this.entrySize = entrySize;
+        }
+
+        @Override
+        public String toString() {
+            return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]";
+        }
+    }
+
+    /**
+     * Describes a table of key and offset pairs. The offset in each table entry is relative to the address of
+     * the table. This type of table maybe generated when translating a multi-way branch
+     * based on a key value from a sparse value set (e.g. the {@code lookupswitch} JVM instruction).
+     */
+    public static final class LookupTable extends CodeAnnotation {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 8367952567559116160L;
+
+        /**
+         * The number of entries in the table.
+         */
+        public final int npairs;
+
+        /**
+         * The size (in bytes) of entry's key.
+         */
+        public final int keySize;
+
+        /**
+         * The size (in bytes) of entry's offset value.
+         */
+        public final int offsetSize;
+
+        public LookupTable(int position, int npairs, int keySize, int offsetSize) {
+            super(position);
+            this.npairs = npairs;
+            this.keySize = keySize;
+            this.offsetSize = offsetSize;
+        }
+
+        @Override
+        public String toString() {
+            return getClass().getSimpleName() + "@" + position + ": [npairs=" + npairs + ", keySize=" + keySize + ", offsetSize=" + offsetSize + "]";
+        }
+    }
+
+    /**
+     * Represents exception handler information for a specific code position. It includes the catch code position as
+     * well as the caught exception type.
+     */
+    public static final class ExceptionHandler extends Site {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 4897339464722665281L;
+        public final int bci;
+        public final int scopeLevel;
+        public final int handlerPos;
+        public final int handlerBci;
+        public final RiType exceptionType;
+
+        ExceptionHandler(int pcOffset, int bci, int scopeLevel, int handlerPos, int handlerBci, RiType exceptionType) {
+            super(pcOffset);
+            this.bci = bci;
+            this.scopeLevel = scopeLevel;
+            this.handlerPos = handlerPos;
+            this.handlerBci = handlerBci;
+            this.exceptionType = exceptionType;
+        }
+
+        @Override
+        public String toString() {
+            return String.format("%d[<exception edge to %d with type %s>]", pcOffset, handlerPos, (exceptionType == null) ? "null" : exceptionType);
+        }
+    }
+
+    public static final class Mark extends Site {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 3612943150662354844L;
+        public final Object id;
+        public final Mark[] references;
+
+        Mark(int pcOffset, Object id, Mark[] references) {
+            super(pcOffset);
+            this.id = id;
+            this.references = references;
+        }
+
+        @Override
+        public String toString() {
+            if (id == null) {
+                return String.format("%d[<mark with %d references>]", pcOffset, references.length);
+            } else if (id instanceof Integer) {
+                return String.format("%d[<mark with %d references and id %s>]", pcOffset, references.length, Integer.toHexString((Integer) id));
+            } else {
+                return String.format("%d[<mark with %d references and id %s>]", pcOffset, references.length, id.toString());
+            }
+        }
+    }
+
+    /**
+     * List of safepoints, sorted by {@link Site#pcOffset}.
+     */
+    public final List<Safepoint> safepoints = new ArrayList<>();
+
+    /**
+     * List of data references.
+     */
+    public final List<DataPatch> dataReferences = new ArrayList<>();
+
+    /**
+     * List of exception handlers.
+     */
+    public final List<ExceptionHandler> exceptionHandlers = new ArrayList<>();
+
+    /**
+     * List of marks.
+     */
+    public final List<Mark> marks = new ArrayList<>();
+
+    private int frameSize = -1;
+    private int customStackAreaOffset = -1;
+    private int registerRestoreEpilogueOffset = -1;
+    /**
+     * The buffer containing the emitted machine code.
+     */
+    private byte[] targetCode;
+
+    /**
+     * The leading number of bytes in {@link #targetCode} containing the emitted machine code.
+     */
+    private int targetCodeSize;
+
+    private ArrayList<CodeAnnotation> annotations;
+
+    private CiAssumptions assumptions;
+
+    /**
+     * Constructs a new target method.
+     */
+    public CiTargetMethod() {
+    }
+
+    public void setAssumptions(CiAssumptions assumptions) {
+        this.assumptions = assumptions;
+    }
+
+    public CiAssumptions assumptions() {
+        return assumptions;
+    }
+
+    /**
+     * Sets the frame size in bytes. Does not include the return address pushed onto the
+     * stack, if any.
+     *
+     * @param size the size of the frame in bytes
+     */
+    public void setFrameSize(int size) {
+        frameSize = size;
+    }
+
+    /**
+     * Sets the machine that has been generated by the compiler.
+     *
+     * @param code the machine code generated
+     * @param size the size of the machine code
+     */
+    public void setTargetCode(byte[] code, int size) {
+        targetCode = code;
+        targetCodeSize = size;
+    }
+
+    /**
+     * Records a reference to the data section in the code section (e.g. to load an integer or floating point constant).
+     *
+     * @param codePos the position in the code where the data reference occurs
+     * @param data the data that is referenced
+     * @param alignment the alignment requirement of the data or 0 if there is no alignment requirement
+     */
+    public void recordDataReference(int codePos, CiConstant data, int alignment) {
+        assert codePos >= 0 && data != null;
+        dataReferences.add(new DataPatch(codePos, data, alignment));
+    }
+
+    /**
+     * Records a call in the code array.
+     *
+     * @param codePos the position of the call in the code array
+     * @param size the size of the call instruction
+     * @param target the {@link RiRuntime#asCallTarget(Object) target} being called
+     * @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) {
+        final Call call = new Call(target, codePos, size, direct, debugInfo);
+        addSafepoint(call);
+    }
+
+    /**
+     * Records an exception handler for this method.
+     *
+     * @param codePos  the position in the code that is covered by the handler
+     * @param handlerPos    the position of the handler
+     * @param throwableType the type of exceptions handled by the handler
+     */
+    public void recordExceptionHandler(int codePos, int bci, int scopeLevel, int handlerPos, int handlerBci, RiType throwableType) {
+        exceptionHandlers.add(new ExceptionHandler(codePos, bci, scopeLevel, handlerPos, handlerBci, throwableType));
+    }
+
+    /**
+     * Records a safepoint in the code array.
+     *
+     * @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) {
+        addSafepoint(new Safepoint(codePos, debugInfo));
+    }
+
+    private void addSafepoint(Safepoint safepoint) {
+        // The safepoints list must always be sorted
+        if (!safepoints.isEmpty() && safepoints.get(safepoints.size() - 1).pcOffset >= safepoint.pcOffset) {
+            // This re-sorting should be very rare
+            Collections.sort(safepoints);
+        }
+        safepoints.add(safepoint);
+    }
+
+    /**
+     * Records an instruction mark within this method.
+     *
+     * @param codePos the position in the code that is covered by the handler
+     * @param id the identifier for this mark
+     * @param references an array of other marks that this mark references
+     */
+    public Mark recordMark(int codePos, Object id, Mark[] references) {
+        Mark mark = new Mark(codePos, id, references);
+        marks.add(mark);
+        return mark;
+    }
+
+    /**
+     * Allows a method to specify the offset of the epilogue that restores the callee saved registers. Must be called
+     * iff the method is a callee saved method and stores callee registers on the stack.
+     *
+     * @param registerRestoreEpilogueOffset the offset in the machine code where the epilogue begins
+     */
+    public void setRegisterRestoreEpilogueOffset(int registerRestoreEpilogueOffset) {
+        assert this.registerRestoreEpilogueOffset == -1;
+        this.registerRestoreEpilogueOffset = registerRestoreEpilogueOffset;
+    }
+
+    /**
+     * The frame size of the method in bytes.
+     *
+     * @return the frame size
+     */
+    public int frameSize() {
+        assert frameSize != -1 : "frame size not yet initialized!";
+        return frameSize;
+    }
+
+    /**
+     * @return the code offset of the start of the epilogue that restores all callee saved registers, or -1 if this is
+     *         not a callee saved method
+     */
+    public int registerRestoreEpilogueOffset() {
+        return registerRestoreEpilogueOffset;
+    }
+
+    /**
+     * Offset in bytes for the custom stack area (relative to sp).
+     * @return the offset in bytes
+     */
+    public int customStackAreaOffset() {
+        return customStackAreaOffset;
+    }
+
+    /**
+     * @see #customStackAreaOffset()
+     * @param offset
+     */
+    public void setCustomStackAreaOffset(int offset) {
+        customStackAreaOffset = offset;
+    }
+
+    /**
+     * @return the machine code generated for this method
+     */
+    public byte[] targetCode() {
+        return targetCode;
+    }
+
+    /**
+     * @return the size of the machine code generated for this method
+     */
+    public int targetCodeSize() {
+        return targetCodeSize;
+    }
+
+    /**
+     * @return the code annotations or {@code null} if there are none
+     */
+    public List<CodeAnnotation> annotations() {
+        return annotations;
+    }
+
+    public void addAnnotation(CodeAnnotation annotation) {
+        assert annotation != null;
+        if (annotations == null) {
+            annotations = new ArrayList<>();
+        }
+        annotations.add(annotation);
+    }
+
+    private static void appendDebugInfo(StringBuilder sb, CiDebugInfo info) {
+        if (info != null) {
+            appendRefMap(sb, "stackMap", info.frameRefMap);
+            appendRefMap(sb, "registerMap", info.registerRefMap);
+            CiCodePos codePos = info.codePos;
+            if (codePos != null) {
+                CiUtil.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) {
+                        sb.append(" #locks=").append(info.frame().numLocks);
+                    }
+                }
+            }
+        }
+    }
+
+    private static void appendRefMap(StringBuilder sb, String name, CiBitMap map) {
+        if (map != null) {
+            sb.append(' ').append(name).append('[').append(map.toBinaryString()).append(']');
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiUtil.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,739 @@
+/*
+ * 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.max.cri.ci;
+
+import static java.lang.reflect.Modifier.*;
+
+import java.lang.annotation.*;
+import java.util.*;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * 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, RiResolvedMethod method) {
+        if (parameterIndex >= 0) {
+            Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+            for (Annotation a : parameterAnnotations[parameterIndex]) {
+                if (a.annotationType() == annotationClass) {
+                    return annotationClass.cast(a);
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Extends the functionality of {@link Class#getSimpleName()} to include a non-empty string for anonymous and local
+     * classes.
+     *
+     * @param clazz the class for which the simple name is being requested
+     * @param withEnclosingClass specifies if the returned name should be qualified with the name(s) of the enclosing
+     *            class/classes of {@code clazz} (if any). This option is ignored if {@code clazz} denotes an anonymous
+     *            or local class.
+     * @return the simple name
+     */
+    public static String getSimpleName(Class<?> clazz, boolean withEnclosingClass) {
+        final String simpleName = clazz.getSimpleName();
+        if (simpleName.length() != 0) {
+            if (withEnclosingClass) {
+                String prefix = "";
+                Class<?> enclosingClass = clazz;
+                while ((enclosingClass = enclosingClass.getEnclosingClass()) != null) {
+                    prefix = prefix + enclosingClass.getSimpleName() + ".";
+                }
+                return prefix + simpleName;
+            }
+            return simpleName;
+        }
+        // Must be an anonymous or local class
+        final String name = clazz.getName();
+        int index = name.indexOf('$');
+        if (index == -1) {
+            return name;
+        }
+        index = name.lastIndexOf('.', index);
+        if (index == -1) {
+            return name;
+        }
+        return name.substring(index + 1);
+    }
+
+    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;
+    }
+
+    /**
+     * Converts a given type to its Java programming language name. The following are examples of strings returned by
+     * this method:
+     *
+     * <pre>
+     *     qualified == true:
+     *         java.lang.Object
+     *         int
+     *         boolean[][]
+     *     qualified == false:
+     *         Object
+     *         int
+     *         boolean[][]
+     * </pre>
+     *
+     * @param riType the type to be converted to a Java name
+     * @param qualified specifies if the package prefix of the type should be included in the returned name
+     * @return the Java name corresponding to {@code riType}
+     */
+    public static String toJavaName(RiType riType, boolean qualified) {
+        CiKind kind = riType.kind(false);
+        if (kind.isPrimitive() || kind == CiKind.Void) {
+            return kind.javaName;
+        }
+        return internalNameToJava(riType.name(), qualified);
+    }
+    /**
+     * Converts a given type to its Java programming language name. The following are examples of strings returned by
+     * this method:
+     *
+     * <pre>
+     *      java.lang.Object
+     *      int
+     *      boolean[][]
+     * </pre>
+     *
+     * @param riType the type to be converted to a Java name
+     * @return the Java name corresponding to {@code riType}
+     */
+    public static String toJavaName(RiType riType) {
+        return (riType == null) ? null : internalNameToJava(riType.name(), true);
+    }
+
+    public static String internalNameToJava(String name, boolean qualified) {
+        switch (name.charAt(0)) {
+            case 'L': {
+                String result = name.substring(1, name.length() - 1).replace('/', '.');
+                if (!qualified) {
+                    final int lastDot = result.lastIndexOf('.');
+                    if (lastDot != -1) {
+                        result = result.substring(lastDot + 1);
+                    }
+                }
+                return result;
+
+            }
+            case '[':
+                return internalNameToJava(name.substring(1), qualified) + "[]";
+            default:
+                if (name.length() != 1) {
+                    throw new IllegalArgumentException("Illegal internal name: " + name);
+                }
+                return CiKind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).javaName;
+        }
+    }
+
+    /**
+     * 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 CiKind#jniName JNI} form of their {@linkplain CiKind 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, RiMethod method) throws IllegalFormatException {
+        final StringBuilder sb = new StringBuilder();
+        int index = 0;
+        RiSignature 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(toJavaName(sig.returnType(null), qualified));
+                        break;
+                    }
+                    case 'H':
+                        qualified = true;
+                        // fall through
+                    case 'h': {
+                        sb.append(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(toJavaName(sig.argumentTypeAt(i, null), qualified));
+                        }
+                        break;
+                    }
+                    case 'f': {
+                        sb.append(!(method instanceof RiResolvedMethod) ? "unresolved" : isStatic(((RiResolvedMethod) 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 CiKind#jniName JNI} form of its {@linkplain CiKind 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, RiField field) throws IllegalFormatException {
+        final StringBuilder sb = new StringBuilder();
+        int index = 0;
+        RiType 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(toJavaName(type, qualified));
+                        break;
+                    }
+                    case 'H':
+                        qualified = true;
+                        // fall through
+                    case 'h': {
+                        sb.append(toJavaName(field.holder(), qualified));
+                        break;
+                    }
+                    case 'n': {
+                        sb.append(field.name());
+                        break;
+                    }
+                    case 'f': {
+                        sb.append(!(field instanceof RiResolvedField) ? "unresolved" : isStatic(((RiResolvedField) field).accessFlags()) ? "static" : "instance");
+                        break;
+                    }
+                    case '%': {
+                        sb.append('%');
+                        break;
+                    }
+                    default: {
+                        throw new UnknownFormatConversionException(String.valueOf(specifier));
+                    }
+                }
+            } else {
+                sb.append(ch);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Gets a stack trace element for a given method and bytecode index.
+     */
+    public static StackTraceElement toStackTraceElement(RiMethod method, @SuppressWarnings("unused") int bci) {
+        // TODO(tw): Look if we can use bci to get the line number.
+        return new StackTraceElement(CiUtil.toJavaName(method.holder()), method.name(), null, -1);
+    }
+
+    /**
+     * 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, RiMethod, int)}
+     * without having to supply a a {@link StringBuilder} instance and convert the result
+     * to a string.
+     */
+    public static String toLocation(RiResolvedMethod 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 RiMethod#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, RiResolvedMethod method, int bci) {
+        StackTraceElement ste = method.toStackTraceElement(bci);
+        if (ste.getFileName() != null && ste.getLineNumber() > 0) {
+            sb.append(ste);
+        } else {
+            sb.append(CiUtil.format("%H.%n(%p)", 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:");
+            CiBitMap 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:");
+            CiBitMap 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 CiKind[] signatureToKinds(RiResolvedMethod method) {
+        CiKind receiver = isStatic(method.accessFlags()) ? null : method.holder().kind(true);
+        return signatureToKinds(method.signature(), receiver);
+    }
+
+    public static CiKind[] signatureToKinds(RiSignature signature, CiKind receiverKind) {
+        int args = signature.argumentCount(false);
+        CiKind[] result;
+        int i = 0;
+        if (receiverKind != null) {
+            result = new CiKind[args + 1];
+            result[0] = receiverKind;
+            i = 1;
+        } else {
+            result = new CiKind[args];
+        }
+        for (int j = 0; j < args; j++) {
+            result[i + j] = signature.argumentKindAt(j, true);
+        }
+        return result;
+    }
+
+    public static Class<?>[] signatureToTypes(RiSignature signature, RiType accessingClass) {
+        int count = signature.argumentCount(false);
+        Class<?>[] result = new Class<?>[count];
+        for (int i = 0; i < result.length; ++i) {
+            result[i] = ((RiResolvedType) signature.argumentTypeAt(i, accessingClass)).toJava();
+        }
+        return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValue.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+import java.io.*;
+
+/**
+ * Abstract base class for values manipulated by the compiler. All values have a {@linkplain CiKind kind} and are immutable.
+ */
+public abstract class CiValue implements Serializable {
+    private static final long serialVersionUID = -6909397188697766469L;
+
+    @SuppressWarnings("serial")
+    public static CiValue IllegalValue = new CiValue(CiKind.Illegal) {
+        @Override
+        public String toString() {
+            return "-";
+        }
+    };
+
+    /**
+     * The kind of this value.
+     */
+    public final CiKind kind;
+
+    /**
+     * Initializes a new value of the specified kind.
+     * @param kind the kind
+     */
+    protected CiValue(CiKind kind) {
+        this.kind = kind;
+    }
+
+    /**
+     * String representation of the kind, which should be the end of all {@link #toString()} implementation of subclasses.
+     */
+    protected final String kindSuffix() {
+        return "|" + kind.typeChar;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiValueUtil.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ci;
+
+public class CiValueUtil {
+    public static boolean isIllegal(CiValue value) {
+        assert value != null;
+        return value == CiValue.IllegalValue;
+    }
+
+    public static boolean isLegal(CiValue value) {
+        return !isIllegal(value);
+    }
+
+    public static boolean isVirtualObject(CiValue value) {
+        assert value != null;
+        return value instanceof CiVirtualObject;
+    }
+
+
+    public static boolean isVariable(CiValue value) {
+        assert value != null;
+        return value instanceof CiVariable;
+    }
+
+    public static CiVariable asVariable(CiValue value) {
+        assert value != null;
+        return (CiVariable) value;
+    }
+
+
+    public static boolean isConstant(CiValue value) {
+        assert value != null;
+        return value instanceof CiConstant;
+    }
+
+
+    public static boolean isStackSlot(CiValue value) {
+        assert value != null;
+        return value instanceof CiStackSlot;
+    }
+
+    public static CiStackSlot asStackSlot(CiValue value) {
+        assert value != null;
+        return (CiStackSlot) value;
+    }
+
+
+    public static boolean isRegister(CiValue value) {
+        assert value != null;
+        return value instanceof CiRegisterValue;
+    }
+
+    public static CiRegister asRegister(CiValue value) {
+        assert value != null;
+        return ((CiRegisterValue) value).reg;
+    }
+
+    public static CiRegister asIntReg(CiValue value) {
+        assert value.kind == CiKind.Int || value.kind == CiKind.Jsr;
+        return asRegister(value);
+    }
+
+    public static CiRegister asLongReg(CiValue value) {
+        assert value.kind == CiKind.Long : value.kind;
+        return asRegister(value);
+    }
+
+    public static CiRegister asObjectReg(CiValue value) {
+        assert value.kind == CiKind.Object;
+        return asRegister(value);
+    }
+
+    public static CiRegister asFloatReg(CiValue value) {
+        assert value.kind == CiKind.Float;
+        return asRegister(value);
+    }
+
+    public static CiRegister asDoubleReg(CiValue value) {
+        assert value.kind == CiKind.Double;
+        return asRegister(value);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiVariable.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,106 @@
+/*
+ * 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.max.cri.ci;
+
+/**
+ * Represents a value that is yet to be bound to a machine location (such as
+ * a {@linkplain CiRegister register} or stack {@linkplain CiAddress address})
+ * by a register allocator.
+ */
+public final class CiVariable extends CiValue {
+    private static final long serialVersionUID = 4507578431686109809L;
+
+    /**
+     * The identifier of the variable. This is a non-zero index in a contiguous 0-based name space.
+     */
+    public final int index;
+
+    /**
+     * Creates a new variable.
+     * @param kind
+     * @param index
+     */
+    private CiVariable(CiKind kind, int index) {
+        super(kind);
+        this.index = index;
+    }
+
+    private static CiVariable[] generate(CiKind kind, int count) {
+        CiVariable[] variables = new CiVariable[count];
+        for (int i = 0; i < count; i++) {
+            variables[i] = new CiVariable(kind, i);
+        }
+        return variables;
+    }
+
+    private static final int CACHE_PER_KIND_SIZE = 100;
+
+    /**
+     * Cache of common variables.
+     */
+    private static final CiVariable[][] cache = new CiVariable[CiKind.values().length][];
+    static {
+        for (CiKind kind : CiKind.values()) {
+            cache[kind.ordinal()] = generate(kind, CACHE_PER_KIND_SIZE);
+        }
+    }
+
+    /**
+     * Gets a variable for a given kind and index.
+     *
+     * @param kind
+     * @param index
+     * @return the corresponding {@code CiVariable}
+     */
+    public static CiVariable get(CiKind kind, int index) {
+        //assert kind == kind.stackKind() : "Variables can be only created for stack kinds";
+        assert index >= 0;
+        CiVariable[] cachedVars = cache[kind.ordinal()];
+        if (index < cachedVars.length) {
+            return cachedVars[index];
+        }
+        return new CiVariable(kind, index);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof CiVariable) {
+            CiVariable var = (CiVariable) obj;
+            return kind == var.kind && index == var.index;
+        }
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return (index << 4) | kind.ordinal();
+    }
+
+    @Override
+    public String toString() {
+        return "v" + index + kindSuffix();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiVirtualObject.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ci;
+
+import com.oracle.max.cri.ri.*;
+
+/**
+ * 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 CiValue {
+    private static final long serialVersionUID = -2907197776426346021L;
+
+    private final RiType type;
+    private CiValue[] 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 RiResolvedType#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(RiType type, CiValue[] values, int id) {
+        return new CiVirtualObject(type, values, id);
+    }
+
+    private CiVirtualObject(RiType type, CiValue[] values, int id) {
+        super(CiKind.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 RiType type() {
+        return type;
+    }
+
+    /**
+     * @return an array containing all the values to be stored into the object when it is recreated.
+     */
+    public CiValue[] 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(CiValue[] 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 RiRuntime runtime;
+
+        public CiVirtualObjectFactory(RiRuntime runtime) {
+            this.runtime = runtime;
+        }
+
+        public CiVirtualObject constantProxy(CiKind kind, CiValue objectValue, CiValue primitiveValue) {
+            CiConstant cKind = CiConstant.forObject(kind);
+            // TODO: here the ordering is hard coded... we should query RiType.fields() and act accordingly
+            return new CiVirtualObject(runtime.getType(CiConstant.class), new CiValue[] {cKind, primitiveValue, CiValue.IllegalValue, objectValue}, nextId++);
+        }
+
+        public CiValue proxy(CiValue ciValue) {
+            switch (ciValue.kind) {
+                case Boolean:
+                    return new CiVirtualObject(runtime.getType(Boolean.class), new CiValue[] {ciValue}, nextId++);
+                case Byte:
+                    return new CiVirtualObject(runtime.getType(Byte.class), new CiValue[] {ciValue}, nextId++);
+                case Char:
+                    return new CiVirtualObject(runtime.getType(Character.class), new CiValue[] {ciValue}, nextId++);
+                case Double:
+                    return new CiVirtualObject(runtime.getType(Double.class), new CiValue[] {ciValue, CiValue.IllegalValue}, nextId++);
+                case Float:
+                    return new CiVirtualObject(runtime.getType(Float.class), new CiValue[] {ciValue}, nextId++);
+                case Int:
+                    return new CiVirtualObject(runtime.getType(Integer.class), new CiValue[] {ciValue}, nextId++);
+                case Long:
+                    return new CiVirtualObject(runtime.getType(Long.class), new CiValue[] {ciValue, CiValue.IllegalValue}, nextId++);
+                case Object:
+                    return ciValue;
+                case Short:
+                    return new CiVirtualObject(runtime.getType(Short.class), new CiValue[] {ciValue}, nextId++);
+                default:
+                    assert false : ciValue.kind;
+                    return null;
+            }
+        }
+
+        public CiVirtualObject arrayProxy(RiType arrayType, CiValue[] values) {
+            return new CiVirtualObject(arrayType, values, nextId++);
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/package-info.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+/**
+ * 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.max.graal.compiler.graphbuilder.Bytecodes}.
+ *
+ * The target hardware architecture is represented by {@link com.oracle.max.cri.ci.CiArchitecture} and the specific target machine
+ * environment for a compiler instance is represented by {@link com.oracle.max.cri.ci.CiTarget}.
+ * <p>
+ * A {@code CiResult} encapsulates
+ * {@linkplain com.oracle.max.cri.ci.CiStatistics compilation statistics}, possible {@linkplain com.oracle.max.cri.ci.CiBailout error state}
+ * and the {@linkplain com.oracle.max.cri.ci.CiTargetMethod compiled code and metadata}.
+ * {@link com.oracle.max.cri.ci.CiCodePos} and {@link com.oracle.max.cri.ci.CiDebugInfo} provide detailed information to the
+ * runtime to support debugging and deoptimization of the compiled code.
+ * <p>
+ * The compiler manipulates {@link com.oracle.max.cri.ci.CiValue} instances that have a {@link com.oracle.max.cri.ci.CiKind}, and are
+ * immutable. A concrete {@link com.oracle.max.cri.ci.CiValue value} is one of the following subclasses:
+ * <ul>
+ * <li>{@link com.oracle.max.cri.ci.CiConstant}: a constant value.
+ * <li>{@link com.oracle.max.cri.ci.CiRegisterValue}: a value stored in a {@linkplain com.oracle.max.cri.ci.CiRegister target machine register}.
+ * <li>{@link com.oracle.max.cri.ci.CiStackSlot}: a spill slot or an outgoing stack-based argument in a method's frame.
+ * <li>{@link com.oracle.max.cri.ci.CiAddress}: an address in target machine memory.
+ * <li>{@link com.oracle.max.cri.ci.CiVariable}: a value (cf. virtual register) that is yet to be bound to a target machine location (physical register or memory address).
+ *</ul>
+ */
+package com.oracle.max.cri.ci;
+
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/package-info.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/package-info.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,9 +26,9 @@
  * Specifically, this package defines an interface between the compiler and the runtime system of a virtual machine for
  * the instruction set defined in {@link com.oracle.max.graal.compiler.graphbuilder.Bytecodes}. The interface has three components:
  * <ol>
- * <li>the {@link com.sun.cri.ci compiler-provided interface} that must be used by the runtime.
- * <li>the {@link com.sun.cri.ri runtime-provided interface} that must be used by the compiler.
- * <li>the {@link com.sun.cri.xir XIR interface} for translating object operations.
+ * <li>the {@link com.oracle.max.cri.ci compiler-provided interface} that must be used by the runtime.
+ * <li>the {@link com.oracle.max.cri.ri runtime-provided interface} that must be used by the compiler.
+ * <li>the {@link com.oracle.max.cri.xir XIR interface} for translating object operations.
  * </ol>
  *
  * The interface is independent of any particular compiler or runtime implementation.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiCompiledMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+/**
+ * Represents a compiled instance of a method. It may have been invalidated or removed in the meantime.
+ */
+public interface RiCompiledMethod {
+
+    /**
+     * Returns the method to which the compiled code belongs.
+     * @return the method to which the compiled code belongs.
+     */
+    RiResolvedMethod method();
+
+    /**
+     * @return true if the code represented by this object is still valid, false otherwise (may happen due to deopt, etc.)
+     */
+    boolean isValid();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiConstantPool.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+/**
+ * Represents the runtime representation of the constant pool that is
+ * used by the compiler when parsing bytecode. The {@code lookupXXX} methods look up a constant
+ * pool entry without performing resolution, and are used during compilation.
+ */
+public interface RiConstantPool {
+
+    /**
+     * Makes sure that the type referenced by the specified constant pool entry is loaded and
+     * initialized. This can be used to compile time resolve a type. It works for field, method,
+     * or type constant pool entries.
+     * @param cpi the index of the constant pool entry that references the type
+     * @param opcode the opcode of the instruction that references the type
+     */
+    void loadReferencedType(int cpi, int opcode);
+
+    /**
+     * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks
+     * specific to the JVM instruction it denotes are performed if the field is already resolved.
+     * Should any of these checks fail, an {@linkplain RiField#isResolved() unresolved}
+     * field reference is returned.
+     *
+     * @param cpi the constant pool index
+     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
+     * @return a reference to the field at {@code cpi} in this pool
+     * @throws ClassFormatError if the entry at {@code cpi} is not a field
+     */
+    RiField lookupField(int cpi, int opcode);
+
+    /**
+     * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks
+     * specific to the JVM instruction it denotes are performed if the method is already resolved.
+     * Should any of these checks fail, an {@linkplain RiMethod#isResolved() unresolved}
+     * method reference is returned.
+     *
+     * @param cpi the constant pool index
+     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
+     * @return a reference to the method at {@code cpi} in this pool
+     * @throws ClassFormatError if the entry at {@code cpi} is not a method
+     */
+    RiMethod lookupMethod(int cpi, int opcode);
+
+    /**
+     * Looks up a reference to a type. If {@code opcode} is non-negative, then resolution checks
+     * specific to the JVM instruction it denotes are performed if the type is already resolved.
+     * Should any of these checks fail, an {@linkplain RiType#isResolved() unresolved}
+     * type reference is returned.
+     *
+     * @param cpi the constant pool index
+     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
+     * @return a reference to the compiler interface type
+     */
+    RiType lookupType(int cpi, int opcode);
+
+    /**
+     * Looks up a method signature.
+     *
+     * @param cpi the constant pool index
+     * @return the method signature at index {@code cpi} in this constant pool
+     */
+    RiSignature lookupSignature(int cpi);
+
+    /**
+     * Looks up a constant at the specified index.
+     * @param cpi the constant pool index
+     * @return the {@code CiConstant} instance representing the constant
+     */
+    Object lookupConstant(int cpi);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiExceptionHandler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+/**
+ * Represents an exception handler within the bytecode.
+ */
+public interface RiExceptionHandler {
+
+    /**
+     * Gets the start bytecode index of the protected range of this handler.
+     * @return the start bytecode index
+     */
+    int startBCI();
+
+    /**
+     * Gets the end bytecode index of the protected range of this handler.
+     * @return the end bytecode index
+     */
+    int endBCI();
+
+    /**
+     * Gets the bytecode index of the handler block of this handler.
+     * @return the handler block bytecode index
+     */
+    int handlerBCI();
+
+    /**
+     * Gets the index into the constant pool representing the type of exception
+     * caught by this handler.
+     * @return the constant pool index of the catch type
+     */
+    int catchTypeCPI();
+
+    /**
+     * Checks whether this handler catches all exceptions.
+     * @return {@code true} if this handler catches all exceptions
+     */
+    boolean isCatchAll();
+
+    /**
+     * The type of exception caught by this exception handler.
+     *
+     * @return the exception type
+     */
+    RiType catchType();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiField.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Represents a reference to a field, including both resolved and unresolved fields. Fields, like methods and types, are
+ * resolved through {@link RiConstantPool constant pools}, and their actual implementation is provided by the
+ * {@link RiRuntime runtime} to the compiler.
+ */
+public interface RiField {
+    /**
+     * Gets the name of this field as a string.
+     * @return the name of this field
+     */
+    String name();
+
+    /**
+     * Gets the type of this field as a compiler-runtime interface type.
+     * @return the type of this field
+     */
+    RiType type();
+
+    /**
+     * Gets the kind of this field.
+     * @param architecture When true, the architecture-specific kind used for emitting machine code is returned.
+     *        When false, the kind according to the Java specification is returned.
+     * @return the kind
+     */
+    CiKind kind(boolean architecture);
+
+    /**
+     * Gets the holder of this field as a compiler-runtime interface type.
+     * @return the holder of this field
+     */
+    RiType holder();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+/**
+ * Represents resolved and unresolved methods. Methods, like fields and types, are resolved through
+ * {@link RiConstantPool constant pools}, and their actual implementation is provided by the {@link RiRuntime runtime}
+ * to the compiler.
+ */
+public interface RiMethod {
+
+    /**
+     * Gets the name of the method as a string.
+     * @return the name of the method
+     */
+    String name();
+
+    /**
+     * Gets the type in which this method is declared.
+     * @return the type in which this method is declared
+     */
+    RiType holder();
+
+    /**
+     * Gets the signature of the method.
+     * @return the signature of the method
+     */
+    RiSignature signature();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRegisterAttributes.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,97 @@
+/*
+ * 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.max.cri.ri;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * A collection of register attributes. The specific attribute values for a register may be
+ * local to a compilation context. For example, a {@link RiRegisterConfig} in use during
+ * a compilation will determine which registers are callee saved.
+ */
+public class RiRegisterAttributes {
+
+    /**
+     * 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 RiRegisterAttributes(boolean isCallerSave, boolean isCalleeSave, boolean isAllocatable) {
+        this.isCallerSave = isCallerSave;
+        this.isCalleeSave = isCalleeSave;
+        this.isAllocatable = isAllocatable;
+    }
+
+    public static final RiRegisterAttributes NONE = new RiRegisterAttributes(false, false, false);
+
+    /**
+     * Creates a map from register {@linkplain CiRegister#number numbers} to register
+     * {@linkplain RiRegisterAttributes 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 RiRegisterAttributes[] createMap(RiRegisterConfig registerConfig, CiRegister[] registers) {
+        RiRegisterAttributes[] map = new RiRegisterAttributes[registers.length];
+        for (CiRegister reg : registers) {
+            if (reg != null) {
+                CiCalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
+                RiRegisterAttributes attr = new RiRegisterAttributes(
+                                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.max.cri/src/com/oracle/max/cri/ri/RiRegisterConfig.java	Tue Jan 03 16:29:28 2012 +0100
@@ -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.max.cri.ri;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiCallingConvention.*;
+import com.oracle.max.cri.ci.CiRegister.*;
+
+/**
+ * A register configuration binds roles and {@linkplain RiRegisterAttributes attributes}
+ * to physical registers.
+ */
+public interface RiRegisterConfig {
+
+    /**
+     * Gets the register to be used for returning a value of a given kind.
+     */
+    CiRegister getReturnRegister(CiKind 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, CiKind[] 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 RiRegisterAttributes 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[])
+     */
+    RiRegisterAttributes[] 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);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedField.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Represents a reference to a resolved field. Fields, like methods and types, are
+ * resolved through {@link RiConstantPool constant pools}, and their actual implementation is provided by the
+ * {@link RiRuntime runtime} to the compiler.
+ */
+public interface RiResolvedField extends RiField {
+
+    /**
+     * Gets the access flags for this field. Only the flags specified in the JVM specification
+     * will be included in the returned mask. The utility methods in the {@link Modifier} class
+     * should be used to query the returned mask for the presence/absence of individual flags.
+     * @return the mask of JVM defined field access flags defined for this field
+     */
+    int accessFlags();
+
+    /**
+     * Gets the constant value of this field if available.
+     * @param receiver object from which this field's value is to be read. This value is ignored if this field is static.
+     * @return the constant value of this field or {@code null} if the constant value is not available
+     */
+    CiConstant constantValue(CiConstant receiver);
+
+    /**
+     * Gets the holder of this field as a compiler-runtime interface type.
+     * @return the holder of this field
+     */
+    RiResolvedType holder();
+
+    /**
+     * Returns this field's annotation of a specified type.
+     *
+     * @param annotationClass the Class object corresponding to the annotation type
+     * @return the annotation of type {@code annotationClass} for this field if present, else null
+     */
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+
+
+/**
+ * Represents resolved methods. Methods, like fields and types, are resolved through
+ * {@link RiConstantPool constant pools}, and their actual implementation is provided by the {@link RiRuntime runtime}
+ * to the compiler.
+ */
+public interface RiResolvedMethod extends RiMethod {
+
+    /**
+     * Gets the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
+     * @return the bytecode of the method or {@code null} if none is available
+     */
+    byte[] code();
+
+    /**
+     * Gets the size of the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
+     * @return the size of the bytecode in bytes, or 0 if no bytecode is available
+     */
+    int codeSize();
+
+    /**
+     * Gets the symbol used to link this method if it is native, otherwise {@code null}.
+     */
+    String jniSymbol();
+
+    /**
+     * Gets the type in which this method is declared.
+     * @return the type in which this method is declared
+     */
+    RiResolvedType holder();
+
+    /**
+     * Gets the maximum number of locals used in this method's bytecode.
+     * @return the maximum number of locals
+     */
+    int maxLocals();
+
+    /**
+     * Gets the maximum number of stack slots used in this method's bytecode.
+     * @return the maximum number of stack slots
+     */
+    int maxStackSize();
+
+    /**
+     * Checks whether this method has balanced monitor operations.
+     * @return {@code true} if the method has balanced monitor operations
+     */
+    boolean hasBalancedMonitors();
+
+    /**
+     * Gets the access flags for this method. Only the flags specified in the JVM specification
+     * will be included in the returned mask. The utility methods in the {@link Modifier} class
+     * should be used to query the returned mask for the presence/absence of individual flags.
+     * @return the mask of JVM defined method access flags defined for this method
+     */
+    int accessFlags();
+
+    /**
+     * Checks whether this method is a leaf method.
+     * @return {@code true} if the method is a leaf method (that is, is final or private)
+     */
+    boolean isLeafMethod();
+
+    /**
+     * Checks whether this method is a class initializer.
+     * @return {@code true} if the method is a class initializer
+     */
+    boolean isClassInitializer();
+
+    /**
+     * Checks whether this method is a constructor.
+     * @return {@code true} if the method is a constructor
+     */
+    boolean isConstructor();
+
+    /**
+     * Checks whether this method has been overridden. Decisions made based
+     * on a method being overridden must be registered as dependencies.
+     * @return {@code true} if the method has been overridden
+     */
+    boolean isOverridden();
+
+    /**
+     * Checks whether the compiler can insert safepoint polls in this method.
+     * @return {@code true} if the method cannot have safepoint polls inserted
+     */
+    boolean noSafepointPolls();
+
+    /**
+     * Gets a map from bytecode indexes to bit maps denoting the live locals at that position.
+     * If a non-null array is return, its length is guaranteed to be equal to {@code code().length}.
+     *
+     * @return the liveness map if it is available; {@code null} otherwise
+     */
+    CiBitMap[] livenessMap();
+
+    /**
+     * Checks whether this method can be statically bound (that is, it is final or private or static).
+     * @return {@code true} if this method can be statically bound
+     */
+    boolean canBeStaticallyBound();
+
+    /**
+     * Gets the list of exception handlers for this method.
+     * @return the list of exception handlers
+     */
+    RiExceptionHandler[] exceptionHandlers();
+
+    /**
+     * Gets a stack trace element for this method and a given bytecode index.
+     */
+    StackTraceElement toStackTraceElement(int bci);
+
+    /**
+     * Temporary work-around to support the @ACCESSOR Maxine annotation.
+     * Non-Maxine VMs should just return {@code null}.
+     */
+    RiResolvedType accessor();
+
+    /**
+     * Gets the intrinsic id of this method.
+     */
+    String intrinsic();
+
+    /**
+     * Provides an estimate of how often this method has been executed.
+     * @return The number of invocations, or -1 if this information isn't available.
+     */
+    int invocationCount();
+
+    /**
+     * Returns an estimate of hot often an exception was seen at the given bytecode.
+     * @return The estimate in percent (0-100), with 0 meaning never and 100 meaning always, or -1 if this information isn't available.
+     */
+    int exceptionProbability(int bci);
+
+    /**
+     * Returns the type profile of the instruction at the given byte code index.
+     * @return The RiTypeProfile information, or null if it isn't available.
+     */
+    RiTypeProfile typeProfile(int bci);
+
+    /**
+     * Returns an estimate of how often the branch at the given byte code was taken.
+     * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or -1 if this information isn't available.
+     */
+    double branchProbability(int bci);
+
+    /**
+     * Returns an estimate of how often the branches of the switch at the given byte code were taken.
+     * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or NULL if this information isn't available.
+     * The default case is specified at the last index.
+     */
+    double[] switchProbability(int bci);
+
+    /**
+     * Returns a map that the compiler can use to store objects that should survive the current compilation.
+     */
+    Map<Object, Object> compilerStorage();
+
+    /**
+     * Returns a pointer to the method's constant pool.
+     * @return the constant pool
+     */
+    RiConstantPool getConstantPool();
+
+    /**
+     * Returns this method's annotation of a specified type.
+     *
+     * @param annotationClass the Class object corresponding to the annotation type
+     * @return the annotation of type {@code annotationClass} for this method if present, else null
+     */
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+
+    /**
+     * Returns an array of arrays that represent the annotations on the formal
+     * parameters, in declaration order, of this method.
+     *
+     * @see Method#getParameterAnnotations()
+     * @see CiUtil#getParameterAnnotation(int, RiResolvedMethod)
+     */
+    Annotation[][] getParameterAnnotations();
+
+    /**
+     * Returns an array of {@link Type} objects that represent the formal
+     * parameter types, in declaration order, of this method.
+     *
+     * @see Method#getGenericParameterTypes()
+     */
+    Type[] getGenericParameterTypes();
+
+    /**
+     * Returns a {@link Type} object that represents the formal return type of this method.
+     *
+     * @see Method#getGenericReturnType()
+     */
+    Type getGenericReturnType();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedType.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Represents a resolved in the compiler-runtime interface. Types include primitives, objects, {@code void},
+ * and arrays thereof. Types, like fields and methods, are resolved through {@link RiConstantPool constant pools}, and
+ * their actual implementation is provided by the {@link RiRuntime runtime} to the compiler.
+ */
+public interface RiResolvedType extends RiType {
+
+    /**
+     * Gets the encoding of (that is, a constant representing the value of) the specified part of this type.
+     * @param r the part of the this type
+     * @return a constant representing a reference to the specified part of this type
+     */
+    CiConstant getEncoding(Representation r);
+
+    /**
+     * Checks whether this type has any subclasses so far. Any decisions
+     * based on this information require the registration of a dependency, since
+     * this information may change.
+     * @return {@code true} if this class has subclasses
+     */
+    boolean hasSubclass();
+
+    /**
+     * Checks whether this type has a finalizer method.
+     * @return {@code true} if this class has a finalizer
+     */
+    boolean hasFinalizer();
+
+    /**
+     * Checks whether this type has any finalizable subclasses so far. Any decisions
+     * based on this information require the registration of a dependency, since
+     * this information may change.
+     * @return {@code true} if this class has any subclasses with finalizers
+     */
+    boolean hasFinalizableSubclass();
+
+    /**
+     * Checks whether this type is an interface.
+     * @return {@code true} if this type is an interface
+     */
+    boolean isInterface();
+
+    /**
+     * Checks whether this type is an instance class.
+     * @return {@code true} if this type is an instance class
+     */
+    boolean isInstanceClass();
+
+    /**
+     * Checks whether this type is an array class.
+     * @return {@code true} if this type is an array class
+     */
+    boolean isArrayClass();
+
+    /**
+     * Gets the access flags for this type. Only the flags specified in the JVM specification
+     * will be included in the returned mask. The utility methods in the {@link Modifier} class
+     * should be used to query the returned mask for the presence/absence of individual flags.
+     * @return the mask of JVM defined class access flags defined for this type
+     */
+    int accessFlags();
+
+    /**
+     * Checks whether this type is initialized.
+     * @return {@code true} if this type is initialized
+     */
+    boolean isInitialized();
+
+    /**
+     * Checks whether this type is a subtype of another type.
+     * @param other the type to test
+     * @return {@code true} if this type a subtype of the specified type
+     */
+    boolean isSubtypeOf(RiResolvedType other);
+
+    /**
+     * Checks whether the specified object is an instance of this type.
+     * @param obj the object to test
+     * @return {@code true} if the object is an instance of this type
+     */
+    boolean isInstance(CiConstant obj);
+
+    /**
+     * Attempts to get an exact type for this type. Final classes,
+     * arrays of final classes, and primitive types all have exact types.
+     * @return the exact type of this type, if it exists; {@code null} otherwise
+     */
+    RiResolvedType exactType();
+
+    /**
+     * Gets the super type of this type or {@code null} if no such type exists.
+     */
+    RiResolvedType superType();
+
+    /**
+     * Attempts to get the unique concrete subtype of this type.
+     * @return the exact type of this type, if it exists; {@code null} otherwise
+     */
+    RiResolvedType uniqueConcreteSubtype();
+
+    /**
+     * For array types, gets the type of the components.
+     * @return the component type of this array type
+     */
+    RiResolvedType componentType();
+
+    /**
+     * Gets the type representing an array with elements of this type.
+     * @return a new compiler interface type representing an array of this type
+     */
+    RiResolvedType arrayOf();
+
+    /**
+     * Resolves the method implementation for virtual dispatches on objects
+     * of this dynamic type.
+     * @param method the method to select the implementation of
+     * @return the method implementation that would be selected at runtime
+     */
+    RiResolvedMethod resolveMethodImpl(RiResolvedMethod method);
+
+    /**
+     * Given an RiMethod a, returns a concrete RiMethod b that is the only possible
+     * unique target for a virtual call on a(). Returns {@code null} if either no
+     * such concrete method or more than one such method exists. Returns the method a
+     * if a is a concrete method that is not overridden. If the compiler uses the
+     * result of this method for its compilation, it must register an assumption
+     * (see {@link CiAssumptions}), because dynamic class loading can invalidate
+     * the result of this method.
+     * @param method the method a for which a unique concrete target is searched
+     * @return the unique concrete target or {@code null} if no such target exists
+     *         or assumptions are not supported by this runtime
+     */
+    RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method);
+
+    /**
+     * Returns the instance fields declared in this class sorted by field offset.
+     * @return an array of instance fields
+     */
+    RiResolvedField[] declaredFields();
+
+    /**
+     * Returns this type's annotation of a specified type.
+     *
+     * @param annotationClass the Class object corresponding to the annotation type
+     * @return the annotation of type {@code annotationClass} for this type if present, else null
+     */
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+
+    /**
+     * Returns the java.lang.Class object representing this RiType instance or {@code null} if none exists.
+     * @return the java.lang.Class object
+     */
+    Class<?> toJava();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiRuntime.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+import java.lang.reflect.*;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Encapsulates the main functionality of the runtime for the compiler, including access
+ * to constant pools, OSR frames, inlining requirements, and runtime calls such as checkcast.
+s */
+public interface RiRuntime {
+
+    /**
+     * Offset of the lock within the lock object on the stack.
+
+     * Note: superseded by sizeOfLockData() in Graal.
+     *
+     * @return the offset in bytes
+     */
+    int basicObjectLockOffsetInBytes();
+
+    /**
+     * Get the size in bytes of a lock object on the stack.
+     *
+     * Note: superseded by sizeOfLockData() in Graal.
+     */
+    int sizeOfBasicObjectLock();
+
+    /**
+     * Get the size in bytes for locking information on the stack.
+     */
+    int sizeOfLockData();
+
+    /**
+     * The offset of the normal entry to the code. The compiler inserts NOP instructions to satisfy this constraint.
+     *
+     * @return the code offset in bytes
+     */
+    int codeOffset();
+
+    /**
+     * Returns the disassembly of the given code bytes. Used for debugging purposes only.
+     *
+     * @param code the code bytes that should be disassembled
+     * @param address an address at which the bytes are located. This can be used for an address prefix per line of disassembly.
+     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
+     */
+    String disassemble(byte[] code, long address);
+
+    /**
+     * Returns the disassembly of the given code bytes. Used for debugging purposes only.
+     *
+     * @param targetMethod the {@link CiTargetMethod} containing the code bytes that should be disassembled
+     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
+     */
+    String disassemble(CiTargetMethod targetMethod);
+
+    /**
+     * Returns the disassembly of the given method in a {@code javap}-like format.
+     * Used for debugging purposes only.
+     *
+     * @param method the method that should be disassembled
+     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
+     */
+    String disassemble(RiResolvedMethod method);
+
+    /**
+     * Registers the given compiler stub and returns an object that can be used to identify it in the relocation
+     * information.
+     *
+     * @param targetMethod the target method representing the code of the compiler stub
+     * @param name the name of the stub, used for debugging purposes only
+     * @return the identification object
+     */
+    Object registerCompilerStub(CiTargetMethod targetMethod, String name);
+
+    /**
+     * Returns the RiType object representing the base type for the given kind.
+     */
+    RiResolvedType asRiType(CiKind kind);
+
+    /**
+     * Returns the type of the given constant object.
+     *
+     * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()}
+     */
+    RiResolvedType getTypeOf(CiConstant constant);
+
+
+    RiResolvedType getType(Class<?> clazz);
+
+    /**
+     * Returns true if the given type is a subtype of java/lang/Throwable.
+     */
+    boolean isExceptionType(RiResolvedType type);
+
+    /**
+     * Used by the canonicalizer to compare objects, since a given runtime might not want to expose the real objects to the compiler.
+     *
+     * @return true if the two parameters represent the same runtime object, false otherwise
+     */
+    boolean areConstantObjectsEqual(CiConstant x, CiConstant y);
+
+    /**
+     * Gets the register configuration to use when compiling a given method.
+     *
+     * @param method the top level method of a compilation
+     */
+    RiRegisterConfig getRegisterConfig(RiMethod method);
+
+    /**
+     * Custom area on the stack of each compiled method that the VM can use for its own purposes.
+     * @return the size of the custom area in bytes
+     */
+    int getCustomStackAreaSize();
+
+    /**
+     * Minimum size of the stack area reserved for outgoing parameters. This area is reserved in all cases, even when
+     * the compiled method has no regular call instructions.
+     * @return the minimum size of the outgoing parameter area in bytes
+     */
+    int getMinimumOutgoingSize();
+
+    /**
+     * Gets the length of the array that is wrapped in a CiConstant object.
+     */
+    int getArrayLength(CiConstant array);
+
+    /**
+     * Converts the given CiConstant object to a object.
+     *
+     * @return {@code null} if the conversion is not possible <b>OR</b> {@code c.isNull() == true}
+     */
+    Object asJavaObject(CiConstant c);
+
+    /**
+     * Converts the given CiConstant object to a {@link Class} object.
+     *
+     * @return {@code null} if the conversion is not possible.
+     */
+    Class<?> asJavaClass(CiConstant c);
+
+    /**
+     * Performs any runtime-specific conversion on the object used to describe the target of a call.
+     */
+    Object asCallTarget(Object target);
+
+    /**
+     * 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);
+
+    /**
+     * Provides the {@link RiMethod} for a {@link Method} obtained via reflection.
+     */
+    RiResolvedMethod getRiMethod(Method reflectionMethod);
+
+    /**
+     * Installs some given machine code as the implementation of a given method.
+     *
+     * @param method a method whose executable code is being modified
+     * @param code the code to be executed when {@code method} is called
+     */
+    void installMethod(RiMethod method, CiTargetMethod code);
+
+    /**
+     * Adds the given machine code as an implementation of the given method without making it the default implementation.
+     * @param method a method to which the executable code is begin added
+     * @param code the code to be added
+     * @return a reference to the compiled and ready-to-run code
+     */
+    RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiSignature.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Represents a method signature provided by the runtime.
+ *
+ * @see <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#7035">Method Descriptors</a>
+ */
+public interface RiSignature {
+    /**
+     * Gets the number of arguments in this signature, adding 1 for a receiver if requested.
+     *
+     * @param receiver true if 1 is to be added to the result for a receiver
+     * @return the number of arguments + 1 iff {@code receiver == true}
+     */
+    int argumentCount(boolean receiver);
+
+    /**
+     * Gets the argument type at the specified position. This method will return a
+     * {@linkplain RiType#isResolved() resolved} type if possible but without
+     * triggering any class loading or resolution.
+     *
+     * @param index the index into the parameters, with {@code 0} indicating the first parameter
+     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
+     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
+     *        not care for a resolved type.
+     * @return the {@code index}'th argument type
+     */
+    RiType argumentTypeAt(int index, RiType accessingClass);
+
+    /**
+     * Gets the argument kind at the specified position.
+     * @param index the index into the parameters, with {@code 0} indicating the first parameter
+     * @param architecture When true, the architecture-specific kind used for emitting machine code is returned.
+     *        When false, the kind according to the Java specification is returned.
+     * @return the kind of the argument at the specified position
+     */
+    CiKind argumentKindAt(int index, boolean architecture);
+
+    /**
+     * Gets the return type of this signature. This method will return a
+     * {@linkplain RiResolvedType resolved} type if possible but without
+     * triggering any class loading or resolution.
+     *
+     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
+     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
+     *        not care for a resolved type.
+     * @return the compiler interface type representing the return type
+     */
+    RiType returnType(RiType accessingClass);
+
+    /**
+     * Gets the return kind of this signature.
+     * @param architectureSpecific When true, the architecture-specific kind used for emitting machine code is returned.
+     *        When false, the kind according to the Java specification is returned.
+     * @return the return kind
+     */
+    CiKind returnKind(boolean architectureSpecific);
+
+    /**
+     * Converts this signature to a string.
+     * @return the signature as a string
+     */
+    String asString();
+
+    /**
+     * Gets the size, in Java slots, of the arguments to this signature.
+     * @param withReceiver {@code true} if to add a slot for a receiver object; {@code false} not to include the receiver
+     * @return the size of the arguments in slots
+     */
+    int argumentSlots(boolean withReceiver);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiType.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Represents a resolved or unresolved type in the compiler-runtime interface. Types include primitives, objects, {@code void},
+ * and arrays thereof.
+ */
+public interface RiType {
+
+    /**
+     * Represents each of the several different parts of the runtime representation of
+     * a type which compiled code may need to reference individually. These may or may not be
+     * different objects or data structures, depending on the runtime system.
+     */
+    public enum Representation {
+        /**
+         * The runtime representation of the data structure containing the static fields of this type.
+         */
+        StaticFields,
+
+        /**
+         * The runtime representation of the Java class object of this type.
+         */
+        JavaClass,
+
+        /**
+         * The runtime representation of the "hub" of this type--that is, the closest part of the type
+         * representation which is typically stored in the object header.
+         */
+        ObjectHub,
+
+        /**
+         * The runtime representation of the type information for an object, which is typically used
+         * for subtype tests.
+         */
+        TypeInfo
+    }
+
+    /**
+     * Gets the name of this type in internal form. The following are examples of strings returned by this method:
+     * <pre>
+     *     "Ljava/lang/Object;"
+     *     "I"
+     *     "[[B"
+     * </pre>
+     *
+     * @return the name of this type in internal form
+     */
+    String name();
+
+    /**
+     * For array types, gets the type of the components.
+     * @return the component type of this array type
+     */
+    RiType componentType();
+
+    /**
+     * Gets the type representing an array with elements of this type.
+     * @return a new compiler interface type representing an array of this type
+     */
+    RiType arrayOf();
+
+    /**
+     * Gets the kind of this compiler interface type.
+     * @param architecture When true, the architecture-specific kind used for emitting machine code is returned.
+     *        When false, the kind according to the Java specification is returned.
+     * @return the kind
+     */
+    CiKind kind(boolean architecture);
+
+    /**
+     * Gets the kind used to represent the specified part of this type.
+     * @param r the part of the this type
+     * @return the kind of constants for the specified part of the type
+     */
+    CiKind getRepresentationKind(Representation r);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiTypeProfile.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.ri;
+
+import java.io.*;
+
+/**
+ * This profile object represents the type profile of one call site, cast or instanceof instruction. The precision of
+ * the supplied values may vary, but a runtime that provides this information should be aware that it will be used to
+ * guide performance-critical decisions like speculative inlining, etc.
+ */
+public class RiTypeProfile implements Serializable {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -6877016333706838441L;
+
+    /**
+     * How often the instruction was executed, which may be used to judge the maturity of this profile.
+     */
+    public int count;
+
+    /**
+     * An estimation of how many different receiver types were encountered. This may or may not be the same as
+     * probabilities.length/types.length, as the runtime may store probabilities for a limited number of receivers.
+     */
+    public int morphism;
+
+    /**
+     * A list of receivers for which the runtime has recorded probability information. This array needs to have the same
+     * length as {@link RiTypeProfile#probabilities}.
+     */
+    public RiResolvedType[] types;
+
+    /**
+     * The estimated probabilities of the different receivers. This array needs to have the same length as
+     * {@link RiTypeProfile#types}.
+     */
+    public float[] probabilities;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/package-info.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+/**
+ * The runtime-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.max.graal.compiler.graphbuilder.Bytecodes}.
+ * <p>
+ * Unlike the {@link com.oracle.max.cri.ci compiler-provided interface}, the runtime-provided interface is specified largely
+ * using interfaces, that must be implemented by classes provided by a specific runtime implementation.
+ * <p>
+ * {@link com.oracle.max.cri.ri.RiRuntime} encapsulates the main functionality of the runtime for the compiler.
+ * <p>
+ * Types (i.e., primitives, classes and interfaces}, fields and methods are represented by {@link com.oracle.max.cri.ri.RiType},
+ * {@link com.oracle.max.cri.ri.RiField} and {@link com.oracle.max.cri.ri.RiMethod}, respectively, with additional support from
+ * {@link com.oracle.max.cri.ri.RiSignature} and {@link com.oracle.max.cri.ri.RiExceptionHandler}. Access to the runtime constant pool
+ * is through {@link com.oracle.max.cri.ri.RiConstantPool}.
+ */
+package com.oracle.max.cri.ri;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,989 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.xir;
+
+import static com.oracle.max.cri.xir.CiXirAssembler.XirOp.*;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiAddress.*;
+import com.oracle.max.cri.ri.*;
+
+/**
+ * Represents an assembler that allows a client such as the runtime system to
+ * create {@link XirTemplate XIR templates}.
+ */
+public abstract class CiXirAssembler {
+
+    protected XirOperand resultOperand;
+    protected boolean allocateResultOperand;
+
+    protected final List<XirInstruction> instructions = new ArrayList<>();
+    protected final List<XirLabel> labels = new ArrayList<>(5);
+    protected final List<XirParameter> parameters = new ArrayList<>(5);
+    protected final List<XirTemp> temps = new ArrayList<>(5);
+    protected final List<XirConstant> constants = new ArrayList<>(5);
+    protected final List<XirMark> marks = new ArrayList<>(5);
+
+    protected int outgoingStackSize = 0;
+
+    /**
+     * Increases by one for every {@link XirOperand operand} created.
+     */
+    protected int variableCount;
+
+    /**
+     * Marks the assembly complete.
+     */
+    protected boolean finished = true;
+
+    protected final CiTarget target;
+
+    public CiXirAssembler(CiTarget target) {
+        this.target = target;
+    }
+
+    public static class RuntimeCallInformation {
+        public final Object target;
+        public final boolean useInfoAfter;
+
+        public RuntimeCallInformation(Object target, boolean useInfoAfter) {
+            this.target = target;
+            this.useInfoAfter = useInfoAfter;
+        }
+    }
+
+    /**
+     * Represents additional address calculation information.
+     */
+    public static final class AddressAccessInformation {
+
+        /**
+         * The scaling factor for the scaled-index part of an address computation.
+         */
+        public final Scale scale;
+
+        /**
+         * The constant byte-sized displacement part of an address computation.
+         */
+        public final int disp;
+
+        /**
+         * Determines if the memory access through the address can trap.
+         */
+        public final boolean canTrap;
+
+        private AddressAccessInformation(boolean canTrap) {
+            this.canTrap = canTrap;
+            this.scale = Scale.Times1;
+            this.disp = 0;
+        }
+
+        private AddressAccessInformation(boolean canTrap, int disp) {
+            this.canTrap = canTrap;
+            this.scale = Scale.Times1;
+            this.disp = disp;
+        }
+
+        private AddressAccessInformation(boolean canTrap, int disp, Scale scale) {
+            this.canTrap = canTrap;
+            this.scale = scale;
+            this.disp = disp;
+        }
+    }
+
+    /**
+     * A label that is the target of a control flow instruction.
+     */
+    public static final class XirLabel {
+        public static final String TrueSuccessor = "TrueSuccessor";
+        public static final String FalseSuccessor = "FalseSuccessor";
+        public final String name;
+        public final int index;
+        /**
+         * If {@code true} the label is to an instruction in the fast path sequence, otherwise to the slow path.
+         */
+        public final boolean inline;
+
+        private XirLabel(String name, int index, boolean inline) {
+            this.name = name;
+            this.index = index;
+            this.inline = inline;
+        }
+
+        @Override
+        public String toString() {
+            return name;
+        }
+    }
+
+    /**
+     * Tagging interface that indicates that an {@link XirOperand} is a constant.
+     */
+    public interface XirConstantOperand {
+        int getIndex();
+    }
+
+    public static final XirOperand VOID = null;
+
+    /**
+     * Operands for {@link XirInstruction instructions}.
+     * There are three basic variants, {@link XirConstant constant}, {@link XirParameter parameter} and {@link XirTemp}.
+     */
+    public abstract static class XirOperand {
+
+        public final CiKind kind;
+
+        /**
+         * Unique id in range {@code 0} to {@link #variableCount variableCount - 1}.
+         */
+        public final int index;
+
+        /**
+         * Value whose {@link #toString()} method provides a name for this operand.
+         */
+        public final Object name;
+
+        public XirOperand(CiXirAssembler asm, Object name, CiKind kind) {
+            this.kind = kind;
+            this.name = name;
+            this.index = asm.variableCount++;
+        }
+
+        @Override
+        public String toString() {
+            return String.valueOf(name);
+        }
+
+        public String detailedToString() {
+
+            StringBuffer sb = new StringBuffer();
+
+            sb.append(name);
+            sb.append('$');
+            sb.append(kind.typeChar);
+            return sb.toString();
+        }
+    }
+
+    /**
+     * Parameters to {@link XirTemplate templates}.
+     */
+    public static class XirParameter extends XirOperand {
+        /**
+         * Unique id in range {@code 0} to {@code parameters.Size()  - 1}.
+         */
+        public final int parameterIndex;
+
+        public final boolean canBeConstant;
+
+        XirParameter(CiXirAssembler asm, String name, CiKind kind, boolean canBeConstant) {
+            super(asm, name, kind);
+            this.parameterIndex = asm.parameters.size();
+            this.canBeConstant = canBeConstant;
+            asm.parameters.add(this);
+        }
+
+    }
+
+    public static class XirConstantParameter extends XirParameter implements XirConstantOperand {
+        XirConstantParameter(CiXirAssembler asm, String name, CiKind kind) {
+            super(asm, name, kind, true);
+        }
+
+        public int getIndex() {
+            return index;
+        }
+    }
+
+    public static class XirVariableParameter extends XirParameter {
+        XirVariableParameter(CiXirAssembler asm, String name, CiKind kind, boolean canBeConstant) {
+            super(asm, name, kind, canBeConstant);
+        }
+    }
+
+    public static class XirConstant extends XirOperand implements XirConstantOperand {
+        public final CiConstant value;
+
+        XirConstant(CiXirAssembler asm, CiConstant value) {
+            super(asm, value, value.kind);
+            this.value = value;
+        }
+
+        public int getIndex() {
+            return index;
+        }
+    }
+
+    public static class XirTemp extends XirOperand {
+        public final boolean reserve;
+
+        XirTemp(CiXirAssembler asm, String name, CiKind kind, boolean reserve) {
+            super(asm, name, kind);
+            this.reserve = reserve;
+        }
+    }
+
+    public static class XirRegister extends XirTemp {
+        public final CiValue register;
+
+        XirRegister(CiXirAssembler asm, String name, CiRegisterValue register, boolean reserve) {
+            super(asm, name, register.kind, reserve);
+            this.register = register;
+        }
+    }
+
+    /**
+     * Start a new assembly with no initial {@link #resultOperand result operand}.
+     */
+    public void restart() {
+        reset();
+        resultOperand = null;
+    }
+
+    /**
+     * Start a new assembly with a {@link #resultOperand result operand} of type {@code kind}.
+     * @param kind the result kind
+     * @return an {@code XirOperand} for the result operand
+     */
+    public XirOperand restart(CiKind kind) {
+        reset();
+        resultOperand = new XirTemp(this, "result", kind, true);
+        allocateResultOperand = true;
+        return resultOperand;
+    }
+
+    /**
+     * Reset the state of the class to the initial conditions to facilitate a new assembly.
+     */
+    private void reset() {
+        assert finished : "must be finished before!";
+        variableCount = 0;
+        allocateResultOperand = false;
+        finished = false;
+        instructions.clear();
+        labels.clear();
+        parameters.clear();
+        temps.clear();
+        constants.clear();
+        marks.clear();
+        outgoingStackSize = 0;
+    }
+
+    /**
+     * Represents an XIR instruction, characterized by an {@link XirOp operation}, a {@link CiKind kind}, an optional {@link XirOperand result}, a variable number of {@link XirOperand arguments},
+     * and some optional instruction-specific state. The {@link #x}, {@link #y} and {@link #z} methods are convenient ways to access the first, second and third
+     * arguments, respectively. Only the {@link XirOp#CallStub} and {@link XirOp#CallRuntime} instructions can have more than three arguments.
+     *
+     */
+    public static final class XirInstruction {
+        /**
+         * The {@link CiKind kind} of values the instruction operates on.
+         */
+        public final CiKind kind;
+        /**
+         * The {@link XirOp operation}.
+         */
+        public final XirOp op;
+        /**
+         * The result, if any.
+         */
+        public final XirOperand result;
+        /**
+         * The arguments.
+         */
+        public final XirOperand[] arguments;
+        /**
+         * Arbitrary additional data associated with the instruction.
+         */
+        public final Object extra;
+
+        public XirInstruction(CiKind kind, XirOp op, XirOperand result, XirOperand... arguments) {
+            this(kind, null, op, result, arguments);
+        }
+
+        public XirInstruction(CiKind kind, Object extra, XirOp op, XirOperand result, XirOperand... arguments) {
+            this.extra = extra;
+            this.kind = kind;
+            this.op = op;
+            this.result = result;
+            this.arguments = arguments;
+        }
+
+        public XirOperand x() {
+            assert arguments.length > 0 : "no x operand for this instruction";
+            return arguments[0];
+        }
+
+        public XirOperand y() {
+            assert arguments.length > 1 : "no y operand for this instruction";
+            return arguments[1];
+        }
+
+        public XirOperand z() {
+            assert arguments.length > 2 : "no z operand for this instruction";
+            return arguments[2];
+        }
+
+        @Override
+        public String toString() {
+            StringBuffer sb = new StringBuffer();
+
+            if (result != null) {
+                sb.append(result.toString());
+                sb.append(" = ");
+            }
+
+            sb.append(op.name());
+
+            if (kind != CiKind.Void) {
+                sb.append('$');
+                sb.append(kind.typeChar);
+            }
+
+            if (arguments != null && arguments.length > 0) {
+                sb.append("(");
+
+                for (int i = 0; i < arguments.length; i++) {
+                    if (i != 0) {
+                        sb.append(", ");
+                    }
+                    sb.append(arguments[i]);
+                }
+
+                sb.append(")");
+            }
+
+            if (extra != null) {
+                sb.append(" ");
+                sb.append(extra);
+            }
+
+            return sb.toString();
+        }
+    }
+
+    /**
+     * These marks let the RiXirGenerator mark positions in the generated native code and bring them in relationship with on another.
+     * This is necessary for code patching, etc.
+     */
+    public static class XirMark {
+        public final XirMark[] references;
+        public final Object id;
+
+        // special mark used to refer to the actual call site of an invoke
+        public static final XirMark CALLSITE = new XirMark(null);
+
+        public XirMark(Object id, XirMark... references) {
+            this.id = id;
+            this.references = references;
+        }
+    }
+
+    /**
+     * The set of opcodes for XIR instructions.
+     * {@link XirInstruction} defines {@code x}, {@code y} and {@code z} as the first, second and third arguments, respectively.
+     * We use these mnemonics, plus {@code args} for the complete set of arguments, {@code r} for the result, and {@code extra}
+     * for the instruction-specific extra data, in the opcode specifications. Note that the opcodes that operate on values do not directly
+     * specify the size (kind) of the data operated on;  this is is encoded in {@link XirInstruction#kind}.
+     * Note: If the instruction kind differs from the argument/result kinds, the behavior is undefined.
+     *
+     */
+    public enum XirOp {
+        /**
+         * Move {@code x} to {@code r}.
+         */
+        Mov,
+        /**
+         * Add {@code y} to {@code x} and put the result in {@code r}.
+         */
+        Add,
+        /**
+         * Subtract {@code y} from {@code x} and put the result in {@code r}.
+         */
+        Sub,
+        /**
+         * Divide {@code y} by {@code x} and put the result in {@code r}.
+         */
+        Div,
+        /**
+         * Multiply {@code y} by {@code x} and put the result in {@code r}.
+         */
+        Mul,
+        /**
+         * {@code y} modulus {@code x} and put the result in {@code r}.
+         */
+        Mod,
+        /**
+         * Shift  {@code y} left by {@code x} and put the result in {@code r}.
+         */
+        Shl,
+        /**
+         * Arithmetic shift  {@code y} right by {@code x} and put the result in {@code r}.
+         */
+        Sar,
+        /**
+         * Shift  {@code y} right by {@code x} and put the result in {@code r}.
+         */
+        Shr,
+        /**
+         * And {@code y} by {@code x} and put the result in {@code r}.
+         */
+        And,
+        /**
+         * Or {@code y} by {@code x} and put the result in {@code r}.
+         */
+        Or,
+        /**
+         * Exclusive Or {@code y} by {@code x} and put the result in {@code r}.
+         */
+        Xor,
+        /**
+         * Null check on {@code x}.
+         */
+        NullCheck,
+        /**
+         * Load value at address {@code x} and put the result in {@code r}.
+         */
+        PointerLoad,
+        /**
+         * Store {@code y} at address {@code x}.
+         */
+        PointerStore,
+        /**
+         * Load value at an effective address defined by base {@code x} and either a scaled index {@code y} plus displacement
+         * or an offset {@code y} and put the result in {@code r}.
+         */
+        PointerLoadDisp,
+        /**
+         * Load an effective address defined by base {@code x} and either a scaled index {@code y} plus displacement
+         * or an offset {@code y} and put the result in {@code r}.
+         */
+        LoadEffectiveAddress,
+        /**
+         * Store {@code z} at address defined by base {@code x} and index {@code y}.
+         */
+        PointerStoreDisp,
+        /**
+         * Repeat move from {@code x} to {@code y} using {@code z} words.
+         */
+        RepeatMoveWords,
+        /**
+         * Repeat move from {@code x} to {@code y} using {@code z} words.
+         */
+        RepeatMoveBytes,
+        /**
+         * Compare value at at address {@code x} with value in {@code y} and store value {@code z} at address {@code x}
+         * if it was equal to {@code y}.
+         */
+        PointerCAS,
+        /**
+         * Call the {@link XirTemplate.GlobalFlags#GLOBAL_STUB shared stub} defined by {@code extra} with {@code args} and put the result in {@code r}.
+         */
+        CallStub,
+        /**
+         * Call the {@link RiMethod} defined by {@code extra}  with {@code args} and put the result in {@code r}.
+         */
+        CallRuntime,
+        /**
+         * Transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jmp,
+       /**
+         * If {@code x == y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jeq,
+        /**
+         * If {@code x != y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jneq,
+        /**
+         * If {@code x > y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jgt,
+        /**
+         * If {@code x >= y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jgteq,
+        /**
+         * If {@code x unsigned >= y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jugteq,
+        /**
+         * If {@code x < y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jlt,
+        /**
+         * If {@code x <= y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jlteq,
+        /**
+         * Decreases the input by one and jumps to the target if the input is not 0.
+         */
+        DecAndJumpNotZero,
+        /**
+         * If bit designated by {@code z} at effective address defined by base {@code x} and offset {@code y}
+         * is set transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
+         */
+        Jbset,
+        /**
+         * Bind the {@link XirLabel label} identified by {@code extra} to the current instruction and update any references to it.
+         * A label may be bound more than once to the same location.
+         */
+        Bind,
+        /**
+         * Record a safepoint.
+         */
+        Safepoint,
+        /**
+         * Align the code following this instruction to a multiple of (int)extra.
+         */
+        Align,
+        /**
+         * Creates the stack banging overflow check.
+         */
+        StackOverflowCheck,
+        /**
+         * Creates the stack frame for the method and spills callee-save registers (if any) to the {@linkplain CiRegisterSaveArea register save area}.
+         */
+        PushFrame,
+        /**
+         * Restores all callee-save registers (if any) and removes the stack frame of the method.
+         */
+        PopFrame,
+        /**
+         * Inserts an array of bytes directly into the code output.
+         */
+        RawBytes,
+        /**
+         * Pushes a value onto the stack.
+         */
+        Push,
+        /**
+         * Pops a value from the stack.
+         */
+        Pop,
+        /**
+         * Marks a position in the generated native code.
+         */
+        Mark,
+        /**
+         * Load instruction pointer of the next instruction in a destination register.
+         */
+        Here,
+        /**
+         * Inserts nop instructions, with the given size in bytes.
+         */
+        Nop,
+        /**
+         * This instruction should never be reached, this is useful for debugging purposes.
+         */
+         ShouldNotReachHere
+    }
+
+    public/*private*/ void append(XirInstruction xirInstruction) {
+        assert !finished : "no instructions can be added to finished template";
+        instructions.add(xirInstruction);
+    }
+
+    public XirLabel createInlineLabel(String name) {
+        final XirLabel result = new XirLabel(name, this.labels.size(), true);
+        labels.add(result);
+        return result;
+    }
+
+    public XirLabel createOutOfLineLabel(String name) {
+        final XirLabel result = new XirLabel(name, this.labels.size(), false);
+        labels.add(result);
+        return result;
+    }
+
+    public void mov(XirOperand result, XirOperand a) {
+        append(new XirInstruction(result.kind, Mov, result, a));
+    }
+
+    public void add(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Add, result, a, b));
+    }
+
+    public void sub(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Sub, result, a, b));
+    }
+
+    public void div(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Div, result, a, b));
+    }
+
+    public void mul(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Mul, result, a, b));
+    }
+
+    public void mod(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Mod, result, a, b));
+    }
+
+    public void shl(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Shl, result, a, b));
+    }
+
+    public void shr(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Shr, result, a, b));
+    }
+
+    public void and(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, And, result, a, b));
+    }
+
+    public void or(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Or, result, a, b));
+    }
+
+    public void xor(XirOperand result, XirOperand a, XirOperand b) {
+        append(new XirInstruction(result.kind, Xor, result, a, b));
+    }
+
+    public void nullCheck(XirOperand pointer) {
+        append(new XirInstruction(CiKind.Object, NullCheck, VOID, pointer));
+    }
+
+    public void pload(CiKind kind, XirOperand result, XirOperand pointer, boolean canTrap) {
+        append(new XirInstruction(kind, canTrap, PointerLoad, result, pointer));
+    }
+
+    public void pstore(CiKind kind, XirOperand pointer, XirOperand value, boolean canTrap) {
+        append(new XirInstruction(kind, canTrap, PointerStore, null, pointer, value));
+    }
+
+    public void pload(CiKind kind, XirOperand result, XirOperand pointer, XirOperand offset, boolean canTrap) {
+        append(new XirInstruction(kind, new AddressAccessInformation(canTrap), PointerLoadDisp, result, pointer, offset));
+    }
+
+    public void pstore(CiKind kind, XirOperand pointer, XirOperand offset, XirOperand value, boolean canTrap) {
+        append(new XirInstruction(kind, new AddressAccessInformation(canTrap), PointerStoreDisp, VOID, pointer, offset, value));
+    }
+
+    public void pload(CiKind kind, XirOperand result, XirOperand pointer, XirOperand index, int disp, Scale scale,  boolean canTrap) {
+        append(new XirInstruction(kind, new AddressAccessInformation(canTrap, disp, scale), PointerLoadDisp, result, pointer, index));
+    }
+
+    public void lea(XirOperand result, XirOperand pointer, XirOperand index, int disp, Scale scale) {
+        append(new XirInstruction(target.wordKind, new AddressAccessInformation(false, disp, scale), LoadEffectiveAddress, result, pointer, index));
+    }
+
+    public void repmov(XirOperand src, XirOperand dest, XirOperand length) {
+        append(new XirInstruction(target.wordKind, null, RepeatMoveWords, null, src, dest, length));
+    }
+
+    public void here(XirOperand dst) {
+        append(new XirInstruction(target.wordKind, null, Here, dst));
+    }
+
+    public void repmovb(XirOperand src, XirOperand dest, XirOperand length) {
+        append(new XirInstruction(target.wordKind, null, RepeatMoveBytes, null, src, dest, length));
+    }
+
+    public void pstore(CiKind kind, XirOperand pointer, XirOperand index, XirOperand value, int disp, Scale scale, boolean canTrap) {
+        append(new XirInstruction(kind, new AddressAccessInformation(canTrap, disp, scale), PointerStoreDisp, VOID, pointer, index, value));
+    }
+
+    public void pcas(CiKind kind, XirOperand result, XirOperand pointer, XirOperand newValue, XirOperand oldValue) {
+        append(new XirInstruction(kind, null, PointerCAS, result, pointer, newValue, oldValue));
+    }
+
+    public void jmp(XirLabel l) {
+        append(new XirInstruction(CiKind.Void, l, Jmp, null));
+    }
+
+    public void decAndJumpNotZero(XirLabel l, XirOperand val) {
+        append(new XirInstruction(CiKind.Void, l, DecAndJumpNotZero, null, val));
+    }
+
+    public void jmpRuntime(Object rt) {
+        append(new XirInstruction(CiKind.Void, rt, Jmp, null));
+    }
+
+    public void jeq(XirLabel l, XirOperand a, XirOperand b) {
+        jcc(Jeq, l, a, b);
+    }
+
+    private void jcc(XirOp op, XirLabel l, XirOperand a, XirOperand b) {
+        append(new XirInstruction(CiKind.Void, l, op, null, a, b));
+    }
+
+    public void jneq(XirLabel l, XirOperand a, XirOperand b) {
+        jcc(Jneq, l, a, b);
+    }
+
+    public void jgt(XirLabel l, XirOperand a, XirOperand b) {
+        jcc(Jgt, l, a, b);
+    }
+
+    public void jgteq(XirLabel l, XirOperand a, XirOperand b) {
+        jcc(Jgteq, l, a, b);
+    }
+
+    public void jugteq(XirLabel l, XirOperand a, XirOperand b) {
+        jcc(Jugteq, l, a, b);
+    }
+
+    public void jlt(XirLabel l, XirOperand a, XirOperand b) {
+        jcc(Jlt, l, a, b);
+    }
+
+    public void jlteq(XirLabel l, XirOperand a, XirOperand b) {
+        jcc(Jlteq, l, a, b);
+    }
+
+    public void jbset(XirLabel l, XirOperand a, XirOperand b, XirOperand c) {
+        append(new XirInstruction(CiKind.Void, l, Jbset, null, a, b, c));
+    }
+
+    public void bindInline(XirLabel l) {
+        assert l.inline;
+        append(new XirInstruction(CiKind.Void, l, Bind, null));
+    }
+
+    public void bindOutOfLine(XirLabel l) {
+        assert !l.inline;
+        append(new XirInstruction(CiKind.Void, l, Bind, null));
+    }
+
+    public void safepoint() {
+        append(new XirInstruction(CiKind.Void, null, Safepoint, null));
+    }
+
+    public void align(int multiple) {
+        assert multiple > 0;
+        append(new XirInstruction(CiKind.Void, multiple, Align, null));
+    }
+
+    public void stackOverflowCheck() {
+        append(new XirInstruction(CiKind.Void, null, StackOverflowCheck, null));
+    }
+
+    public void pushFrame() {
+        append(new XirInstruction(CiKind.Void, null, PushFrame, null));
+    }
+
+    public void popFrame() {
+        append(new XirInstruction(CiKind.Void, null, PopFrame, null));
+    }
+
+    public void rawBytes(byte[] bytes) {
+        append(new XirInstruction(CiKind.Void, bytes, RawBytes, null));
+    }
+
+    public void push(XirOperand value) {
+        append(new XirInstruction(CiKind.Void, Push, VOID, value));
+    }
+
+    public void pop(XirOperand result) {
+        append(new XirInstruction(result.kind, Pop, result));
+    }
+
+    public XirMark mark(Object id, XirMark... references) {
+        XirMark mark = new XirMark(id, references);
+        marks.add(mark);
+        append(new XirInstruction(CiKind.Void, mark, Mark, null));
+        return mark;
+    }
+
+    public void nop(int size) {
+        append(new XirInstruction(CiKind.Void, size, Nop, null));
+    }
+
+    public void shouldNotReachHere() {
+        append(new XirInstruction(CiKind.Void, null, ShouldNotReachHere, null));
+    }
+
+    public void shouldNotReachHere(String message) {
+        append(new XirInstruction(CiKind.Void, message, ShouldNotReachHere, null));
+    }
+
+    public void callStub(XirTemplate stub, XirOperand result, XirOperand... args) {
+        CiKind resultKind = result == null ? CiKind.Void : result.kind;
+        append(new XirInstruction(resultKind, stub, CallStub, result, args));
+    }
+
+    public void callRuntime(Object rt, XirOperand result, XirOperand... args) {
+        callRuntime(rt, result, false, args);
+    }
+
+    public void callRuntime(Object rt, XirOperand result, boolean useInfoAfter, XirOperand... args) {
+        CiKind resultKind = result == null ? CiKind.Void : result.kind;
+        append(new XirInstruction(resultKind, new RuntimeCallInformation(rt, useInfoAfter), CallRuntime, result, args));
+    }
+
+    /**
+     * Terminates the assembly, checking invariants, in particular that {@link resultOperand} is set, and setting {@link #finished} to {@code true}.
+     */
+    private void end() {
+        assert !finished : "template may only be finished once!";
+        assert resultOperand != null : "result operand should be set";
+        finished = true;
+    }
+
+    /**
+     * Creates an {@link XirVariableParameter variable input parameter}  of given name and {@link CiKind kind}.
+     * @param name a name for the parameter
+     * @param kind the parameter kind
+     * @return the  {@link XirVariableParameter}
+     */
+    public XirVariableParameter createInputParameter(String name, CiKind kind, boolean canBeConstant) {
+        assert !finished;
+        return new XirVariableParameter(this, name, kind, canBeConstant);
+    }
+
+    public XirVariableParameter createInputParameter(String name, CiKind kind) {
+        return createInputParameter(name, kind, false);
+    }
+
+    /**
+     * Creates an {@link XirConstantParameter constant input parameter}  of given name and {@link CiKind kind}.
+     * @param name a name for the parameter
+     * @param kind the parameter kind
+     * @return the  {@link XirConstantParameter}
+     */
+    public XirConstantParameter createConstantInputParameter(String name, CiKind kind) {
+        assert !finished;
+        return new XirConstantParameter(this, name, kind);
+    }
+
+    public XirConstant createConstant(CiConstant constant) {
+        assert !finished;
+        XirConstant temp = new XirConstant(this, constant);
+        constants.add(temp);
+        return temp;
+    }
+
+    public XirOperand createTemp(String name, CiKind kind) {
+        assert !finished;
+        XirTemp temp = new XirTemp(this, name, kind, true);
+        temps.add(temp);
+        return temp;
+    }
+
+    public XirOperand createRegister(String name, CiKind kind, CiRegister register) {
+        return createRegister(name, kind, register, false);
+    }
+
+    public XirOperand createRegisterTemp(String name, CiKind kind, CiRegister register) {
+        return createRegister(name, kind, register, true);
+    }
+
+    private XirOperand createRegister(String name, CiKind kind, CiRegister register, boolean reserve) {
+        assert !finished;
+        XirRegister fixed = new XirRegister(this, name, register.asValue(kind), reserve);
+        temps.add(fixed);
+        return fixed;
+    }
+
+    public XirParameter getParameter(String name) {
+        for (XirParameter param : parameters) {
+            if (param.name.toString().equals(name)) {
+                return param;
+            }
+        }
+        throw new IllegalArgumentException("no parameter: " + name);
+    }
+
+    public XirTemp getTemp(String name) {
+        for (XirTemp temp : temps) {
+            if (temp.name.toString().equals(name)) {
+                return temp;
+            }
+        }
+        throw new IllegalArgumentException("no temp: " + name);
+    }
+
+    public XirConstant i(int v) {
+        return createConstant(CiConstant.forInt(v));
+    }
+
+    public XirConstant l(int v) {
+        return createConstant(CiConstant.forLong(v));
+    }
+
+    public XirConstant b(boolean v) {
+        return createConstant(CiConstant.forBoolean(v));
+    }
+
+    public XirConstant o(Object obj) {
+        return createConstant(CiConstant.forObject(obj));
+    }
+
+    public void reserveOutgoingStack(int size) {
+        outgoingStackSize = Math.max(outgoingStackSize, size);
+    }
+
+    /**
+     * Finishes the assembly of a non-stub template, providing the {@link #resultOperand} and constructs the {@link XirTemplate}.
+     * @param result the {@link XirOperand} to be set as the {@link #resultOperand}
+     * @param name the name of the template
+     * @return the generated template
+     */
+    public XirTemplate finishTemplate(XirOperand result, String name) {
+        assert this.resultOperand == null;
+        assert result != null;
+        this.resultOperand = result;
+        final XirTemplate template = buildTemplate(name, false);
+        end();
+        return template;
+    }
+
+    /**
+     * Finishes the assembly of a non-stub template and constructs the {@link XirTemplate}.
+     * @param name the name of the template
+     * @return the generated template
+     */
+    public XirTemplate finishTemplate(String name) {
+        final XirTemplate template = buildTemplate(name, false);
+        end();
+        return template;
+    }
+
+    /**
+     * Finishes the assembly of a {@link XirTemplate.GlobalFlags#GLOBAL_STUB stub} and constructs the {@link XirTemplate}.
+     * @param name the name of the template
+     * @return the generated template
+     */
+    public XirTemplate finishStub(String name) {
+        final XirTemplate template = buildTemplate(name, true);
+        end();
+        return template;
+    }
+
+    /**
+     * Builds the {@link XirTemplate} from the assembly state in this object.
+     * The actual assembly is dependent on the target architecture and implemented
+     * in a concrete subclass.
+     * @param name the name of the template
+     * @param isStub {@code true} if the template represents a {@link XirTemplate.GlobalFlags#GLOBAL_STUB stub}
+     * @return the generated template
+     */
+    protected abstract XirTemplate buildTemplate(String name, boolean isStub);
+
+    public abstract CiXirAssembler copy();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/RiXirGenerator.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.xir;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.*;
+
+/**
+ * Represents the interface through which the compiler requests the XIR for a given bytecode from the runtime system.
+ */
+public interface RiXirGenerator {
+
+    /**
+     * Note: may return {@code null}.
+     */
+    XirSnippet genPrologue(XirSite site, RiResolvedMethod method);
+
+    /**
+     * Note: may return {@code null} in which case the compiler will not emit a return instruction.
+     */
+    XirSnippet genEpilogue(XirSite site, RiResolvedMethod method);
+
+    XirSnippet genSafepointPoll(XirSite site);
+
+    XirSnippet genExceptionObject(XirSite site);
+
+    XirSnippet genResolveClass(XirSite site, RiType type, Representation representation);
+
+    XirSnippet genIntrinsic(XirSite site, XirArgument[] arguments, RiMethod method);
+
+    XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, RiMethod method);
+
+    XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, RiMethod method);
+
+    XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, RiMethod method);
+
+    XirSnippet genInvokeStatic(XirSite site, RiMethod method);
+
+    XirSnippet genMonitorEnter(XirSite site, XirArgument receiver, XirArgument lockAddress);
+
+    XirSnippet genMonitorExit(XirSite site, XirArgument receiver, XirArgument lockAddress);
+
+    XirSnippet genGetField(XirSite site, XirArgument receiver, RiField field);
+
+    XirSnippet genPutField(XirSite site, XirArgument receiver, RiField field, XirArgument value);
+
+    XirSnippet genGetStatic(XirSite site, XirArgument staticTuple, RiField field);
+
+    XirSnippet genPutStatic(XirSite site, XirArgument staticTuple, RiField field, XirArgument value);
+
+    XirSnippet genNewInstance(XirSite site, RiType type);
+
+    XirSnippet genNewArray(XirSite site, XirArgument length, CiKind elementKind, RiType componentType, RiType arrayType);
+
+    XirSnippet genNewObjectArrayClone(XirSite site, XirArgument newLength, XirArgument referenceArray);
+
+    XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType type);
+
+    XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, RiType type);
+
+    XirSnippet genInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, RiType type);
+
+    XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, XirArgument trueValue, XirArgument falseValue, RiType type);
+
+    XirSnippet genArrayLoad(XirSite site, XirArgument array, XirArgument index, CiKind elementKind, RiType elementType);
+
+    XirSnippet genArrayStore(XirSite site, XirArgument array, XirArgument index, XirArgument value, CiKind elementKind, RiType elementType);
+
+    XirSnippet genArrayLength(XirSite site, XirArgument array);
+
+    XirSnippet genWriteBarrier(XirArgument object);
+
+    XirSnippet genArrayCopy(XirSite site, XirArgument src, XirArgument srcPos, XirArgument dest, XirArgument destPos, XirArgument length, RiType elementType, boolean inputsSame, boolean inputsDifferent);
+
+    XirSnippet genCurrentThread(XirSite site);
+
+    XirSnippet genGetClass(XirSite site, XirArgument xirArgument);
+
+    /**
+     * Generates code that checks that the {@linkplain Representation#ObjectHub hub} of
+     * an object is identical to a given hub constant. In pseudo code:
+     * <pre>
+     *     if (object.getHub() != hub) {
+     *         uncommonTrap();
+     *     }
+     * </pre>
+     * This snippet should only be used when the object is guaranteed not to be null.
+     */
+    XirSnippet genTypeCheck(XirSite site, XirArgument object, XirArgument hub, RiType type);
+
+    /**
+     * Gets the list of XIR templates, using the given XIR assembler to create them if
+     * they haven't yet been created.
+     *
+     * @param asm the XIR assembler
+     * @return the list of templates
+     */
+    List<XirTemplate> makeTemplates(CiXirAssembler asm);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirArgument.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.xir;
+
+import com.oracle.max.cri.ci.*;
+
+/**
+ * Represents an argument to an {@link XirSnippet}.
+ * Currently, this is a <i>union </i> type; it is either a {@link CiConstant} or an {@code Object}.
+ */
+public final class XirArgument {
+
+    public final CiConstant constant;
+    public final Object object;
+
+    private XirArgument(CiConstant value) {
+        this.constant = value;
+        this.object = null;
+    }
+
+    private XirArgument(Object o) {
+        this.constant = null;
+        this.object = o;
+    }
+
+    public static XirArgument forInternalObject(Object o) {
+        return new XirArgument(o);
+    }
+
+    public static XirArgument forInt(int x) {
+        return new XirArgument(CiConstant.forInt(x));
+    }
+
+    public static XirArgument forLong(long x) {
+        return new XirArgument(CiConstant.forLong(x));
+    }
+
+    public static XirArgument forObject(Object o) {
+        return new XirArgument(CiConstant.forObject(o));
+    }
+
+    @Override
+    public String toString() {
+        if (constant != null) {
+            return constant.toString();
+        } else {
+            return "" + object;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSite.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.xir;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+
+/**
+ * Encapsulates the notion of a site where XIR can be supplied. It is supplied to the {@link RiXirGenerator} by the
+ * compiler for each place where XIR can be generated. This interface allows a number of queries, including the
+ * bytecode-level location and optimization hints computed by the compiler.
+ */
+public interface XirSite {
+
+    /**
+     * Gets the {@link CiCodePos code position} associated with this site. This is useful for inserting
+     * instrumentation at the XIR level.
+     * @return the code position if it is available; {@code null} otherwise
+     */
+    CiCodePos getCodePos();
+
+    /**
+     * Checks whether the specified argument is guaranteed to be non-null at this site.
+     * @param argument the argument
+     * @return {@code true} if the argument is non null at this site
+     */
+    boolean isNonNull(XirArgument argument);
+
+    /**
+     * Checks whether this site requires a null check.
+     * @return {@code true} if a null check is required
+     */
+    boolean requiresNullCheck();
+
+    /**
+     * Checks whether this site requires a range check.
+     * @return {@code true} if a range check is required
+     */
+    boolean requiresBoundsCheck();
+
+    /**
+     * Checks whether this site requires a read barrier.
+     * @return {@code true} if a read barrier is required
+     */
+    boolean requiresReadBarrier();
+
+    /**
+     * Checks whether this site requires a write barrier.
+     * @return {@code true} if a write barrier is required
+     */
+    boolean requiresWriteBarrier();
+
+    /**
+     * Checks whether this site requires an array store check.
+     * @return {@code true} if an array store check is required
+     */
+    boolean requiresArrayStoreCheck();
+
+    /**
+     * Checks whether an approximation of the type for the specified argument is available.
+     * @param argument the argument
+     * @return an {@link RiType} indicating the most specific type known for the argument, if any;
+     * {@code null} if no particular type is known
+     */
+    RiType getApproximateType(XirArgument argument);
+
+    /**
+     * Checks whether an exact type is known for the specified argument.
+     * @param argument the argument
+     * @return an {@link RiType} indicating the exact type known for the argument, if any;
+     * {@code null} if no particular type is known
+     */
+    RiType getExactType(XirArgument argument);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSnippet.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.xir;
+
+import java.util.*;
+
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
+
+/**
+ * Represents a {@link XirTemplate template of XIR} along with the {@link XirArgument arguments} to be passed to the
+ * template. The runtime generates such snippets for each bytecode being compiled at the request of the compiler, and
+ * the compiler can generate machine code for the XIR snippet.
+ */
+public class XirSnippet {
+
+    public final XirArgument[] arguments;
+    public final XirTemplate template;
+    public final Map<XirMark, Mark> marks;
+
+    public XirSnippet(XirTemplate template, XirArgument... inputs) {
+        assert template != null;
+        this.template = template;
+        this.arguments = inputs;
+        this.marks = (template.marks != null && template.marks.length > 0) ? new HashMap<XirMark, Mark>() : null;
+        assert assertArgumentsCorrect();
+    }
+
+    private boolean assertArgumentsCorrect() {
+        int argLength = arguments == null ? 0 : arguments.length;
+        int paramLength = template.parameters == null ? 0 : template.parameters.length;
+        assert argLength == paramLength : "expected param count: " + paramLength + ", actual: " + argLength;
+        for (int i = 0; i < arguments.length; i++) {
+            assert assertArgumentCorrect(template.parameters[i], arguments[i]) : "mismatch in parameter " + i + ": " + arguments[i] + " instead of " + template.parameters[i];
+        }
+        return true;
+    }
+
+    private static boolean assertArgumentCorrect(XirParameter param, XirArgument arg) {
+        if (param.kind == CiKind.Illegal || param.kind == CiKind.Void) {
+            if (arg != null) {
+                return false;
+            }
+        } else {
+            if (arg == null) {
+                return false;
+            }
+            if (arg.constant != null) {
+                if (arg.constant != null && arg.constant.kind != param.kind) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append(template.toString());
+        sb.append("(");
+        for (XirArgument a : arguments) {
+            sb.append(" ");
+            sb.append(a);
+        }
+
+        sb.append(" )");
+
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirTemplate.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.max.cri.xir;
+
+import java.io.*;
+import java.util.*;
+
+import com.oracle.max.cri.xir.CiXirAssembler.*;
+
+/**
+ * Represents a completed template of XIR code that has been first assembled by
+ * the runtime, and then verified and preprocessed by the compiler. An {@code XirTemplate}
+ * instance is immutable.
+ */
+public class XirTemplate {
+
+    /**
+     * Flags that indicate key features of the template for quick checking.
+     */
+    public enum GlobalFlags {
+        /**
+         * Contains a call to a {@link GlobalFlags#GLOBAL_STUB} template.
+         */
+        HAS_STUB_CALL,
+
+        /**
+         * Contains a call to the runtime.
+         */
+        HAS_RUNTIME_CALL,
+
+        /**
+         * Not simply a linear sequence of instructions, contains control transfers.
+         */
+        HAS_CONTROL_FLOW,
+
+        /**
+         * Is a shared instruction sequence for use by other templates.
+         */
+        GLOBAL_STUB;
+
+        public final int mask = 1 << ordinal();
+    }
+
+    /**
+     * Name of the template.
+     */
+    public final String name;
+
+    public final XirOperand resultOperand;
+
+    /**
+     * The sequence of instructions for the fast (inline) path.
+     */
+    public final CiXirAssembler.XirInstruction[] fastPath;
+
+    /**
+     * The sequence of instructions for the slow (out of line) path.
+     */
+    public final CiXirAssembler.XirInstruction[] slowPath;
+
+    /**
+     * Labels used in control transfers.
+     */
+    public final XirLabel[] labels;
+
+    /**
+     * Parameters to the template.
+     */
+    public final XirParameter[] parameters;
+
+    /**
+     * An array of same length as {@link #parameters} where {@code parameterDestroyed[i]} is {@code true}
+     * iff {@code parameters[i]} is the {@link XirInstruction#result result} of any {@link XirInstruction} in either
+     * {@link #fastPath} or {@link #slowPath}.
+     */
+    public final boolean[] parameterDestroyed;
+
+    /**
+     * Temporary variables used by the template.
+     */
+    public final XirTemp[] temps;
+
+    /**
+     * Constants used in the template.
+     */
+    public final XirConstant[] constants;
+
+    /**
+     * The total number of variables. (relation to temps/parameters???)
+     */
+    public final int variableCount;
+
+    public final boolean allocateResultOperand;
+
+    public final XirTemplate[] calleeTemplates;
+
+    public final XirMark[] marks;
+
+    public final int outgoingStackSize;
+
+    public final XirOperand[] inputOperands;
+    public final XirOperand[] inputTempOperands;
+    public final XirOperand[] tempOperands;
+
+
+    /**
+     * The {@link GlobalFlags} associated with the template.
+     */
+    public final int flags;
+
+    public XirTemplate(String name,
+                       int variableCount,
+                       boolean allocateResultOperand,
+                       XirOperand resultOperand,
+                       CiXirAssembler.XirInstruction[] fastPath,
+                       CiXirAssembler.XirInstruction[] slowPath,
+                       XirLabel[] labels,
+                       XirParameter[] parameters,
+                       XirTemp[] temps,
+                       XirConstant[] constantValues,
+                       int flags,
+                       XirTemplate[] calleeTemplates,
+                       XirMark[] marks,
+                       int outgoingStackSize) {
+        this.name = name;
+        this.variableCount = variableCount;
+        this.resultOperand = resultOperand;
+        this.fastPath = fastPath;
+        this.slowPath = slowPath;
+        this.labels = labels;
+        this.parameters = parameters;
+        this.flags = flags;
+        this.temps = temps;
+        this.allocateResultOperand = allocateResultOperand;
+        this.constants = constantValues;
+        this.calleeTemplates = calleeTemplates;
+        this.marks = marks;
+        this.outgoingStackSize = outgoingStackSize;
+
+        assert fastPath != null;
+        assert labels != null;
+        assert parameters != null;
+
+        List<XirOperand> inputOperandList = new ArrayList<>(4);
+        List<XirOperand> inputTempOperandList = new ArrayList<>(4);
+        List<XirOperand> tempOperandList = new ArrayList<>(4);
+
+        parameterDestroyed = new boolean[parameters.length];
+        for (int i = 0; i < parameters.length; i++) {
+            for (XirInstruction ins : fastPath) {
+                if (ins.result == parameters[i]) {
+                    parameterDestroyed[i] = true;
+                    break;
+                }
+            }
+
+            if (slowPath != null && !parameterDestroyed[i]) {
+                for (XirInstruction ins : slowPath) {
+                    if (ins.result == parameters[i]) {
+                        parameterDestroyed[i] = true;
+                    }
+                }
+            }
+
+            if (parameterDestroyed[i]) {
+                inputTempOperandList.add(parameters[i]);
+            } else {
+                inputOperandList.add(parameters[i]);
+            }
+        }
+
+        for (XirTemp temp : temps) {
+            if (temp.reserve) {
+                tempOperandList.add(temp);
+            }
+        }
+
+        this.inputOperands = inputOperandList.toArray(new XirOperand[inputOperandList.size()]);
+        this.inputTempOperands = inputTempOperandList.toArray(new XirOperand[inputTempOperandList.size()]);
+        this.tempOperands = tempOperandList.toArray(new XirOperand[tempOperandList.size()]);
+    }
+
+    /**
+     * Convenience getter that returns the value at a given index in the {@link #parameterDestroyed} array.
+     * @param index
+     * @return the value at {@code parameterDestroyed[index]}
+     */
+    public boolean isParameterDestroyed(int index) {
+        return parameterDestroyed[index];
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+    public void print(PrintStream p) {
+        final String indent = "   ";
+
+        p.println();
+        p.println("Template " + name);
+
+        p.print("Param:");
+        for (XirParameter param : parameters) {
+            p.print(" " + param.detailedToString());
+        }
+        p.println();
+
+        if (temps.length > 0) {
+            p.print("Temps:");
+            for (XirTemp temp : temps) {
+                p.print(" " + temp.detailedToString());
+            }
+            p.println();
+        }
+
+        if (constants.length > 0) {
+            p.print("Constants:");
+            for (XirConstant c : constants) {
+                p.print(" " + c.detailedToString());
+            }
+            p.println();
+        }
+
+        if (flags != 0) {
+            p.print("Flags:");
+            for (XirTemplate.GlobalFlags flag : XirTemplate.GlobalFlags.values()) {
+                if ((this.flags & flag.mask) != 0) {
+                    p.print(" " + flag.name());
+                }
+            }
+            p.println();
+        }
+
+        p.println("Fast path:");
+        for (XirInstruction i : fastPath) {
+            p.println(indent + i.toString());
+        }
+
+        if (slowPath != null) {
+            p.println("Slow path:");
+            for (XirInstruction i : slowPath) {
+                p.println(indent + i.toString());
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/package-info.java	Tue Jan 03 16:29:28 2012 +0100
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+/**
+ * XIR defines a domain specific instruction set for expressing the lowering of bytecode operations. The details of the
+ * lowering operations are entirely encapsulated in the runtime and are provided to the compiler on request using
+ * {@link com.oracle.max.cri.xir.XirSnippet XIR snippets}. A snippet is a combination of a {@link com.oracle.max.cri.xir.XirTemplate
+ * template}, which is a sequence of {@link com.oracle.max.cri.xir.CiXirAssembler.XirInstruction XIR instructions} that has
+ * unbound {@link com.oracle.max.cri.xir.CiXirAssembler.XirParameter parameters}, and site-specific
+ * {@link com.oracle.max.cri.xir.XirArgument arguments} that are bound to the parameters.
+ * <p>
+ * The runtime is responsible for creating the {@link com.oracle.max.cri.xir.XirTemplate templates} and provides these to the
+ * compiler as part of the initialization process.
+ * <p>
+ * The XIR instruction set has no textual representation, and therefore no parser. An assembly is represented by an
+ * instance of {@link com.oracle.max.cri.xir.CiXirAssembler}, which provides methods to create instructions and operands.
+ */
+package com.oracle.max.cri.xir;
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiAddress.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,237 +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.sun.cri.ci;
-
-import static com.sun.cri.ci.CiValueUtil.*;
-
-/**
- * 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 {@link CiVariable variable}, that is as yet
- * unassigned to target machine registers.
- */
-public final class CiAddress extends CiValue {
-    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(CiKind.Illegal, CiValue.IllegalValue);
-
-    /**
-     * Base register that defines the start of the address computation; always present.
-     */
-    public final CiValue base;
-    /**
-     * Optional index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}.
-     * If not present, is denoted by {@link CiValue#IllegalValue}.
-     */
-    public final CiValue 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(CiKind kind, CiValue 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(CiKind kind, CiValue base, int displacement) {
-        this(kind, base, IllegalValue, Scale.Times1, displacement);
-    }
-
-    /**
-     * Creates a {@code CiAddress} with given base and offset registers, no scaling and no displacement.
-     * @param kind the kind of the value being addressed
-     * @param base the base register
-     * @param offset the offset register
-     */
-    public CiAddress(CiKind kind, CiValue base, CiValue offset) {
-        this(kind, base, offset, Scale.Times1, 0);
-    }
-
-    /**
-     * 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(CiKind kind, CiValue base, CiValue index, Scale scale, int displacement) {
-        super(kind);
-
-        this.base = base;
-        if (isConstant(index)) {
-            long longIndex = ((CiConstant) index).asLong();
-            long longDisp = displacement + longIndex * scale.value;
-            if ((int) longIndex != longIndex || (int) longDisp != longDisp) {
-                throw new Error("integer overflow when computing constant displacement");
-            }
-            this.displacement = (int) longDisp;
-            this.index = IllegalValue;
-            this.scale = Scale.Times1;
-        } else {
-            assert isIllegal(base) || isVariable(base) || isRegister(base);
-            assert isIllegal(index) || isVariable(index) || isRegister(index);
-
-            this.index = index;
-            this.scale = scale;
-            this.displacement = displacement;
-        }
-    }
-
-    /**
-     * 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);
-
-        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) {
-            // Checkstyle: stop
-            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));
-            }
-            // Checkstyle: resume
-        }
-
-        public static Scale fromShift(int shift) {
-            return fromInt(1 << shift);
-        }
-    }
-
-    /**
-     * Encodes the possible addressing modes as a simple value.
-     */
-    public enum Format {
-        BASE,
-        BASE_DISP,
-        BASE_INDEX,
-        BASE_INDEX_DISP,
-        PLACEHOLDER;
-    }
-
-    /**
-     * Returns the {@link Format encoded addressing mode} that this {@code CiAddress} represents.
-     * @return the encoded addressing mode
-     */
-    public Format format() {
-        if (this == Placeholder) {
-            return Format.PLACEHOLDER;
-        }
-        assert isLegal(base);
-        if (isLegal(index)) {
-            if (displacement != 0) {
-                return Format.BASE_INDEX_DISP;
-            } else {
-                return Format.BASE_INDEX;
-            }
-        } else {
-            if (displacement != 0) {
-                return Format.BASE_DISP;
-            } else {
-                return Format.BASE;
-            }
-        }
-    }
-
-    private static String s(CiValue location) {
-        if (isRegister(location)) {
-            return asRegister(location).name;
-        }
-        assert isVariable(location);
-        return "v" + ((CiVariable) location).index;
-    }
-
-    private static String signed(int i) {
-        if (i >= 0) {
-            return "+" + i;
-        }
-        return String.valueOf(i);
-    }
-
-    @Override
-    public String toString() {
-        // Checkstyle: stop
-        switch (format()) {
-            case BASE            : return "[" + s(base) + kindSuffix() + "]";
-            case BASE_DISP       : return "[" + s(base) + signed(displacement) + kindSuffix() + "]";
-            case BASE_INDEX      : return "[" + s(base) + "+" + s(index) + kindSuffix() + "]";
-            case BASE_INDEX_DISP : return "[" + s(base) + "+(" + s(index) + "*" + scale.value + ")" + signed(displacement) + kindSuffix() + "]";
-            case PLACEHOLDER     : return "[<placeholder>]";
-            default              : throw new IllegalArgumentException("unknown format: " + format());
-        }
-        // Checkstyle: resume
-    }
-
-    @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() << 4) | kind.ordinal();
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiArchitecture.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +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.sun.cri.ci;
-
-import java.util.*;
-
-import com.oracle.max.cri.util.*;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
-
-
-/**
- * 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.max.cri/src/com/sun/cri/ci/CiAssumptions.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +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.sun.cri.ci;
-
-import java.io.*;
-import java.util.*;
-
-import com.sun.cri.ri.*;
-
-/**
- * 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 RiResolvedType context;
-
-        /**
-         * Assumed unique concrete sub-type of the context type.
-         */
-        public final RiResolvedType subtype;
-
-        public ConcreteSubtype(RiResolvedType context, RiResolvedType 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 RiResolvedMethod method;
-
-        /**
-         * A receiver type.
-         */
-        public final RiResolvedType context;
-
-        /**
-         * The unique implementation of {@link #method} for {@link #context}.
-         */
-        public final RiResolvedMethod impl;
-
-        public ConcreteMethod(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod 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;
-        }
-    }
-
-    /**
-     * 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(RiResolvedType receiverType) {
-        // TODO(tw): 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(RiResolvedType context, RiResolvedType 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(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl) {
-        record(new ConcreteMethod(method, context, impl));
-    }
-
-    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.max.cri/src/com/sun/cri/ci/CiBailout.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ci;
-
-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.max.cri/src/com/sun/cri/ci/CiBitMap.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,682 +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.sun.cri.ci;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Implements a bitmap that stores a single bit for a range of integers (0-n).
- */
-public final class CiBitMap implements Serializable {
-
-    private static final long serialVersionUID = 2471441272241401105L;
-    private static final int ADDRESS_BITS_PER_WORD = 6;
-    private static final int BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;
-    private static final int BIT_INDEX_MASK = BITS_PER_WORD - 1;
-
-    public static final int DEFAULT_LENGTH = BITS_PER_WORD;
-
-    public static int roundUpLength(int length) {
-        return ((length + (BITS_PER_WORD - 1)) >> ADDRESS_BITS_PER_WORD) << ADDRESS_BITS_PER_WORD;
-    }
-
-    private int size;
-    private long low;
-    private long[] extra;
-
-    /**
-     * Constructs a new bit map with the {@linkplain #DEFAULT_LENGTH default length}.
-     */
-    public CiBitMap() {
-        this(DEFAULT_LENGTH);
-    }
-
-    /**
-     * Constructs a new bit map from a byte array encoded bit map.
-     *
-     * @param bitmap the bit map to convert
-     */
-    public CiBitMap(byte[] bitmap) {
-        this(bitmap, 0, bitmap.length);
-    }
-
-    /**
-     * Constructs a copy of the given bit map.
-     *
-     * @param bitmap the bit map to copy.
-     */
-    public CiBitMap(CiBitMap bitmap) {
-        this.size = bitmap.size;
-        this.low = bitmap.low;
-        if (bitmap.extra != null) {
-            this.extra = Arrays.copyOf(bitmap.extra, bitmap.extra.length);
-        }
-    }
-
-    /**
-     * Constructs a new bit map from a byte array encoded bit map.
-     *
-     * @param arr the byte array containing the bit map to convert
-     * @param off the byte index in {@code arr} at which the bit map starts
-     * @param numberOfBytes the number of bytes worth of bits to copy from {@code arr}
-     */
-    public CiBitMap(byte[] arr, int off, int numberOfBytes) {
-        this(numberOfBytes * 8);
-        int byteIndex = off;
-        int end = off + numberOfBytes;
-        assert end <= arr.length;
-        while (byteIndex < end && (byteIndex - off) < 8) {
-            long bite = (long) arr[byteIndex] & 0xff;
-            low |= bite << ((byteIndex - off) * 8);
-            byteIndex++;
-        }
-        if (byteIndex < end) {
-            assert (byteIndex - off) == 8;
-            int remBytes = end - byteIndex;
-            int remWords = (remBytes + 7) / 8;
-            for (int word = 0; word < remWords; word++) {
-                long w = 0L;
-                for (int i = 0; i < 8 && byteIndex < end; i++) {
-                    long bite = (long) arr[byteIndex] & 0xff;
-                    w |= bite << (i * 8);
-                    byteIndex++;
-                }
-                extra[word] = w;
-            }
-        }
-    }
-
-    /**
-     * Converts a {@code long} to a {@link CiBitMap}.
-     */
-    public static CiBitMap fromLong(long bitmap) {
-        CiBitMap bm = new CiBitMap(64);
-        bm.low = bitmap;
-        return bm;
-    }
-
-    /**
-     * Constructs a new bit map with the specified length.
-     *
-     * @param length the length of the bitmap
-     */
-    public CiBitMap(int length) {
-        assert length >= 0;
-        this.size = length;
-        if (length > BITS_PER_WORD) {
-            extra = new long[length >> ADDRESS_BITS_PER_WORD];
-        }
-    }
-
-    /**
-     * Sets the bit at the specified index.
-     *
-     * @param i the index of the bit to set
-     */
-    public void set(int i) {
-        if (checkIndex(i) < BITS_PER_WORD) {
-            low |= 1L << i;
-        } else {
-            int pos = wordIndex(i);
-            int index = bitInWord(i);
-            extra[pos] |= 1L << index;
-        }
-    }
-
-    /**
-     * Grows this bitmap to a new size, appending necessary zero bits.
-     *
-     * @param newLength the new length of the bitmap
-     */
-    public void grow(int newLength) {
-        if (newLength > size) {
-            // grow this bitmap to the new length
-            int newSize = newLength >> ADDRESS_BITS_PER_WORD;
-            if (newLength > 0) {
-                if (extra == null) {
-                    // extra just needs to be allocated now
-                    extra = new long[newSize];
-                } else {
-                    if (extra.length < newSize) {
-                        // extra needs to be copied
-                        long[] newExtra = new long[newSize];
-                        for (int i = 0; i < extra.length; i++) {
-                            newExtra[i] = extra[i];
-                        }
-                        extra = newExtra;
-                    } else {
-                        // nothing to do, extra is already the right size
-                    }
-                }
-            }
-            size = newLength;
-        }
-    }
-
-    private static int bitInWord(int i) {
-        return i & BIT_INDEX_MASK;
-    }
-
-    private static int wordIndex(int i) {
-        return (i >> ADDRESS_BITS_PER_WORD) - 1;
-    }
-
-    /**
-     * Clears the bit at the specified index.
-     * @param i the index of the bit to clear
-     */
-    public void clear(int i) {
-        if (checkIndex(i) < BITS_PER_WORD) {
-            low &= ~(1L << i);
-        } else {
-            int pos = wordIndex(i);
-            int index = bitInWord(i);
-            extra[pos] &= ~(1L << index);
-        }
-    }
-
-    /**
-     * Sets all the bits in this bitmap.
-     */
-    public void setAll() {
-        low = -1;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] = -1;
-            }
-        }
-    }
-
-    /**
-     * Clears all the bits in this bitmap.
-     */
-    public void clearAll() {
-        low = 0;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] = 0;
-            }
-        }
-    }
-
-    /**
-     * Gets the value of the bit at the specified index.
-     *
-     * @param i the index of the bit to get
-     * @return {@code true} if the bit at the specified position is {@code 1}
-     */
-    public boolean get(int i) {
-        if (checkIndex(i) < BITS_PER_WORD) {
-            return ((low >> i) & 1) != 0;
-        }
-        int pos = wordIndex(i);
-        int index = bitInWord(i);
-        long bits = extra[pos];
-        return ((bits >> index) & 1) != 0;
-    }
-
-    /**
-     * Gets the value of the bit at the specified index, returning {@code false} if the
-     * bitmap does not cover the specified index.
-     *
-     * @param i the index of the bit to get
-     * @return {@code true} if the bit at the specified position is {@code 1}
-     */
-    public boolean getDefault(int i) {
-        if (i < 0 || i >= size) {
-            return false;
-        }
-        if (i < BITS_PER_WORD) {
-            return ((low >> i) & 1) != 0;
-        }
-        int pos = wordIndex(i);
-        int index = bitInWord(i);
-        long bits = extra[pos];
-        return ((bits >> index) & 1) != 0;
-    }
-
-    /**
-     * Performs the union operation on this bitmap with the specified bitmap. That is, all bits set in either of the two
-     * bitmaps will be set in this bitmap following this operation.
-     *
-     * @param other the other bitmap for the union operation
-     */
-    public void setUnion(CiBitMap other) {
-        low |= other.low;
-        if (extra != null && other.extra != null) {
-            for (int i = 0; i < extra.length && i < other.extra.length; i++) {
-                extra[i] |= other.extra[i];
-            }
-        }
-    }
-
-    /**
-     * Performs the union operation on this bitmap with the specified bitmap. That is, a bit is set in this
-     * bitmap if and only if it is set in both this bitmap and the specified bitmap.
-     *
-     * @param other the other bitmap for this operation
-     * @return {@code true} if any bits were cleared as a result of this operation
-     */
-    public boolean setIntersect(CiBitMap other) {
-        boolean same = true;
-        long intx = low & other.low;
-        if (low != intx) {
-            same = false;
-            low = intx;
-        }
-        long[] oxtra = other.extra;
-        if (extra != null && oxtra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                long a = extra[i];
-                if (i < oxtra.length) {
-                    // zero bits out of this map
-                    long ax = a & oxtra[i];
-                    if (a != ax) {
-                        same = false;
-                        extra[i] = ax;
-                    }
-                } else {
-                    // this bitmap is larger than the specified bitmap; zero remaining bits
-                    if (a != 0) {
-                        same = false;
-                        extra[i] = 0;
-                    }
-                }
-            }
-        }
-        return !same;
-    }
-
-    /**
-     * Gets the number of addressable bits in this bitmap.
-     *
-     * @return the size of this bitmap
-     */
-    public int size() {
-        return size;
-    }
-
-    private int checkIndex(int i) {
-        if (i < 0 || i >= size) {
-            throw new IndexOutOfBoundsException();
-        }
-        return i;
-    }
-
-    public void setFrom(CiBitMap other) {
-        assert this.size == other.size : "must have same size";
-
-        low = other.low;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] = other.extra[i];
-            }
-        }
-    }
-
-    public void setDifference(CiBitMap other) {
-        assert this.size == other.size : "must have same size";
-
-        low &= ~other.low;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] &= ~other.extra[i];
-            }
-        }
-    }
-
-    public boolean isSame(CiBitMap other) {
-        if (this.size != other.size || this.low != other.low) {
-            return false;
-        }
-
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                if (extra[i] != other.extra[i]) {
-                    return false;
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the index of the first set bit that occurs on or after a specified start index.
-     * If no such bit exists then -1 is returned.
-     * <p>
-     * To iterate over the set bits in a {@code BitMap}, use the following loop:
-     *
-     * <pre>
-     * for (int i = bitMap.nextSetBit(0); i &gt;= 0; i = bitMap.nextSetBit(i + 1)) {
-     *     // operate on index i here
-     * }
-     * </pre>
-     *
-     * @param fromIndex the index to start checking from (inclusive)
-     * @return the index of the lowest set bit between {@code [fromIndex .. size())} or -1 if there is no set bit in this range
-     * @throws IndexOutOfBoundsException if the specified index is negative.
-     */
-    public int nextSetBit(int fromIndex) {
-        return nextSetBit(fromIndex, size());
-    }
-
-    /**
-     * Returns the index of the first set bit that occurs on or after a specified start index
-     * and before a specified end index. If no such bit exists then -1 is returned.
-     * <p>
-     * To iterate over the set bits in a {@code BitMap}, use the following loop:
-     *
-     * <pre>
-     * for (int i = bitMap.nextSetBit(0, bitMap.size()); i &gt;= 0; i = bitMap.nextSetBit(i + 1, bitMap.size())) {
-     *     // operate on index i here
-     * }
-     * </pre>
-     *
-     * @param fromIndex the index to start checking from (inclusive)
-     * @param toIndex the index at which to stop checking (exclusive)
-     * @return the index of the lowest set bit between {@code [fromIndex .. toIndex)} or -1 if there is no set bit in this range
-     * @throws IndexOutOfBoundsException if the specified index is negative.
-     */
-    public int nextSetBit(int fromIndex, int toIndex) {
-        assert fromIndex <= size() : "index out of bounds";
-        assert toIndex <= size() : "index out of bounds";
-        assert fromIndex <= toIndex : "fromIndex > toIndex";
-
-        if (fromIndex == toIndex) {
-            return -1;
-        }
-        int fromWordIndex = wordIndex(fromIndex);
-        int toWordIndex = wordIndex(toIndex - 1) + 1;
-        int resultIndex = fromIndex;
-
-        // check bits including and to the left_ of offset's position
-        int pos = bitInWord(resultIndex);
-        long res = map(fromWordIndex) >> pos;
-        if (res != 0) {
-            resultIndex += Long.numberOfTrailingZeros(res);
-            assert resultIndex >= fromIndex && resultIndex < toIndex : "just checking";
-            if (resultIndex < toIndex) {
-                return resultIndex;
-            }
-            return -1;
-        }
-        // skip over all word length 0-bit runs
-        for (fromWordIndex++; fromWordIndex < toWordIndex; fromWordIndex++) {
-            res = map(fromWordIndex);
-            if (res != 0) {
-                // found a 1, return the offset
-                resultIndex = bitIndex(fromWordIndex) + Long.numberOfTrailingZeros(res);
-                assert resultIndex >= fromIndex : "just checking";
-                if (resultIndex < toIndex) {
-                    return resultIndex;
-                }
-                return -1;
-            }
-        }
-        return -1;
-    }
-
-    private static int bitIndex(int index) {
-        return (index + 1) << ADDRESS_BITS_PER_WORD;
-    }
-
-    private long map(int index) {
-        if (index == -1) {
-            return low;
-        }
-        return extra[index];
-    }
-
-    private static boolean allZeros(int start, long[] arr) {
-        for (int i = start; i < arr.length; i++) {
-            if (arr[i] != 0) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Compares this object against the specified object.
-     * The result is {@code true} if and only if {@code obj} is
-     * not {@code null} and is a {@code CiBitMap} object that has
-     * exactly the same set of bits set to {@code true} as this bit
-     * set.
-     *
-     * @param   obj   the object to compare with.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof CiBitMap) {
-            CiBitMap bm = (CiBitMap) obj;
-            if (bm.low == low) {
-                if (bm.extra == null) {
-                    if (extra == null) {
-                        // Common case
-                        return true;
-                    }
-                    return allZeros(0, extra);
-                }
-                if (extra == null) {
-                    return allZeros(0, bm.extra);
-                }
-                // both 'extra' array non null:
-                int i = 0;
-                int length = Math.min(extra.length, bm.extra.length);
-                while (i < length) {
-                    if (extra[i] != bm.extra[i]) {
-                        return false;
-                    }
-                    i++;
-                }
-                if (extra.length > bm.extra.length) {
-                    return allZeros(length, extra);
-                }
-                if (extra.length < bm.extra.length) {
-                    return allZeros(length, bm.extra);
-                }
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return (int) low ^ size;
-    }
-
-    /**
-     * Returns a string representation of this bit map
-     * that is the same as the string returned by {@link BitSet#toString()}
-     * for a bit set with the same bits set as this bit map.
-     */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(size * 2);
-        sb.append('{');
-
-        int bit = nextSetBit(0);
-        if (bit != -1) {
-            sb.append(bit);
-            for (bit = nextSetBit(bit + 1); bit >= 0; bit = nextSetBit(bit + 1)) {
-                sb.append(", ").append(bit);
-            }
-        }
-
-        sb.append('}');
-        return sb.toString();
-    }
-
-    public static int highestOneBitIndex(long value) {
-        int bit = Long.numberOfTrailingZeros(Long.highestOneBit(value));
-        if (bit == 64) {
-            return -1;
-        }
-        return bit;
-    }
-
-    /**
-     * Returns the number of bits set to {@code true} in this bit map.
-     */
-    public int cardinality() {
-        int sum = Long.bitCount(low);
-        if (extra != null) {
-            for (long word : extra) {
-                sum += Long.bitCount(word);
-            }
-        }
-        return sum;
-    }
-
-    /**
-     * Returns the "logical size" of this bit map: the index of
-     * the highest set bit in the bit map plus one. Returns zero
-     * if the bit map contains no set bits.
-     *
-     * @return  the logical size of this bit map
-     */
-    public int length() {
-        if (extra != null) {
-            for (int i = extra.length - 1; i >= 0; i--) {
-                if (extra[i] != 0) {
-                    return (highestOneBitIndex(extra[i]) + ((i + 1) * 64)) + 1;
-                }
-            }
-        }
-        return highestOneBitIndex(low) + 1;
-    }
-
-    /**
-     * Returns a string representation of this bit map with every set bit represented as {@code '1'}
-     * and every unset bit represented as {@code '0'}. The first character in the returned string represents
-     * bit 0 in this bit map.
-     *
-     * @param length the number of bits represented in the returned string. If {@code length < 0 || length > size()},
-     *            then the value of {@link #length()} is used.
-     */
-    public String toBinaryString() {
-        int length = length();
-        if (length == 0) {
-            return "";
-        }
-        StringBuilder sb = new StringBuilder(length);
-        for (int i = 0; i < length; ++i) {
-            sb.append(get(i) ? '1' : '0');
-        }
-        return sb.toString();
-    }
-
-    static final char[] hexDigits = {
-        '0', '1', '2', '3', '4', '5', '6', '7',
-        '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
-    };
-
-    /**
-     * Returns a string representation of this bit map in hex.
-     */
-    public String toHexString() {
-        if (size == 0) {
-            return "";
-        }
-        int hexSize = CiUtil.align(this.size, 4);
-        StringBuilder sb = new StringBuilder(hexSize / 4);
-        for (int i = 0; i < hexSize; i += 4) {
-            int nibble = get(i) ? 1 : 0;
-            if (get(i + 1)) {
-                nibble |= 2;
-            }
-            if (get(i + 2)) {
-                nibble |= 4;
-            }
-            if (get(i + 3)) {
-                nibble |= 8;
-            }
-
-            sb.append(hexDigits[nibble]);
-        }
-        return sb.toString();
-    }
-
-    public CiBitMap copy() {
-        CiBitMap n = new CiBitMap(BITS_PER_WORD);
-        n.low = low;
-        if (extra != null) {
-            n.extra = Arrays.copyOf(extra, extra.length);
-        }
-        n.size = size;
-        return n;
-    }
-
-    /**
-     * Copies this bit map into a given byte array.
-     *
-     * @param arr the destination
-     * @param off the byte index in {@code arr} at which to start writing
-     * @param numberOfBytes the number of bytes worth of bits to copy from this bit map.
-     *        The number of bits copied is {@code numberOfBytes * 8}. If {@code numberOfBytes}
-     *        is -1, then {@code ((size() + 7) / 8)} is used instead.
-     * @return the number of bytes written to {@code arr}
-     */
-    public int copyTo(byte[] arr, int off, int numberOfBytes) {
-        for (int i = 0; i < numberOfBytes; ++i) {
-            long word = low;
-            int byteInWord;
-            if (i >= 8) {
-                int wordIndex = (i - 8) / 8;
-                word = extra[wordIndex];
-                byteInWord = i & 0x7;
-            } else {
-                byteInWord = i;
-            }
-            assert byteInWord < 8;
-            byte b = (byte) (word >> (byteInWord * 8));
-            arr[off + i] = b;
-        }
-        return numberOfBytes;
-    }
-
-    /**
-     * Converts this bit map to a byte array. The length of the returned
-     * byte array is {@code ((size() + 7) / 8)}.
-     */
-    public byte[] toByteArray() {
-        byte[] arr = new byte[(size + 7) / 8];
-        copyTo(arr, 0, arr.length);
-        return arr;
-    }
-
-    /**
-     * Converts this bit map to a long.
-     *
-     * @throws IllegalArgumentException if {@code (size() > 64)}
-     */
-    public long toLong() {
-        if (size > 64) {
-            throw new IllegalArgumentException("bit map of size " + size + " cannot be converted to long");
-        }
-        return low;
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiCalleeSaveLayout.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ci;
-
-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.max.cri/src/com/sun/cri/ci/CiCallingConvention.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ci;
-
-import static com.sun.cri.ci.CiValueUtil.*;
-
-import com.sun.cri.ri.*;
-
-
-/**
- * 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 RiRegisterConfig#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 CiValue[] locations;
-
-    public CiCallingConvention(CiValue[] locations, int stackSize) {
-        this.locations = locations;
-        this.stackSize = stackSize;
-        assert verify();
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder result = new StringBuilder();
-        result.append("CallingConvention[");
-        for (CiValue op : locations) {
-            result.append(op.toString()).append(" ");
-        }
-        result.append("]");
-        return result.toString();
-    }
-
-    private boolean verify() {
-        for (int i = 0; i < locations.length; i++) {
-            CiValue location = locations[i];
-            assert isStackSlot(location) || isRegister(location);
-        }
-        return true;
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiCodePos.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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.sun.cri.ci;
-
-import java.io.*;
-
-import com.sun.cri.ri.*;
-
-/**
- * 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 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 RiResolvedMethod 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, RiResolvedMethod 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.max.cri/src/com/sun/cri/ci/CiCompiler.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.cri.ci;
-
-import com.sun.cri.ri.*;
-
-public interface CiCompiler {
-
-    /**
-     * Denotes the level of debug info for safepoints that should be generated by a compilation.
-     */
-    enum DebugInfoLevel {
-        /**
-         * Only ref maps are required.
-         */
-        REF_MAPS,
-
-        /**
-         * Code positions and ref maps are required.
-         */
-        CODE_POS_AND_REF_MAPS,
-
-        /**
-         * Frame info, code positions and ref maps are required.
-         * Only a compilation with level can make speculative optimizations.
-         */
-        FULL
-    }
-
-    /**
-     * Compile the specified method.
-     *
-     * @param method the method to compile
-     * @param osrBCI the bytecode index of the entrypoint for an on-stack-replacement or {@code -1} if this is not an
-     *            on-stack-replacement compilation
-     * @param debugInfoLevel TODO
-     */
-    CiResult compileMethod(RiResolvedMethod method, int osrBCI, CiStatistics stats, DebugInfoLevel debugInfoLevel);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiConstant.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,496 +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.sun.cri.ci;
-
-/**
- * Represents a constant (boxed) value, such as an integer, floating point number, or object reference,
- * within the compiler and across the compiler/runtime interface. Exports a set of {@code CiConstant}
- * instances that represent frequently used constant values, such as {@link #ZERO}.
- */
-public final class CiConstant extends CiValue {
-    private static final long serialVersionUID = -6355452536852663986L;
-
-    private static final CiConstant[] INT_CONSTANT_CACHE = new CiConstant[100];
-    static {
-        for (int i = 0; i < INT_CONSTANT_CACHE.length; ++i) {
-            INT_CONSTANT_CACHE[i] = new CiConstant(CiKind.Int, i);
-        }
-    }
-
-    public static final CiConstant NULL_OBJECT = new CiConstant(CiKind.Object, null);
-    public static final CiConstant INT_MINUS_1 = new CiConstant(CiKind.Int, -1);
-    public static final CiConstant INT_0 = forInt(0);
-    public static final CiConstant INT_1 = forInt(1);
-    public static final CiConstant INT_2 = forInt(2);
-    public static final CiConstant INT_3 = forInt(3);
-    public static final CiConstant INT_4 = forInt(4);
-    public static final CiConstant INT_5 = forInt(5);
-    public static final CiConstant LONG_0 = new CiConstant(CiKind.Long, 0L);
-    public static final CiConstant LONG_1 = new CiConstant(CiKind.Long, 1L);
-    public static final CiConstant FLOAT_0 = new CiConstant(CiKind.Float, Float.floatToRawIntBits(0.0F));
-    public static final CiConstant FLOAT_1 = new CiConstant(CiKind.Float, Float.floatToRawIntBits(1.0F));
-    public static final CiConstant FLOAT_2 = new CiConstant(CiKind.Float, Float.floatToRawIntBits(2.0F));
-    public static final CiConstant DOUBLE_0 = new CiConstant(CiKind.Double, Double.doubleToRawLongBits(0.0D));
-    public static final CiConstant DOUBLE_1 = new CiConstant(CiKind.Double, Double.doubleToRawLongBits(1.0D));
-    public static final CiConstant TRUE = new CiConstant(CiKind.Boolean, 1L);
-    public static final CiConstant FALSE = new CiConstant(CiKind.Boolean, 0L);
-
-    static {
-        assert NULL_OBJECT.isDefaultValue();
-        assert INT_0.isDefaultValue();
-        assert FLOAT_0.isDefaultValue();
-        assert DOUBLE_0.isDefaultValue();
-        assert FALSE.isDefaultValue();
-
-        // Ensure difference between 0.0f and -0.0f is preserved
-        assert FLOAT_0 != forFloat(-0.0F);
-        assert !forFloat(-0.0F).isDefaultValue();
-
-        // Ensure difference between 0.0d and -0.0d is preserved
-        assert DOUBLE_0 != forDouble(-0.0d);
-        assert !forDouble(-0.0D).isDefaultValue();
-
-        assert NULL_OBJECT.isNull();
-    }
-
-    /**
-     * The boxed object value. This is ignored iff {@code !kind.isObject()}.
-     */
-    private final Object object;
-
-    /**
-     * The boxed primitive value as a {@code long}. This is ignored iff {@code kind.isObject()}.
-     * For {@code float} and {@code double} values, this value is the result of
-     * {@link Float#floatToRawIntBits(float)} and {@link Double#doubleToRawLongBits(double)} respectively.
-     */
-    private final long primitive;
-
-    /**
-     * Create a new constant represented by the specified object reference.
-     *
-     * @param kind the type of this constant
-     * @param object the value of this constant
-     */
-    private CiConstant(CiKind kind, Object object) {
-        super(kind);
-        this.object = object;
-        this.primitive = 0L;
-    }
-
-    /**
-     * Create a new constant represented by the specified primitive.
-     *
-     * @param kind the type of this constant
-     * @param primitive the value of this constant
-     */
-    public CiConstant(CiKind kind, long primitive) {
-        super(kind);
-        this.object = null;
-        this.primitive = primitive;
-    }
-
-    /**
-     * Checks whether this constant is non-null.
-     * @return {@code true} if this constant is a primitive, or an object constant that is not null
-     */
-    public boolean isNonNull() {
-        return !kind.isObject() || object != null;
-    }
-
-    /**
-     * Checks whether this constant is null.
-     * @return {@code true} if this constant is the null constant
-     */
-    public boolean isNull() {
-        return kind.isObject() && object == null;
-    }
-
-    @Override
-    public String toString() {
-        return kind.javaName + "[" + kind.format(boxedValue()) + (kind != CiKind.Object ? "|0x" + Long.toHexString(primitive) : "") + "]";
-    }
-
-    /**
-     * Gets this constant's value as a string.
-     *
-     * @return this constant's value as a string
-     */
-    public String valueString() {
-        if (kind.isPrimitive()) {
-            return boxedValue().toString();
-        } else if (kind.isObject()) {
-            if (object == null) {
-                return "null";
-            } else if (object instanceof String) {
-                return "\"" + object + "\"";
-            } else {
-                return "<object: " + kind.format(object) + ">";
-            }
-        } else if (kind.isJsr()) {
-            return "bci:" + boxedValue().toString();
-        } else {
-            return "???";
-        }
-    }
-
-    /**
-     * Returns the value of this constant as a boxed Java value.
-     * @return the value of this constant
-     */
-    public Object boxedValue() {
-        // Checkstyle: stop
-        switch (kind) {
-            case Byte: return (byte) asInt();
-            case Boolean: return asInt() == 0 ? Boolean.FALSE : Boolean.TRUE;
-            case Short: return (short) asInt();
-            case Char: return (char) asInt();
-            case Jsr: return (int) primitive;
-            case Int: return asInt();
-            case Long: return asLong();
-            case Float: return asFloat();
-            case Double: return asDouble();
-            case Object: return object;
-        }
-        // Checkstyle: resume
-        throw new IllegalArgumentException();
-    }
-
-    private boolean valueEqual(CiConstant other, boolean ignoreKind) {
-        // must have equivalent kinds to be equal
-        if (!ignoreKind && kind != other.kind) {
-            return false;
-        }
-        if (kind.isObject()) {
-            return object == other.object;
-        }
-        return primitive == other.primitive;
-    }
-
-    /**
-     * Converts this constant to a primitive int.
-     * @return the int value of this constant
-     */
-    public int asInt() {
-        if (kind.stackKind().isInt() || kind.isJsr()) {
-            return (int) primitive;
-        }
-        throw new Error("Constant is not int: " + this);
-    }
-
-    /**
-     * Converts this constant to a primitive boolean.
-     * @return the boolean value of this constant
-     */
-    public boolean asBoolean() {
-        if (kind == CiKind.Boolean) {
-            return primitive != 0L;
-        }
-        throw new Error("Constant is not boolean: " + this);
-    }
-
-    /**
-     * Converts this constant to a primitive long.
-     * @return the long value of this constant
-     */
-    public long asLong() {
-        // Checkstyle: stop
-        switch (kind.stackKind()) {
-            case Jsr:
-            case Int:
-            case Long: return primitive;
-            case Float: return (long) asFloat();
-            case Double: return (long) asDouble();
-            default: throw new Error("Constant is not long: " + this);
-        }
-        // Checkstyle: resume
-    }
-
-    /**
-     * Converts this constant to a primitive float.
-     * @return the float value of this constant
-     */
-    public float asFloat() {
-        if (kind.isFloat()) {
-            return Float.intBitsToFloat((int) primitive);
-        }
-        throw new Error("Constant is not float: " + this);
-    }
-
-    /**
-     * Converts this constant to a primitive double.
-     * @return the double value of this constant
-     */
-    public double asDouble() {
-        if (kind.isFloat()) {
-            return Float.intBitsToFloat((int) primitive);
-        }
-        if (kind.isDouble()) {
-            return Double.longBitsToDouble(primitive);
-        }
-        throw new Error("Constant is not double: " + this);
-    }
-
-    /**
-     * Converts this constant to the object reference it represents.
-     * @return the object which this constant represents
-     */
-    public Object asObject() {
-        if (kind.isObject()) {
-            return object;
-        }
-        throw new Error("Constant is not object: " + this);
-    }
-
-    /**
-     * Converts this constant to the jsr reference it represents.
-     * @return the object which this constant represents
-     */
-    public int asJsr() {
-        if (kind.isJsr()) {
-            return (int) primitive;
-        }
-        throw new Error("Constant is not jsr: " + this);
-    }
-
-    /**
-     * Unchecked access to a primitive value.
-     * @return
-     */
-    public long asPrimitive() {
-        if (kind.isObject()) {
-            throw new Error("Constant is not primitive: " + this);
-        }
-        return primitive;
-    }
-
-    /**
-     * Computes the hashcode of this constant.
-     * @return a suitable hashcode for this constant
-     */
-    @Override
-    public int hashCode() {
-        if (kind.isObject()) {
-            return System.identityHashCode(object);
-        }
-        return (int) primitive;
-    }
-
-    /**
-     * Checks whether this constant equals another object. This is only
-     * true if the other object is a constant and has the same value.
-     * @param o the object to compare equality
-     * @return {@code true} if this constant is equivalent to the specified object
-     */
-    @Override
-    public boolean equals(Object o) {
-        return o == this || o instanceof CiConstant && valueEqual((CiConstant) o, false);
-    }
-
-    /**
-     * Checks whether this constant is identical to another constant or has the same value as it.
-     * @param other the constant to compare for equality against this constant
-     * @return {@code true} if this constant is equivalent to {@code other}
-     */
-    public boolean equivalent(CiConstant other) {
-        return other == this || valueEqual(other, false);
-    }
-
-    /**
-     * Checks whether this constant is the default value for its type.
-     * @return {@code true} if the value is the default value for its type; {@code false} otherwise
-     */
-    public boolean isDefaultValue() {
-        // Checkstyle: stop
-        switch (kind.stackKind()) {
-            case Int: return asInt() == 0;
-            case Long: return asLong() == 0;
-            case Float: return this == FLOAT_0;
-            case Double: return this == DOUBLE_0;
-            case Object: return object == null;
-        }
-        // Checkstyle: resume
-        throw new IllegalArgumentException("Cannot det default CiConstant for kind " + kind);
-    }
-
-    /**
-     * Gets the default value for a given kind.
-     *
-     * @return the default value for {@code kind}'s {@linkplain CiKind#stackKind() stack kind}
-     */
-    public static CiConstant defaultValue(CiKind kind) {
-        // Checkstyle: stop
-        switch (kind.stackKind()) {
-            case Int: return INT_0;
-            case Long: return LONG_0;
-            case Float: return FLOAT_0;
-            case Double: return DOUBLE_0;
-            case Object: return NULL_OBJECT;
-        }
-        // Checkstyle: resume
-        throw new IllegalArgumentException("Cannot get default CiConstant for kind " + kind);
-    }
-
-    /**
-     * Creates a boxed double constant.
-     * @param d the double value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forDouble(double d) {
-        if (Double.compare(0.0D, d) == 0) {
-            return DOUBLE_0;
-        }
-        if (Double.compare(d, 1.0D) == 0) {
-            return DOUBLE_1;
-        }
-        return new CiConstant(CiKind.Double, Double.doubleToRawLongBits(d));
-    }
-
-    /**
-     * Creates a boxed float constant.
-     * @param f the float value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forFloat(float f) {
-        if (Float.compare(f, 0.0F) == 0) {
-            return FLOAT_0;
-        }
-        if (Float.compare(f, 1.0F) == 0) {
-            return FLOAT_1;
-        }
-        if (Float.compare(f, 2.0F) == 0) {
-            return FLOAT_2;
-        }
-        return new CiConstant(CiKind.Float, Float.floatToRawIntBits(f));
-    }
-
-    /**
-     * Creates a boxed long constant.
-     * @param i the long value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forLong(long i) {
-        return i == 0 ? LONG_0 : i == 1 ? LONG_1 : new CiConstant(CiKind.Long, i);
-    }
-
-    /**
-     * Creates a boxed integer constant.
-     * @param i the integer value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forInt(int i) {
-        if (i == -1) {
-            return INT_MINUS_1;
-        }
-        if (i >= 0 && i < INT_CONSTANT_CACHE.length) {
-            return INT_CONSTANT_CACHE[i];
-        }
-        return new CiConstant(CiKind.Int, i);
-    }
-
-    /**
-     * Creates a boxed byte constant.
-     * @param i the byte value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forByte(byte i) {
-        return new CiConstant(CiKind.Byte, i);
-    }
-
-    /**
-     * Creates a boxed boolean constant.
-     * @param i the boolean value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forBoolean(boolean i) {
-        return i ? TRUE : FALSE;
-    }
-
-    /**
-     * Creates a boxed char constant.
-     * @param i the char value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forChar(char i) {
-        return new CiConstant(CiKind.Char, i);
-    }
-
-    /**
-     * Creates a boxed short constant.
-     * @param i the short value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forShort(short i) {
-        return new CiConstant(CiKind.Short, i);
-    }
-
-    /**
-     * Creates a boxed address (jsr/ret address) constant.
-     * @param i the address value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forJsr(int i) {
-        return new CiConstant(CiKind.Jsr, i);
-    }
-
-    /**
-     * Creates a boxed object constant.
-     * @param o the object value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static CiConstant forObject(Object o) {
-        if (o == null) {
-            return NULL_OBJECT;
-        }
-        return new CiConstant(CiKind.Object, o);
-    }
-
-    /**
-     * Creates a boxed constant for the given kind from an Object.
-     * The object needs to be of the Java boxed type corresponding to the kind.
-     * @param kind the kind of the constant to create
-     * @param value the Java boxed value: a Byte instance for CiKind Byte, etc.
-     * @return the boxed copy of {@code value}
-     */
-    public static CiConstant forBoxed(CiKind kind, Object value) {
-        switch (kind) {
-            case Byte:
-                return forByte((Byte) value);
-            case Char:
-                return forChar((Character) value);
-            case Short:
-                return forShort((Short) value);
-            case Int:
-                return forInt((Integer) value);
-            case Long:
-                return forLong((Long) value);
-            case Float:
-                return forFloat((Float) value);
-            case Double:
-                return forDouble((Double) value);
-            case Object:
-                return forObject(value);
-            default:
-                throw new RuntimeException("cannot create CiConstant for boxed " + kind + " value");
-        }
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiDebugInfo.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +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.sun.cri.ci;
-
-import java.io.*;
-
-/**
- * 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 CiBitMap 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 CiBitMap 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, CiBitMap registerRefMap, CiBitMap 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.max.cri/src/com/sun/cri/ci/CiExceptionHandler.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +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.sun.cri.ci;
-
-import com.sun.cri.ri.*;
-
-/**
- * An implementation of the {@link RiExceptionHandler} interface.
- */
-public class CiExceptionHandler implements RiExceptionHandler {
-
-    public static final CiExceptionHandler[] NONE = {};
-
-    public final int startBCI;
-    public final int endBCI;
-    public final int handlerBCI;
-    public final int catchTypeCPI;
-    public final RiType catchType;
-
-    /**
-     * Creates a new exception handler with the specified ranges.
-     * @param startBCI the start index of the protected range
-     * @param endBCI the end index of the protected range
-     * @param catchBCI the index of the handler
-     * @param catchTypeCPI the index of the throwable class in the constant pool
-     * @param catchType the type caught by this exception handler
-     */
-    public CiExceptionHandler(int startBCI, int endBCI, int catchBCI, int catchTypeCPI, RiType catchType) {
-        this.startBCI = startBCI;
-        this.endBCI = endBCI;
-        this.handlerBCI = catchBCI;
-        this.catchTypeCPI = catchTypeCPI;
-        this.catchType = catchType;
-    }
-
-    public int startBCI() {
-        return startBCI;
-    }
-
-    public int endBCI() {
-        return endBCI;
-    }
-
-    public int handlerBCI() {
-        return handlerBCI;
-    }
-
-    public int catchTypeCPI() {
-        return catchTypeCPI;
-    }
-
-    public boolean isCatchAll() {
-        return catchTypeCPI == 0;
-    }
-
-    public RiType catchType() {
-        return catchType;
-    }
-
-    @Override
-    public String toString() {
-        return new StringBuilder(20).
-            append('[').
-            append(startBCI).
-            append(" - ").
-            append(endBCI).
-            append(") -> ").
-            append(handlerBCI).
-            append(" type=").
-            append(catchType == null ? "*any*" : catchType.name()).
-            toString();
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiFrame.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +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.sun.cri.ci;
-
-import java.io.*;
-
-import com.sun.cri.ri.*;
-
-/**
- * Represents the Java bytecode frame state(s) at a given position
- * including {@link CiValue 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 CiValue[] 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;
-
-    public final boolean rethrowException;
-
-    /**
-     * 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, RiResolvedMethod method, int bci, boolean rethrowException, CiValue[] values, int numLocals, int numStack, int numLocks) {
-        super(caller, method, bci);
-        assert values != null;
-        this.rethrowException = rethrowException;
-        this.values = values;
-        this.numLocks = numLocks;
-        this.numLocals = numLocals;
-        this.numStack = numStack;
-        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 CiValue 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 CiValue 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 CiValue 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.max.cri/src/com/sun/cri/ci/CiGenericCallback.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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.sun.cri.ci;
-
-/**
- * This interface is used for {@link CiRuntimeCall#GenericCallback} runtime calls.
- */
-public abstract class CiGenericCallback {
-
-    @SuppressWarnings("unused")
-    private Object callbackInternal(Object arg) {
-        try {
-            return callback(arg);
-        } catch (Throwable t) {
-            t.printStackTrace();
-            return null;
-        }
-    }
-
-    public abstract Object callback(Object arg);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiKind.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,340 +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.sun.cri.ci;
-
-import static com.sun.cri.ci.CiKind.Flags.*;
-import sun.misc.*;
-
-import com.sun.cri.ri.*;
-
-/**
- * Denotes the basic kinds of types in CRI, including the all the Java primitive types,
- * for example, {@link CiKind#Int} for {@code int} and {@link CiKind#Object}
- * for all object types.
- * A kind has a single character short name, a Java name, and a set of flags
- * further describing its behavior.
- */
-public enum CiKind {
-    Boolean('z', "boolean", FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
-    Byte   ('b', "byte",    FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
-    Short  ('s', "short",   FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
-    Char   ('c', "char",    FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
-    Int    ('i', "int",     FIELD_TYPE | RETURN_TYPE | PRIMITIVE | STACK_INT),
-    Float  ('f', "float",   FIELD_TYPE | RETURN_TYPE | PRIMITIVE),
-    Long   ('j', "long",    FIELD_TYPE | RETURN_TYPE | PRIMITIVE),
-    Double ('d', "double",  FIELD_TYPE | RETURN_TYPE | PRIMITIVE),
-    Object ('a', "Object",  FIELD_TYPE | RETURN_TYPE),
-    Void   ('v', "void",    RETURN_TYPE),
-    /** Denote a bytecode address in a {@code JSR} bytecode. */
-    Jsr    ('r', "jsr",     0),
-    /** The non-type. */
-    Illegal('-', "illegal", 0);
-
-    public static final CiKind[] VALUES = values();
-    public static final CiKind[] JAVA_VALUES = new CiKind[] {CiKind.Boolean, CiKind.Byte, CiKind.Short, CiKind.Char, CiKind.Int, CiKind.Float, CiKind.Long, CiKind.Double, CiKind.Object};
-
-    CiKind(char ch, String name, int flags) {
-        this.typeChar = ch;
-        this.javaName = name;
-        this.flags = flags;
-    }
-
-    static class Flags {
-        /**
-         * Can be an object field type.
-         */
-        public static final int FIELD_TYPE  = 0x0001;
-        /**
-         * Can be result type of a method.
-         */
-        public static final int RETURN_TYPE = 0x0002;
-        /**
-         * Behaves as an integer when on Java evaluation stack.
-         */
-        public static final int STACK_INT   = 0x0004;
-        /**
-         * Represents a Java primitive type.
-         */
-        public static final int PRIMITIVE   = 0x0008;
-    }
-
-    /**
-     * The flags for this kind.
-     */
-    private final int flags;
-
-    /**
-     * The name of the kind as a single character.
-     */
-    public final char typeChar;
-
-    /**
-     * The name of this kind which will also be it Java programming language name if
-     * it is {@linkplain #isPrimitive() primitive} or {@code void}.
-     */
-    public final String javaName;
-
-    /**
-     * Checks whether this kind is valid as the type of a field.
-     * @return {@code true} if this kind is valid as the type of a Java field
-     */
-    public boolean isValidFieldType() {
-        return (flags & FIELD_TYPE) != 0;
-    }
-
-    /**
-     * Checks whether this kind is valid as the return type of a method.
-     * @return {@code true} if this kind is valid as the return type of a Java method
-     */
-    public boolean isValidReturnType() {
-        return (flags & RETURN_TYPE) != 0;
-    }
-
-    /**
-     * Checks whether this type is valid as an {@code int} on the Java operand stack.
-     * @return {@code true} if this type is represented by an {@code int} on the operand stack
-     */
-    public boolean isInt() {
-        return (flags & STACK_INT) != 0;
-    }
-
-    /**
-     * Checks whether this type is a Java primitive type.
-     * @return {@code true} if this is {@link #Boolean}, {@link #Byte}, {@link #Char}, {@link #Short},
-     *                                 {@link #Int}, {@link #Long}, {@link #Float} or {@link #Double}.
-     */
-    public boolean isPrimitive() {
-        return (flags & PRIMITIVE) != 0;
-    }
-
-    /**
-     * Gets the kind that represents this kind when on the Java operand stack.
-     * @return the kind used on the operand stack
-     */
-    public CiKind stackKind() {
-        if (isInt()) {
-            return Int;
-        }
-        return this;
-    }
-
-    public static CiKind fromTypeString(String typeString) {
-        assert typeString.length() > 0;
-        final char first = typeString.charAt(0);
-        if (first == '[' || first == 'L') {
-            return CiKind.Object;
-        }
-        return CiKind.fromPrimitiveOrVoidTypeChar(first);
-    }
-
-    /**
-     * Gets the kind from the character describing a primitive or void.
-     * @param ch the character
-     * @return the kind
-     */
-    public static CiKind fromPrimitiveOrVoidTypeChar(char ch) {
-        // Checkstyle: stop
-        switch (ch) {
-            case 'Z': return Boolean;
-            case 'C': return Char;
-            case 'F': return Float;
-            case 'D': return Double;
-            case 'B': return Byte;
-            case 'S': return Short;
-            case 'I': return Int;
-            case 'J': return Long;
-            case 'V': return Void;
-        }
-        // Checkstyle: resume
-        throw new IllegalArgumentException("unknown primitive or void type character: " + ch);
-    }
-
-    public Class< ? > toJavaClass() {
-        // Checkstyle: stop
-        switch(this) {
-            case Void:      return java.lang.Void.TYPE;
-            case Long:      return java.lang.Long.TYPE;
-            case Int:       return java.lang.Integer.TYPE;
-            case Byte:      return java.lang.Byte.TYPE;
-            case Char:      return java.lang.Character.TYPE;
-            case Double:    return java.lang.Double.TYPE;
-            case Float:     return java.lang.Float.TYPE;
-            case Short:     return java.lang.Short.TYPE;
-            case Boolean:   return java.lang.Boolean.TYPE;
-            default:        return null;
-        }
-        // Checkstyle: resume
-    }
-
-    public Class< ? > toUnboxedJavaClass() {
-        // Checkstyle: stop
-        switch(this) {
-            case Void:      return null;
-            case Long:      return java.lang.Long.class;
-            case Int:       return java.lang.Integer.class;
-            case Byte:      return java.lang.Byte.class;
-            case Char:      return java.lang.Character.class;
-            case Double:    return java.lang.Double.class;
-            case Float:     return java.lang.Float.class;
-            case Short:     return java.lang.Short.class;
-            case Boolean:   return java.lang.Boolean.class;
-            default:        return null;
-        }
-        // Checkstyle: resume
-    }
-
-    /**
-     * Checks whether this value type is void.
-     * @return {@code true} if this type is void
-     */
-    public final boolean isVoid() {
-        return this == CiKind.Void;
-    }
-
-    /**
-     * Checks whether this value type is long.
-     * @return {@code true} if this type is long
-     */
-    public final boolean isLong() {
-        return this == CiKind.Long;
-    }
-
-    /**
-     * Checks whether this value type is float.
-     * @return {@code true} if this type is float
-     */
-    public final boolean isFloat() {
-        return this == CiKind.Float;
-    }
-
-    /**
-     * Checks whether this value type is double.
-     * @return {@code true} if this type is double
-     */
-    public final boolean isDouble() {
-        return this == CiKind.Double;
-    }
-
-    /**
-     * Checks whether this value type is float or double.
-     * @return {@code true} if this type is float or double
-     */
-    public final boolean isFloatOrDouble() {
-        return this == CiKind.Double || this == CiKind.Float;
-    }
-
-   /**
-     * Checks whether this value type is an object type.
-     * @return {@code true} if this type is an object
-     */
-    public final boolean isObject() {
-        return this == CiKind.Object;
-    }
-
-    /**
-     * Checks whether this value type is an address type.
-     * @return {@code true} if this type is an address
-     */
-    public boolean isJsr() {
-        return this == CiKind.Jsr;
-    }
-
-    /**
-     * Converts this value type to a string.
-     */
-    @Override
-    public String toString() {
-        return javaName;
-    }
-
-    /**
-     * Marker interface for types that should be {@linkplain CiKind#format(Object) formatted}
-     * with their {@link Object#toString()} value.
-     */
-    public interface FormatWithToString {}
-
-    /**
-     * Gets a formatted string for a given value of this kind.
-     *
-     * @param value a value of this kind
-     * @return a formatted string for {@code value} based on this kind
-     */
-    public String format(Object value) {
-        if (isObject()) {
-            if (value == null) {
-                return "null";
-            } else {
-                if (value instanceof String) {
-                    String s = (String) value;
-                    if (s.length() > 50) {
-                        return "\"" + s.substring(0, 30) + "...\"";
-                    } else {
-                        return " \"" + s + '"';
-                    }
-                } else if (value instanceof RiType) {
-                    return "class " + CiUtil.toJavaName((RiType) value);
-                } else if (value instanceof Enum || value instanceof FormatWithToString) {
-                    return String.valueOf(value);
-                } else if (value instanceof Class< ? >) {
-                    return ((Class< ? >) value).getName() + ".class";
-                } else {
-                    return CiUtil.getSimpleName(value.getClass(), true) + "@" + System.identityHashCode(value);
-                }
-            }
-        } else {
-            return value.toString();
-        }
-    }
-
-    public final char signatureChar() {
-        return Character.toUpperCase(typeChar);
-    }
-
-    public CiConstant readUnsafeConstant(Object value, long displacement) {
-        Unsafe u = Unsafe.getUnsafe();
-        switch(this) {
-            case Boolean:
-                return CiConstant.forBoolean(u.getBoolean(value, displacement));
-            case Byte:
-                return CiConstant.forByte(u.getByte(value, displacement));
-            case Char:
-                return CiConstant.forChar(u.getChar(value, displacement));
-            case Short:
-                return CiConstant.forShort(u.getShort(value, displacement));
-            case Int:
-                return CiConstant.forInt(u.getInt(value, displacement));
-            case Long:
-                return CiConstant.forLong(u.getLong(value, displacement));
-            case Float:
-                return CiConstant.forFloat(u.getFloat(value, displacement));
-            case Double:
-                return CiConstant.forDouble(u.getDouble(value, displacement));
-            case Object:
-                return CiConstant.forObject(u.getObject(value, displacement));
-            default:
-                assert false : "unexpected kind: " + this;
-                return null;
-        }
-    }
-
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiMonitorValue.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +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.sun.cri.ci;
-
-public final class CiMonitorValue extends CiValue {
-    private static final long serialVersionUID = 8241681800464483691L;
-
-    public CiValue owner;
-    public final CiValue lockData;
-    public final boolean eliminated;
-
-    public CiMonitorValue(CiValue owner, CiValue lockData, boolean eliminated) {
-        super(CiKind.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.max.cri/src/com/sun/cri/ci/CiRegister.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,257 +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.sun.cri.ci;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * 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 CiKind}, indexed by {@link CiKind#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[CiKind.VALUES.length];
-        for (CiKind kind : CiKind.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(CiKind kind) {
-        return values[kind.ordinal()];
-    }
-
-    /**
-     * Gets this register as a {@linkplain CiRegisterValue value} with no particular kind.
-     * @return a {@link CiRegisterValue} with {@link CiKind#Illegal} kind.
-     */
-    public CiRegisterValue asValue() {
-        return asValue(CiKind.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.max.cri/src/com/sun/cri/ci/CiRegisterConfig.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ci;
-
-import java.util.*;
-
-import com.sun.cri.ci.CiCallingConvention.Type;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
-import com.sun.cri.ri.*;
-
-/**
- * A default implementation of {@link RiRegisterConfig}.
- */
-public class CiRegisterConfig implements RiRegisterConfig {
-
-    /**
-     * 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 RiRegisterAttributes attributes} for this register configuration.
-     */
-    public final RiRegisterAttributes[] 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 CiRegisterConfig(
-                    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 = RiRegisterAttributes.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 CiRegisterConfig(CiRegisterConfig 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(CiKind 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, CiKind[] parameters, CiTarget target, boolean stackOnly) {
-        CiValue[] locations = new CiValue[parameters.length];
-
-        int currentGeneral = 0;
-        int currentXMM = 0;
-        int currentStackOffset = stackArg0Offsets[type.ordinal()];
-
-        for (int i = 0; i < parameters.length; i++) {
-            final CiKind 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 RiRegisterAttributes[] 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.max.cri/src/com/sun/cri/ci/CiRegisterValue.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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.sun.cri.ci;
-
-/**
- * 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 CiKind}) pair. Use {@link CiRegister#asValue(CiKind)} to
- * retrieve the canonical {@link CiRegisterValue} instance for a given (register,kind) pair.
- */
-public final class CiRegisterValue extends CiValue {
-    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(CiKind 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.max.cri/src/com/sun/cri/ci/CiResult.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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.sun.cri.ci;
-
-/**
- * Represents the result of compiling a method. The result can include a target method with machine code and metadata,
- * and/or statistics. If the compiler bailed out due to malformed bytecode, an internal error, or other cause, it will
- * supply the bailout object.
- */
-public class CiResult {
-    private final CiTargetMethod targetMethod;
-    private final CiBailout bailout;
-    private final CiStatistics stats;
-
-    /**
-     * Creates a new compilation result.
-     * @param targetMethod the method that was produced, if any
-     * @param bailout the bailout condition that occurred
-     * @param stats statistics about the compilation
-     */
-    public CiResult(CiTargetMethod targetMethod, CiBailout bailout, CiStatistics stats) {
-        this.targetMethod = targetMethod;
-        this.bailout = bailout;
-        this.stats = stats;
-    }
-
-    /**
-     * Gets the target method that was produced by this compilation. If no target method was
-     * produced, but a bailout occured, then the bailout exception will be thrown at this point.
-     * @return the target method produced
-     * @throws {@link CiBailout} if a bailout occurred
-     */
-    public CiTargetMethod targetMethod() {
-        if (bailout != null) {
-            throw bailout;
-        }
-        return targetMethod;
-    }
-
-    /**
-     * Returns the statistics about the compilation that were produced, if any.
-     * @return the statistics
-     */
-    public CiStatistics statistics() {
-        return stats;
-    }
-
-    /**
-     * Returns the bailout condition that occurred for this compilation, if any.
-     * @return the bailout
-     */
-    public CiBailout bailout() {
-        return bailout;
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiRuntimeCall.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ci;
-
-import static com.sun.cri.ci.CiKind.*;
-
-/**
- * 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),
-    HandleException(Void, Object),
-    SetDeoptInfo(Void, Object),
-    CreateNullPointerException(Object),
-    CreateOutOfBoundsException(Object, Int),
-    OSRMigrationEnd(Void),
-    JavaTimeMillis(Long),
-    JavaTimeNanos(Long),
-    Debug(Void),
-    ArithmethicLrem(Long, Long, Long),
-    ArithmeticLdiv(Long, Long, Long),
-    ArithmeticFrem(Float, Float, Float),
-    ArithmeticDrem(Double, Double, Double),
-    ArithmeticCos(Double, Double),
-    ArithmeticTan(Double, Double),
-    ArithmeticLog(Double, Double),
-    ArithmeticLog10(Double, Double),
-    ArithmeticSin(Double, Double),
-    GenericCallback(Object, Object, Object);
-
-    public final CiKind resultKind;
-    public final CiKind[] arguments;
-
-    private CiRuntimeCall(CiKind resultKind, CiKind... args) {
-        this.resultKind = resultKind;
-        this.arguments = args;
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiStackSlot.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ci;
-
-import static com.sun.cri.ci.CiKind.*;
-
-/**
- * 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 CiValue {
-    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(CiKind 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(CiKind 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() {
-        String s;
-        if (!addFrameSize) {
-            s = "out:";
-        } else if (offset >= 0) {
-            s = "in:";
-        } else {
-            s = "spill:";
-        }
-        return s + 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[CiKind.VALUES.length][];
-        for (CiKind kind : new CiKind[] {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.max.cri/src/com/sun/cri/ci/CiStatistics.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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.sun.cri.ci;
-
-/**
- * Contains statistics gathered during the compilation of a method and reported back
- * from the compiler as the result of compilation.
- */
-public class CiStatistics {
-
-    /**
-     * The total number of bytes of bytecode parsed during this compilation, including any inlined methods.
-     */
-    public int bytecodeCount;
-
-    /**
-     * The number of internal graph nodes created during this compilation.
-     */
-    public int nodeCount;
-
-    /**
-     * The number of basic blocks created during this compilation.
-     */
-    public int blockCount;
-
-    /**
-     * The number of loops in the compiled method.
-     */
-    public int loopCount;
-
-    /**
-     * The number of methods inlined.
-     */
-    public int inlineCount;
-
-    /**
-     * The number of methods folded (i.e. evaluated).
-     */
-    public int foldCount;
-
-    /**
-     * The number of intrinsics inlined in this compilation.
-     */
-    public int intrinsicCount;
-
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiTarget.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +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.sun.cri.ci;
-
-
-/**
- * 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 CiKind 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 = CiKind.Long;
-        } else {
-            this.wordKind = CiKind.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(CiKind 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.max.cri/src/com/sun/cri/ci/CiTargetMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,596 +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.sun.cri.ci;
-
-import java.io.*;
-import java.util.*;
-
-import com.sun.cri.ri.*;
-
-/**
- * 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}.
- */
-public class CiTargetMethod implements Serializable {
-
-    /**
-     *
-     */
-    private static final long serialVersionUID = -1319947729753702434L;
-
-    /**
-     * Represents a code position with associated additional information.
-     */
-    public abstract static class Site implements Serializable {
-        /**
-         *
-         */
-        private static final long serialVersionUID = -8214214947651979102L;
-        /**
-         * The position (or offset) of this site with respect to the start of the target method.
-         */
-        public final int pcOffset;
-
-        public Site(int pos) {
-            this.pcOffset = pos;
-        }
-    }
-
-    /**
-     * Represents a safepoint with associated debug info.
-     */
-    public static class Safepoint extends Site implements Comparable<Safepoint> {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 2479806696381720162L;
-        public final CiDebugInfo debugInfo;
-
-        Safepoint(int pcOffset, CiDebugInfo debugInfo) {
-            super(pcOffset);
-            this.debugInfo = debugInfo;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder sb = new StringBuilder();
-            sb.append(pcOffset);
-            sb.append("[<safepoint>]");
-            appendDebugInfo(sb, debugInfo);
-            return sb.toString();
-        }
-
-        @Override
-        public int compareTo(Safepoint o) {
-            if (pcOffset < o.pcOffset) {
-                return -1;
-            } else if (pcOffset > o.pcOffset) {
-                return 1;
-            }
-            return 0;
-        }
-    }
-
-    /**
-     * Represents a call in the code.
-     */
-    public static final class Call extends Safepoint {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 1440741241631046954L;
-
-        /**
-         * The target of the call.
-         */
-        public final Object target;
-
-        /**
-         * The size of the call instruction.
-         */
-        public final int size;
-
-        /**
-         * Specifies if this call is direct or indirect. A direct call has an immediate operand encoding
-         * the absolute or relative (to the call itself) address of the target. An indirect call has a
-         * register or memory operand specifying the target address of the call.
-         */
-        public final boolean direct;
-
-        Call(Object target, int pcOffset, int size, boolean direct, CiDebugInfo debugInfo) {
-            super(pcOffset, debugInfo);
-            this.size = size;
-            this.target = target;
-            this.direct = direct;
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder sb = new StringBuilder();
-            sb.append(pcOffset);
-            sb.append('[');
-            sb.append(target);
-            sb.append(']');
-
-            if (debugInfo != null) {
-                appendDebugInfo(sb, debugInfo);
-            }
-
-            return sb.toString();
-        }
-    }
-
-    /**
-     * Represents a reference to data from the code. The associated data can be any constant.
-     */
-    public static final class DataPatch extends Site {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 5771730331604867476L;
-        public final CiConstant constant;
-        public final int alignment;
-
-        DataPatch(int pcOffset, CiConstant data, int alignment) {
-            super(pcOffset);
-            this.constant = data;
-            this.alignment = alignment;
-        }
-
-        @Override
-        public String toString() {
-            return String.format("%d[<data patch referring to data %s>]", pcOffset, constant);
-        }
-    }
-
-    /**
-     * Provides extra information about instructions or data at specific positions in {@link CiTargetMethod#targetCode()}.
-     * This is optional information that can be used to enhance a disassembly of the code.
-     */
-    public abstract static class CodeAnnotation implements Serializable {
-        /**
-         *
-         */
-        private static final long serialVersionUID = -7903959680749520748L;
-        public final int position;
-
-        public CodeAnnotation(int position) {
-            this.position = position;
-        }
-    }
-
-    /**
-     * A string comment about one or more instructions at a specific position in the code.
-     */
-    public static final class CodeComment extends CodeAnnotation {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 6802287188701961401L;
-        public final String value;
-        public CodeComment(int position, String comment) {
-            super(position);
-            this.value = comment;
-        }
-
-        @Override
-        public String toString() {
-            return getClass().getSimpleName() + "@" + position + ": " + value;
-        }
-    }
-
-    /**
-     * Labels some inline data in the code.
-     */
-    public static final class InlineData extends CodeAnnotation {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 305997507263827108L;
-        public final int size;
-        public InlineData(int position, int size) {
-            super(position);
-            this.size = size;
-        }
-
-        @Override
-        public String toString() {
-            return getClass().getSimpleName() + "@" + position + ": size=" + size;
-        }
-    }
-
-    /**
-     * Describes a table of signed offsets embedded in the code. The offsets are relative to the starting
-     * address of the table. This type of table maybe generated when translating a multi-way branch
-     * based on a key value from a dense value set (e.g. the {@code tableswitch} JVM instruction).
-     *
-     * The table is indexed by the contiguous range of integers from {@link #low} to {@link #high} inclusive.
-     */
-    public static final class JumpTable extends CodeAnnotation {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 2222194398353801831L;
-
-        /**
-         * The low value in the key range (inclusive).
-         */
-        public final int low;
-
-        /**
-         * The high value in the key range (inclusive).
-         */
-        public final int high;
-
-        /**
-         * The size (in bytes) of each table entry.
-         */
-        public final int entrySize;
-
-        public JumpTable(int position, int low, int high, int entrySize) {
-            super(position);
-            this.low = low;
-            this.high = high;
-            this.entrySize = entrySize;
-        }
-
-        @Override
-        public String toString() {
-            return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]";
-        }
-    }
-
-    /**
-     * Describes a table of key and offset pairs. The offset in each table entry is relative to the address of
-     * the table. This type of table maybe generated when translating a multi-way branch
-     * based on a key value from a sparse value set (e.g. the {@code lookupswitch} JVM instruction).
-     */
-    public static final class LookupTable extends CodeAnnotation {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 8367952567559116160L;
-
-        /**
-         * The number of entries in the table.
-         */
-        public final int npairs;
-
-        /**
-         * The size (in bytes) of entry's key.
-         */
-        public final int keySize;
-
-        /**
-         * The size (in bytes) of entry's offset value.
-         */
-        public final int offsetSize;
-
-        public LookupTable(int position, int npairs, int keySize, int offsetSize) {
-            super(position);
-            this.npairs = npairs;
-            this.keySize = keySize;
-            this.offsetSize = offsetSize;
-        }
-
-        @Override
-        public String toString() {
-            return getClass().getSimpleName() + "@" + position + ": [npairs=" + npairs + ", keySize=" + keySize + ", offsetSize=" + offsetSize + "]";
-        }
-    }
-
-    /**
-     * Represents exception handler information for a specific code position. It includes the catch code position as
-     * well as the caught exception type.
-     */
-    public static final class ExceptionHandler extends Site {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 4897339464722665281L;
-        public final int bci;
-        public final int scopeLevel;
-        public final int handlerPos;
-        public final int handlerBci;
-        public final RiType exceptionType;
-
-        ExceptionHandler(int pcOffset, int bci, int scopeLevel, int handlerPos, int handlerBci, RiType exceptionType) {
-            super(pcOffset);
-            this.bci = bci;
-            this.scopeLevel = scopeLevel;
-            this.handlerPos = handlerPos;
-            this.handlerBci = handlerBci;
-            this.exceptionType = exceptionType;
-        }
-
-        @Override
-        public String toString() {
-            return String.format("%d[<exception edge to %d with type %s>]", pcOffset, handlerPos, (exceptionType == null) ? "null" : exceptionType);
-        }
-    }
-
-    public static final class Mark extends Site {
-        /**
-         *
-         */
-        private static final long serialVersionUID = 3612943150662354844L;
-        public final Object id;
-        public final Mark[] references;
-
-        Mark(int pcOffset, Object id, Mark[] references) {
-            super(pcOffset);
-            this.id = id;
-            this.references = references;
-        }
-
-        @Override
-        public String toString() {
-            if (id == null) {
-                return String.format("%d[<mark with %d references>]", pcOffset, references.length);
-            } else if (id instanceof Integer) {
-                return String.format("%d[<mark with %d references and id %s>]", pcOffset, references.length, Integer.toHexString((Integer) id));
-            } else {
-                return String.format("%d[<mark with %d references and id %s>]", pcOffset, references.length, id.toString());
-            }
-        }
-    }
-
-    /**
-     * List of safepoints, sorted by {@link Site#pcOffset}.
-     */
-    public final List<Safepoint> safepoints = new ArrayList<>();
-
-    /**
-     * List of data references.
-     */
-    public final List<DataPatch> dataReferences = new ArrayList<>();
-
-    /**
-     * List of exception handlers.
-     */
-    public final List<ExceptionHandler> exceptionHandlers = new ArrayList<>();
-
-    /**
-     * List of marks.
-     */
-    public final List<Mark> marks = new ArrayList<>();
-
-    private int frameSize = -1;
-    private int customStackAreaOffset = -1;
-    private int registerRestoreEpilogueOffset = -1;
-    /**
-     * The buffer containing the emitted machine code.
-     */
-    private byte[] targetCode;
-
-    /**
-     * The leading number of bytes in {@link #targetCode} containing the emitted machine code.
-     */
-    private int targetCodeSize;
-
-    private ArrayList<CodeAnnotation> annotations;
-
-    private CiAssumptions assumptions;
-
-    /**
-     * Constructs a new target method.
-     */
-    public CiTargetMethod() {
-    }
-
-    public void setAssumptions(CiAssumptions assumptions) {
-        this.assumptions = assumptions;
-    }
-
-    public CiAssumptions assumptions() {
-        return assumptions;
-    }
-
-    /**
-     * Sets the frame size in bytes. Does not include the return address pushed onto the
-     * stack, if any.
-     *
-     * @param size the size of the frame in bytes
-     */
-    public void setFrameSize(int size) {
-        frameSize = size;
-    }
-
-    /**
-     * Sets the machine that has been generated by the compiler.
-     *
-     * @param code the machine code generated
-     * @param size the size of the machine code
-     */
-    public void setTargetCode(byte[] code, int size) {
-        targetCode = code;
-        targetCodeSize = size;
-    }
-
-    /**
-     * Records a reference to the data section in the code section (e.g. to load an integer or floating point constant).
-     *
-     * @param codePos the position in the code where the data reference occurs
-     * @param data the data that is referenced
-     * @param alignment the alignment requirement of the data or 0 if there is no alignment requirement
-     */
-    public void recordDataReference(int codePos, CiConstant data, int alignment) {
-        assert codePos >= 0 && data != null;
-        dataReferences.add(new DataPatch(codePos, data, alignment));
-    }
-
-    /**
-     * Records a call in the code array.
-     *
-     * @param codePos the position of the call in the code array
-     * @param size the size of the call instruction
-     * @param target the {@link RiRuntime#asCallTarget(Object) target} being called
-     * @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) {
-        final Call call = new Call(target, codePos, size, direct, debugInfo);
-        addSafepoint(call);
-    }
-
-    /**
-     * Records an exception handler for this method.
-     *
-     * @param codePos  the position in the code that is covered by the handler
-     * @param handlerPos    the position of the handler
-     * @param throwableType the type of exceptions handled by the handler
-     */
-    public void recordExceptionHandler(int codePos, int bci, int scopeLevel, int handlerPos, int handlerBci, RiType throwableType) {
-        exceptionHandlers.add(new ExceptionHandler(codePos, bci, scopeLevel, handlerPos, handlerBci, throwableType));
-    }
-
-    /**
-     * Records a safepoint in the code array.
-     *
-     * @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) {
-        addSafepoint(new Safepoint(codePos, debugInfo));
-    }
-
-    private void addSafepoint(Safepoint safepoint) {
-        // The safepoints list must always be sorted
-        if (!safepoints.isEmpty() && safepoints.get(safepoints.size() - 1).pcOffset >= safepoint.pcOffset) {
-            // This re-sorting should be very rare
-            Collections.sort(safepoints);
-        }
-        safepoints.add(safepoint);
-    }
-
-    /**
-     * Records an instruction mark within this method.
-     *
-     * @param codePos the position in the code that is covered by the handler
-     * @param id the identifier for this mark
-     * @param references an array of other marks that this mark references
-     */
-    public Mark recordMark(int codePos, Object id, Mark[] references) {
-        Mark mark = new Mark(codePos, id, references);
-        marks.add(mark);
-        return mark;
-    }
-
-    /**
-     * Allows a method to specify the offset of the epilogue that restores the callee saved registers. Must be called
-     * iff the method is a callee saved method and stores callee registers on the stack.
-     *
-     * @param registerRestoreEpilogueOffset the offset in the machine code where the epilogue begins
-     */
-    public void setRegisterRestoreEpilogueOffset(int registerRestoreEpilogueOffset) {
-        assert this.registerRestoreEpilogueOffset == -1;
-        this.registerRestoreEpilogueOffset = registerRestoreEpilogueOffset;
-    }
-
-    /**
-     * The frame size of the method in bytes.
-     *
-     * @return the frame size
-     */
-    public int frameSize() {
-        assert frameSize != -1 : "frame size not yet initialized!";
-        return frameSize;
-    }
-
-    /**
-     * @return the code offset of the start of the epilogue that restores all callee saved registers, or -1 if this is
-     *         not a callee saved method
-     */
-    public int registerRestoreEpilogueOffset() {
-        return registerRestoreEpilogueOffset;
-    }
-
-    /**
-     * Offset in bytes for the custom stack area (relative to sp).
-     * @return the offset in bytes
-     */
-    public int customStackAreaOffset() {
-        return customStackAreaOffset;
-    }
-
-    /**
-     * @see #customStackAreaOffset()
-     * @param offset
-     */
-    public void setCustomStackAreaOffset(int offset) {
-        customStackAreaOffset = offset;
-    }
-
-    /**
-     * @return the machine code generated for this method
-     */
-    public byte[] targetCode() {
-        return targetCode;
-    }
-
-    /**
-     * @return the size of the machine code generated for this method
-     */
-    public int targetCodeSize() {
-        return targetCodeSize;
-    }
-
-    /**
-     * @return the code annotations or {@code null} if there are none
-     */
-    public List<CodeAnnotation> annotations() {
-        return annotations;
-    }
-
-    public void addAnnotation(CodeAnnotation annotation) {
-        assert annotation != null;
-        if (annotations == null) {
-            annotations = new ArrayList<>();
-        }
-        annotations.add(annotation);
-    }
-
-    private static void appendDebugInfo(StringBuilder sb, CiDebugInfo info) {
-        if (info != null) {
-            appendRefMap(sb, "stackMap", info.frameRefMap);
-            appendRefMap(sb, "registerMap", info.registerRefMap);
-            CiCodePos codePos = info.codePos;
-            if (codePos != null) {
-                CiUtil.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) {
-                        sb.append(" #locks=").append(info.frame().numLocks);
-                    }
-                }
-            }
-        }
-    }
-
-    private static void appendRefMap(StringBuilder sb, String name, CiBitMap map) {
-        if (map != null) {
-            sb.append(' ').append(name).append('[').append(map.toBinaryString()).append(']');
-        }
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiUtil.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,739 +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.sun.cri.ci;
-
-import static java.lang.reflect.Modifier.*;
-
-import java.lang.annotation.*;
-import java.util.*;
-
-import com.sun.cri.ri.*;
-
-/**
- * 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, RiResolvedMethod method) {
-        if (parameterIndex >= 0) {
-            Annotation[][] parameterAnnotations = method.getParameterAnnotations();
-            for (Annotation a : parameterAnnotations[parameterIndex]) {
-                if (a.annotationType() == annotationClass) {
-                    return annotationClass.cast(a);
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Extends the functionality of {@link Class#getSimpleName()} to include a non-empty string for anonymous and local
-     * classes.
-     *
-     * @param clazz the class for which the simple name is being requested
-     * @param withEnclosingClass specifies if the returned name should be qualified with the name(s) of the enclosing
-     *            class/classes of {@code clazz} (if any). This option is ignored if {@code clazz} denotes an anonymous
-     *            or local class.
-     * @return the simple name
-     */
-    public static String getSimpleName(Class<?> clazz, boolean withEnclosingClass) {
-        final String simpleName = clazz.getSimpleName();
-        if (simpleName.length() != 0) {
-            if (withEnclosingClass) {
-                String prefix = "";
-                Class<?> enclosingClass = clazz;
-                while ((enclosingClass = enclosingClass.getEnclosingClass()) != null) {
-                    prefix = prefix + enclosingClass.getSimpleName() + ".";
-                }
-                return prefix + simpleName;
-            }
-            return simpleName;
-        }
-        // Must be an anonymous or local class
-        final String name = clazz.getName();
-        int index = name.indexOf('$');
-        if (index == -1) {
-            return name;
-        }
-        index = name.lastIndexOf('.', index);
-        if (index == -1) {
-            return name;
-        }
-        return name.substring(index + 1);
-    }
-
-    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;
-    }
-
-    /**
-     * Converts a given type to its Java programming language name. The following are examples of strings returned by
-     * this method:
-     *
-     * <pre>
-     *     qualified == true:
-     *         java.lang.Object
-     *         int
-     *         boolean[][]
-     *     qualified == false:
-     *         Object
-     *         int
-     *         boolean[][]
-     * </pre>
-     *
-     * @param riType the type to be converted to a Java name
-     * @param qualified specifies if the package prefix of the type should be included in the returned name
-     * @return the Java name corresponding to {@code riType}
-     */
-    public static String toJavaName(RiType riType, boolean qualified) {
-        CiKind kind = riType.kind(false);
-        if (kind.isPrimitive() || kind == CiKind.Void) {
-            return kind.javaName;
-        }
-        return internalNameToJava(riType.name(), qualified);
-    }
-    /**
-     * Converts a given type to its Java programming language name. The following are examples of strings returned by
-     * this method:
-     *
-     * <pre>
-     *      java.lang.Object
-     *      int
-     *      boolean[][]
-     * </pre>
-     *
-     * @param riType the type to be converted to a Java name
-     * @return the Java name corresponding to {@code riType}
-     */
-    public static String toJavaName(RiType riType) {
-        return (riType == null) ? null : internalNameToJava(riType.name(), true);
-    }
-
-    public static String internalNameToJava(String name, boolean qualified) {
-        switch (name.charAt(0)) {
-            case 'L': {
-                String result = name.substring(1, name.length() - 1).replace('/', '.');
-                if (!qualified) {
-                    final int lastDot = result.lastIndexOf('.');
-                    if (lastDot != -1) {
-                        result = result.substring(lastDot + 1);
-                    }
-                }
-                return result;
-
-            }
-            case '[':
-                return internalNameToJava(name.substring(1), qualified) + "[]";
-            default:
-                if (name.length() != 1) {
-                    throw new IllegalArgumentException("Illegal internal name: " + name);
-                }
-                return CiKind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).javaName;
-        }
-    }
-
-    /**
-     * 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 CiKind#jniName JNI} form of their {@linkplain CiKind 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, RiMethod method) throws IllegalFormatException {
-        final StringBuilder sb = new StringBuilder();
-        int index = 0;
-        RiSignature 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(toJavaName(sig.returnType(null), qualified));
-                        break;
-                    }
-                    case 'H':
-                        qualified = true;
-                        // fall through
-                    case 'h': {
-                        sb.append(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(toJavaName(sig.argumentTypeAt(i, null), qualified));
-                        }
-                        break;
-                    }
-                    case 'f': {
-                        sb.append(!(method instanceof RiResolvedMethod) ? "unresolved" : isStatic(((RiResolvedMethod) 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 CiKind#jniName JNI} form of its {@linkplain CiKind 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, RiField field) throws IllegalFormatException {
-        final StringBuilder sb = new StringBuilder();
-        int index = 0;
-        RiType 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(toJavaName(type, qualified));
-                        break;
-                    }
-                    case 'H':
-                        qualified = true;
-                        // fall through
-                    case 'h': {
-                        sb.append(toJavaName(field.holder(), qualified));
-                        break;
-                    }
-                    case 'n': {
-                        sb.append(field.name());
-                        break;
-                    }
-                    case 'f': {
-                        sb.append(!(field instanceof RiResolvedField) ? "unresolved" : isStatic(((RiResolvedField) field).accessFlags()) ? "static" : "instance");
-                        break;
-                    }
-                    case '%': {
-                        sb.append('%');
-                        break;
-                    }
-                    default: {
-                        throw new UnknownFormatConversionException(String.valueOf(specifier));
-                    }
-                }
-            } else {
-                sb.append(ch);
-            }
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Gets a stack trace element for a given method and bytecode index.
-     */
-    public static StackTraceElement toStackTraceElement(RiMethod method, @SuppressWarnings("unused") int bci) {
-        // TODO(tw): Look if we can use bci to get the line number.
-        return new StackTraceElement(CiUtil.toJavaName(method.holder()), method.name(), null, -1);
-    }
-
-    /**
-     * 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, RiMethod, int)}
-     * without having to supply a a {@link StringBuilder} instance and convert the result
-     * to a string.
-     */
-    public static String toLocation(RiResolvedMethod 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 RiMethod#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, RiResolvedMethod method, int bci) {
-        StackTraceElement ste = method.toStackTraceElement(bci);
-        if (ste.getFileName() != null && ste.getLineNumber() > 0) {
-            sb.append(ste);
-        } else {
-            sb.append(CiUtil.format("%H.%n(%p)", 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:");
-            CiBitMap 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:");
-            CiBitMap 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 CiKind[] signatureToKinds(RiResolvedMethod method) {
-        CiKind receiver = isStatic(method.accessFlags()) ? null : method.holder().kind(true);
-        return signatureToKinds(method.signature(), receiver);
-    }
-
-    public static CiKind[] signatureToKinds(RiSignature signature, CiKind receiverKind) {
-        int args = signature.argumentCount(false);
-        CiKind[] result;
-        int i = 0;
-        if (receiverKind != null) {
-            result = new CiKind[args + 1];
-            result[0] = receiverKind;
-            i = 1;
-        } else {
-            result = new CiKind[args];
-        }
-        for (int j = 0; j < args; j++) {
-            result[i + j] = signature.argumentKindAt(j, true);
-        }
-        return result;
-    }
-
-    public static Class<?>[] signatureToTypes(RiSignature signature, RiType accessingClass) {
-        int count = signature.argumentCount(false);
-        Class<?>[] result = new Class<?>[count];
-        for (int i = 0; i < result.length; ++i) {
-            result[i] = ((RiResolvedType) signature.argumentTypeAt(i, accessingClass)).toJava();
-        }
-        return result;
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiValue.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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.sun.cri.ci;
-
-import java.io.*;
-
-/**
- * Abstract base class for values manipulated by the compiler. All values have a {@linkplain CiKind kind} and are immutable.
- */
-public abstract class CiValue implements Serializable {
-    private static final long serialVersionUID = -6909397188697766469L;
-
-    @SuppressWarnings("serial")
-    public static CiValue IllegalValue = new CiValue(CiKind.Illegal) {
-        @Override
-        public String toString() {
-            return "-";
-        }
-    };
-
-    /**
-     * The kind of this value.
-     */
-    public final CiKind kind;
-
-    /**
-     * Initializes a new value of the specified kind.
-     * @param kind the kind
-     */
-    protected CiValue(CiKind kind) {
-        this.kind = kind;
-    }
-
-    /**
-     * String representation of the kind, which should be the end of all {@link #toString()} implementation of subclasses.
-     */
-    protected final String kindSuffix() {
-        return "|" + kind.typeChar;
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiValueUtil.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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.sun.cri.ci;
-
-public class CiValueUtil {
-    public static boolean isIllegal(CiValue value) {
-        assert value != null;
-        return value == CiValue.IllegalValue;
-    }
-
-    public static boolean isLegal(CiValue value) {
-        return !isIllegal(value);
-    }
-
-    public static boolean isVirtualObject(CiValue value) {
-        assert value != null;
-        return value instanceof CiVirtualObject;
-    }
-
-
-    public static boolean isVariable(CiValue value) {
-        assert value != null;
-        return value instanceof CiVariable;
-    }
-
-    public static CiVariable asVariable(CiValue value) {
-        assert value != null;
-        return (CiVariable) value;
-    }
-
-
-    public static boolean isConstant(CiValue value) {
-        assert value != null;
-        return value instanceof CiConstant;
-    }
-
-
-    public static boolean isStackSlot(CiValue value) {
-        assert value != null;
-        return value instanceof CiStackSlot;
-    }
-
-    public static CiStackSlot asStackSlot(CiValue value) {
-        assert value != null;
-        return (CiStackSlot) value;
-    }
-
-
-    public static boolean isRegister(CiValue value) {
-        assert value != null;
-        return value instanceof CiRegisterValue;
-    }
-
-    public static CiRegister asRegister(CiValue value) {
-        assert value != null;
-        return ((CiRegisterValue) value).reg;
-    }
-
-    public static CiRegister asIntReg(CiValue value) {
-        assert value.kind == CiKind.Int || value.kind == CiKind.Jsr;
-        return asRegister(value);
-    }
-
-    public static CiRegister asLongReg(CiValue value) {
-        assert value.kind == CiKind.Long : value.kind;
-        return asRegister(value);
-    }
-
-    public static CiRegister asObjectReg(CiValue value) {
-        assert value.kind == CiKind.Object;
-        return asRegister(value);
-    }
-
-    public static CiRegister asFloatReg(CiValue value) {
-        assert value.kind == CiKind.Float;
-        return asRegister(value);
-    }
-
-    public static CiRegister asDoubleReg(CiValue value) {
-        assert value.kind == CiKind.Double;
-        return asRegister(value);
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiVariable.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +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.sun.cri.ci;
-
-/**
- * Represents a value that is yet to be bound to a machine location (such as
- * a {@linkplain CiRegister register} or stack {@linkplain CiAddress address})
- * by a register allocator.
- */
-public final class CiVariable extends CiValue {
-    private static final long serialVersionUID = 4507578431686109809L;
-
-    /**
-     * The identifier of the variable. This is a non-zero index in a contiguous 0-based name space.
-     */
-    public final int index;
-
-    /**
-     * Creates a new variable.
-     * @param kind
-     * @param index
-     */
-    private CiVariable(CiKind kind, int index) {
-        super(kind);
-        this.index = index;
-    }
-
-    private static CiVariable[] generate(CiKind kind, int count) {
-        CiVariable[] variables = new CiVariable[count];
-        for (int i = 0; i < count; i++) {
-            variables[i] = new CiVariable(kind, i);
-        }
-        return variables;
-    }
-
-    private static final int CACHE_PER_KIND_SIZE = 100;
-
-    /**
-     * Cache of common variables.
-     */
-    private static final CiVariable[][] cache = new CiVariable[CiKind.values().length][];
-    static {
-        for (CiKind kind : CiKind.values()) {
-            cache[kind.ordinal()] = generate(kind, CACHE_PER_KIND_SIZE);
-        }
-    }
-
-    /**
-     * Gets a variable for a given kind and index.
-     *
-     * @param kind
-     * @param index
-     * @return the corresponding {@code CiVariable}
-     */
-    public static CiVariable get(CiKind kind, int index) {
-        //assert kind == kind.stackKind() : "Variables can be only created for stack kinds";
-        assert index >= 0;
-        CiVariable[] cachedVars = cache[kind.ordinal()];
-        if (index < cachedVars.length) {
-            return cachedVars[index];
-        }
-        return new CiVariable(kind, index);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof CiVariable) {
-            CiVariable var = (CiVariable) obj;
-            return kind == var.kind && index == var.index;
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return (index << 4) | kind.ordinal();
-    }
-
-    @Override
-    public String toString() {
-        return "v" + index + kindSuffix();
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/CiVirtualObject.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ci;
-
-import com.sun.cri.ri.*;
-
-/**
- * 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 CiValue {
-    private static final long serialVersionUID = -2907197776426346021L;
-
-    private final RiType type;
-    private CiValue[] 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 RiResolvedType#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(RiType type, CiValue[] values, int id) {
-        return new CiVirtualObject(type, values, id);
-    }
-
-    private CiVirtualObject(RiType type, CiValue[] values, int id) {
-        super(CiKind.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 RiType type() {
-        return type;
-    }
-
-    /**
-     * @return an array containing all the values to be stored into the object when it is recreated.
-     */
-    public CiValue[] 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(CiValue[] 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 RiRuntime runtime;
-
-        public CiVirtualObjectFactory(RiRuntime runtime) {
-            this.runtime = runtime;
-        }
-
-        public CiVirtualObject constantProxy(CiKind kind, CiValue objectValue, CiValue primitiveValue) {
-            CiConstant cKind = CiConstant.forObject(kind);
-            // TODO: here the ordering is hard coded... we should query RiType.fields() and act accordingly
-            return new CiVirtualObject(runtime.getType(CiConstant.class), new CiValue[] {cKind, primitiveValue, CiValue.IllegalValue, objectValue}, nextId++);
-        }
-
-        public CiValue proxy(CiValue ciValue) {
-            switch (ciValue.kind) {
-                case Boolean:
-                    return new CiVirtualObject(runtime.getType(Boolean.class), new CiValue[] {ciValue}, nextId++);
-                case Byte:
-                    return new CiVirtualObject(runtime.getType(Byte.class), new CiValue[] {ciValue}, nextId++);
-                case Char:
-                    return new CiVirtualObject(runtime.getType(Character.class), new CiValue[] {ciValue}, nextId++);
-                case Double:
-                    return new CiVirtualObject(runtime.getType(Double.class), new CiValue[] {ciValue, CiValue.IllegalValue}, nextId++);
-                case Float:
-                    return new CiVirtualObject(runtime.getType(Float.class), new CiValue[] {ciValue}, nextId++);
-                case Int:
-                    return new CiVirtualObject(runtime.getType(Integer.class), new CiValue[] {ciValue}, nextId++);
-                case Long:
-                    return new CiVirtualObject(runtime.getType(Long.class), new CiValue[] {ciValue, CiValue.IllegalValue}, nextId++);
-                case Object:
-                    return ciValue;
-                case Short:
-                    return new CiVirtualObject(runtime.getType(Short.class), new CiValue[] {ciValue}, nextId++);
-                default:
-                    assert false : ciValue.kind;
-                    return null;
-            }
-        }
-
-        public CiVirtualObject arrayProxy(RiType arrayType, CiValue[] values) {
-            return new CiVirtualObject(arrayType, values, nextId++);
-        }
-
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ci/package-info.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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.
- */
-/**
- * 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.max.graal.compiler.graphbuilder.Bytecodes}.
- *
- * The target hardware architecture is represented by {@link com.sun.cri.ci.CiArchitecture} and the specific target machine
- * environment for a compiler instance is represented by {@link com.sun.cri.ci.CiTarget}.
- * <p>
- * A {@code CiResult} encapsulates
- * {@linkplain com.sun.cri.ci.CiStatistics compilation statistics}, possible {@linkplain com.sun.cri.ci.CiBailout error state}
- * and the {@linkplain com.sun.cri.ci.CiTargetMethod compiled code and metadata}.
- * {@link com.sun.cri.ci.CiCodePos} and {@link com.sun.cri.ci.CiDebugInfo} provide detailed information to the
- * runtime to support debugging and deoptimization of the compiled code.
- * <p>
- * The compiler manipulates {@link com.sun.cri.ci.CiValue} instances that have a {@link com.sun.cri.ci.CiKind}, and are
- * immutable. A concrete {@link com.sun.cri.ci.CiValue value} is one of the following subclasses:
- * <ul>
- * <li>{@link com.sun.cri.ci.CiConstant}: a constant value.
- * <li>{@link com.sun.cri.ci.CiRegisterValue}: a value stored in a {@linkplain com.sun.cri.ci.CiRegister target machine register}.
- * <li>{@link com.sun.cri.ci.CiStackSlot}: a spill slot or an outgoing stack-based argument in a method's frame.
- * <li>{@link com.sun.cri.ci.CiAddress}: an address in target machine memory.
- * <li>{@link com.sun.cri.ci.CiVariable}: a value (cf. virtual register) that is yet to be bound to a target machine location (physical register or memory address).
- *</ul>
- */
-package com.sun.cri.ci;
-
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiCompiledMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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.sun.cri.ri;
-
-/**
- * Represents a compiled instance of a method. It may have been invalidated or removed in the meantime.
- */
-public interface RiCompiledMethod {
-
-    /**
-     * Returns the method to which the compiled code belongs.
-     * @return the method to which the compiled code belongs.
-     */
-    RiResolvedMethod method();
-
-    /**
-     * @return true if the code represented by this object is still valid, false otherwise (may happen due to deopt, etc.)
-     */
-    boolean isValid();
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiConstantPool.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +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.sun.cri.ri;
-
-/**
- * Represents the runtime representation of the constant pool that is
- * used by the compiler when parsing bytecode. The {@code lookupXXX} methods look up a constant
- * pool entry without performing resolution, and are used during compilation.
- */
-public interface RiConstantPool {
-
-    /**
-     * Makes sure that the type referenced by the specified constant pool entry is loaded and
-     * initialized. This can be used to compile time resolve a type. It works for field, method,
-     * or type constant pool entries.
-     * @param cpi the index of the constant pool entry that references the type
-     * @param opcode the opcode of the instruction that references the type
-     */
-    void loadReferencedType(int cpi, int opcode);
-
-    /**
-     * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks
-     * specific to the JVM instruction it denotes are performed if the field is already resolved.
-     * Should any of these checks fail, an {@linkplain RiField#isResolved() unresolved}
-     * field reference is returned.
-     *
-     * @param cpi the constant pool index
-     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
-     * @return a reference to the field at {@code cpi} in this pool
-     * @throws ClassFormatError if the entry at {@code cpi} is not a field
-     */
-    RiField lookupField(int cpi, int opcode);
-
-    /**
-     * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks
-     * specific to the JVM instruction it denotes are performed if the method is already resolved.
-     * Should any of these checks fail, an {@linkplain RiMethod#isResolved() unresolved}
-     * method reference is returned.
-     *
-     * @param cpi the constant pool index
-     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
-     * @return a reference to the method at {@code cpi} in this pool
-     * @throws ClassFormatError if the entry at {@code cpi} is not a method
-     */
-    RiMethod lookupMethod(int cpi, int opcode);
-
-    /**
-     * Looks up a reference to a type. If {@code opcode} is non-negative, then resolution checks
-     * specific to the JVM instruction it denotes are performed if the type is already resolved.
-     * Should any of these checks fail, an {@linkplain RiType#isResolved() unresolved}
-     * type reference is returned.
-     *
-     * @param cpi the constant pool index
-     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
-     * @return a reference to the compiler interface type
-     */
-    RiType lookupType(int cpi, int opcode);
-
-    /**
-     * Looks up a method signature.
-     *
-     * @param cpi the constant pool index
-     * @return the method signature at index {@code cpi} in this constant pool
-     */
-    RiSignature lookupSignature(int cpi);
-
-    /**
-     * Looks up a constant at the specified index.
-     * @param cpi the constant pool index
-     * @return the {@code CiConstant} instance representing the constant
-     */
-    Object lookupConstant(int cpi);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiExceptionHandler.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +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.sun.cri.ri;
-
-/**
- * Represents an exception handler within the bytecode.
- */
-public interface RiExceptionHandler {
-
-    /**
-     * Gets the start bytecode index of the protected range of this handler.
-     * @return the start bytecode index
-     */
-    int startBCI();
-
-    /**
-     * Gets the end bytecode index of the protected range of this handler.
-     * @return the end bytecode index
-     */
-    int endBCI();
-
-    /**
-     * Gets the bytecode index of the handler block of this handler.
-     * @return the handler block bytecode index
-     */
-    int handlerBCI();
-
-    /**
-     * Gets the index into the constant pool representing the type of exception
-     * caught by this handler.
-     * @return the constant pool index of the catch type
-     */
-    int catchTypeCPI();
-
-    /**
-     * Checks whether this handler catches all exceptions.
-     * @return {@code true} if this handler catches all exceptions
-     */
-    boolean isCatchAll();
-
-    /**
-     * The type of exception caught by this exception handler.
-     *
-     * @return the exception type
-     */
-    RiType catchType();
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiField.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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.sun.cri.ri;
-
-
-import com.sun.cri.ci.*;
-
-/**
- * Represents a reference to a field, including both resolved and unresolved fields. Fields, like methods and types, are
- * resolved through {@link RiConstantPool constant pools}, and their actual implementation is provided by the
- * {@link RiRuntime runtime} to the compiler.
- */
-public interface RiField {
-    /**
-     * Gets the name of this field as a string.
-     * @return the name of this field
-     */
-    String name();
-
-    /**
-     * Gets the type of this field as a compiler-runtime interface type.
-     * @return the type of this field
-     */
-    RiType type();
-
-    /**
-     * Gets the kind of this field.
-     * @param architecture When true, the architecture-specific kind used for emitting machine code is returned.
-     *        When false, the kind according to the Java specification is returned.
-     * @return the kind
-     */
-    CiKind kind(boolean architecture);
-
-    /**
-     * Gets the holder of this field as a compiler-runtime interface type.
-     * @return the holder of this field
-     */
-    RiType holder();
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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.sun.cri.ri;
-
-/**
- * Represents resolved and unresolved methods. Methods, like fields and types, are resolved through
- * {@link RiConstantPool constant pools}, and their actual implementation is provided by the {@link RiRuntime runtime}
- * to the compiler.
- */
-public interface RiMethod {
-
-    /**
-     * Gets the name of the method as a string.
-     * @return the name of the method
-     */
-    String name();
-
-    /**
-     * Gets the type in which this method is declared.
-     * @return the type in which this method is declared
-     */
-    RiType holder();
-
-    /**
-     * Gets the signature of the method.
-     * @return the signature of the method
-     */
-    RiSignature signature();
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRegisterAttributes.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +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.sun.cri.ri;
-
-import java.util.*;
-
-import com.sun.cri.ci.*;
-
-/**
- * A collection of register attributes. The specific attribute values for a register may be
- * local to a compilation context. For example, a {@link RiRegisterConfig} in use during
- * a compilation will determine which registers are callee saved.
- */
-public class RiRegisterAttributes {
-
-    /**
-     * 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 RiRegisterAttributes(boolean isCallerSave, boolean isCalleeSave, boolean isAllocatable) {
-        this.isCallerSave = isCallerSave;
-        this.isCalleeSave = isCalleeSave;
-        this.isAllocatable = isAllocatable;
-    }
-
-    public static final RiRegisterAttributes NONE = new RiRegisterAttributes(false, false, false);
-
-    /**
-     * Creates a map from register {@linkplain CiRegister#number numbers} to register
-     * {@linkplain RiRegisterAttributes 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 RiRegisterAttributes[] createMap(RiRegisterConfig registerConfig, CiRegister[] registers) {
-        RiRegisterAttributes[] map = new RiRegisterAttributes[registers.length];
-        for (CiRegister reg : registers) {
-            if (reg != null) {
-                CiCalleeSaveLayout csl = registerConfig.getCalleeSaveLayout();
-                RiRegisterAttributes attr = new RiRegisterAttributes(
-                                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.max.cri/src/com/sun/cri/ri/RiRegisterConfig.java	Tue Jan 03 16:24:22 2012 +0100
+++ /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.sun.cri.ri;
-
-import java.util.*;
-
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiCallingConvention.Type;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
-
-/**
- * A register configuration binds roles and {@linkplain RiRegisterAttributes attributes}
- * to physical registers.
- */
-public interface RiRegisterConfig {
-
-    /**
-     * Gets the register to be used for returning a value of a given kind.
-     */
-    CiRegister getReturnRegister(CiKind 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, CiKind[] 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 RiRegisterAttributes 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[])
-     */
-    RiRegisterAttributes[] 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.max.cri/src/com/sun/cri/ri/RiResolvedField.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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.sun.cri.ri;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-
-import com.sun.cri.ci.*;
-
-/**
- * Represents a reference to a resolved field. Fields, like methods and types, are
- * resolved through {@link RiConstantPool constant pools}, and their actual implementation is provided by the
- * {@link RiRuntime runtime} to the compiler.
- */
-public interface RiResolvedField extends RiField {
-
-    /**
-     * Gets the access flags for this field. Only the flags specified in the JVM specification
-     * will be included in the returned mask. The utility methods in the {@link Modifier} class
-     * should be used to query the returned mask for the presence/absence of individual flags.
-     * @return the mask of JVM defined field access flags defined for this field
-     */
-    int accessFlags();
-
-    /**
-     * Gets the constant value of this field if available.
-     * @param receiver object from which this field's value is to be read. This value is ignored if this field is static.
-     * @return the constant value of this field or {@code null} if the constant value is not available
-     */
-    CiConstant constantValue(CiConstant receiver);
-
-    /**
-     * Gets the holder of this field as a compiler-runtime interface type.
-     * @return the holder of this field
-     */
-    RiResolvedType holder();
-
-    /**
-     * Returns this field's annotation of a specified type.
-     *
-     * @param annotationClass the Class object corresponding to the annotation type
-     * @return the annotation of type {@code annotationClass} for this field if present, else null
-     */
-    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiResolvedMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,228 +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.sun.cri.ri;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-import com.sun.cri.ci.*;
-
-
-/**
- * Represents resolved methods. Methods, like fields and types, are resolved through
- * {@link RiConstantPool constant pools}, and their actual implementation is provided by the {@link RiRuntime runtime}
- * to the compiler.
- */
-public interface RiResolvedMethod extends RiMethod {
-
-    /**
-     * Gets the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
-     * @return the bytecode of the method or {@code null} if none is available
-     */
-    byte[] code();
-
-    /**
-     * Gets the size of the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
-     * @return the size of the bytecode in bytes, or 0 if no bytecode is available
-     */
-    int codeSize();
-
-    /**
-     * Gets the symbol used to link this method if it is native, otherwise {@code null}.
-     */
-    String jniSymbol();
-
-    /**
-     * Gets the type in which this method is declared.
-     * @return the type in which this method is declared
-     */
-    RiResolvedType holder();
-
-    /**
-     * Gets the maximum number of locals used in this method's bytecode.
-     * @return the maximum number of locals
-     */
-    int maxLocals();
-
-    /**
-     * Gets the maximum number of stack slots used in this method's bytecode.
-     * @return the maximum number of stack slots
-     */
-    int maxStackSize();
-
-    /**
-     * Checks whether this method has balanced monitor operations.
-     * @return {@code true} if the method has balanced monitor operations
-     */
-    boolean hasBalancedMonitors();
-
-    /**
-     * Gets the access flags for this method. Only the flags specified in the JVM specification
-     * will be included in the returned mask. The utility methods in the {@link Modifier} class
-     * should be used to query the returned mask for the presence/absence of individual flags.
-     * @return the mask of JVM defined method access flags defined for this method
-     */
-    int accessFlags();
-
-    /**
-     * Checks whether this method is a leaf method.
-     * @return {@code true} if the method is a leaf method (that is, is final or private)
-     */
-    boolean isLeafMethod();
-
-    /**
-     * Checks whether this method is a class initializer.
-     * @return {@code true} if the method is a class initializer
-     */
-    boolean isClassInitializer();
-
-    /**
-     * Checks whether this method is a constructor.
-     * @return {@code true} if the method is a constructor
-     */
-    boolean isConstructor();
-
-    /**
-     * Checks whether this method has been overridden. Decisions made based
-     * on a method being overridden must be registered as dependencies.
-     * @return {@code true} if the method has been overridden
-     */
-    boolean isOverridden();
-
-    /**
-     * Checks whether the compiler can insert safepoint polls in this method.
-     * @return {@code true} if the method cannot have safepoint polls inserted
-     */
-    boolean noSafepointPolls();
-
-    /**
-     * Gets a map from bytecode indexes to bit maps denoting the live locals at that position.
-     * If a non-null array is return, its length is guaranteed to be equal to {@code code().length}.
-     *
-     * @return the liveness map if it is available; {@code null} otherwise
-     */
-    CiBitMap[] livenessMap();
-
-    /**
-     * Checks whether this method can be statically bound (that is, it is final or private or static).
-     * @return {@code true} if this method can be statically bound
-     */
-    boolean canBeStaticallyBound();
-
-    /**
-     * Gets the list of exception handlers for this method.
-     * @return the list of exception handlers
-     */
-    RiExceptionHandler[] exceptionHandlers();
-
-    /**
-     * Gets a stack trace element for this method and a given bytecode index.
-     */
-    StackTraceElement toStackTraceElement(int bci);
-
-    /**
-     * Temporary work-around to support the @ACCESSOR Maxine annotation.
-     * Non-Maxine VMs should just return {@code null}.
-     */
-    RiResolvedType accessor();
-
-    /**
-     * Gets the intrinsic id of this method.
-     */
-    String intrinsic();
-
-    /**
-     * Provides an estimate of how often this method has been executed.
-     * @return The number of invocations, or -1 if this information isn't available.
-     */
-    int invocationCount();
-
-    /**
-     * Returns an estimate of hot often an exception was seen at the given bytecode.
-     * @return The estimate in percent (0-100), with 0 meaning never and 100 meaning always, or -1 if this information isn't available.
-     */
-    int exceptionProbability(int bci);
-
-    /**
-     * Returns the type profile of the instruction at the given byte code index.
-     * @return The RiTypeProfile information, or null if it isn't available.
-     */
-    RiTypeProfile typeProfile(int bci);
-
-    /**
-     * Returns an estimate of how often the branch at the given byte code was taken.
-     * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or -1 if this information isn't available.
-     */
-    double branchProbability(int bci);
-
-    /**
-     * Returns an estimate of how often the branches of the switch at the given byte code were taken.
-     * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or NULL if this information isn't available.
-     * The default case is specified at the last index.
-     */
-    double[] switchProbability(int bci);
-
-    /**
-     * Returns a map that the compiler can use to store objects that should survive the current compilation.
-     */
-    Map<Object, Object> compilerStorage();
-
-    /**
-     * Returns a pointer to the method's constant pool.
-     * @return the constant pool
-     */
-    RiConstantPool getConstantPool();
-
-    /**
-     * Returns this method's annotation of a specified type.
-     *
-     * @param annotationClass the Class object corresponding to the annotation type
-     * @return the annotation of type {@code annotationClass} for this method if present, else null
-     */
-    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
-
-    /**
-     * Returns an array of arrays that represent the annotations on the formal
-     * parameters, in declaration order, of this method.
-     *
-     * @see Method#getParameterAnnotations()
-     * @see CiUtil#getParameterAnnotation(int, RiResolvedMethod)
-     */
-    Annotation[][] getParameterAnnotations();
-
-    /**
-     * Returns an array of {@link Type} objects that represent the formal
-     * parameter types, in declaration order, of this method.
-     *
-     * @see Method#getGenericParameterTypes()
-     */
-    Type[] getGenericParameterTypes();
-
-    /**
-     * Returns a {@link Type} object that represents the formal return type of this method.
-     *
-     * @see Method#getGenericReturnType()
-     */
-    Type getGenericReturnType();
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiResolvedType.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +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.sun.cri.ri;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-
-import com.sun.cri.ci.*;
-
-/**
- * Represents a resolved in the compiler-runtime interface. Types include primitives, objects, {@code void},
- * and arrays thereof. Types, like fields and methods, are resolved through {@link RiConstantPool constant pools}, and
- * their actual implementation is provided by the {@link RiRuntime runtime} to the compiler.
- */
-public interface RiResolvedType extends RiType {
-
-    /**
-     * Gets the encoding of (that is, a constant representing the value of) the specified part of this type.
-     * @param r the part of the this type
-     * @return a constant representing a reference to the specified part of this type
-     */
-    CiConstant getEncoding(Representation r);
-
-    /**
-     * Checks whether this type has any subclasses so far. Any decisions
-     * based on this information require the registration of a dependency, since
-     * this information may change.
-     * @return {@code true} if this class has subclasses
-     */
-    boolean hasSubclass();
-
-    /**
-     * Checks whether this type has a finalizer method.
-     * @return {@code true} if this class has a finalizer
-     */
-    boolean hasFinalizer();
-
-    /**
-     * Checks whether this type has any finalizable subclasses so far. Any decisions
-     * based on this information require the registration of a dependency, since
-     * this information may change.
-     * @return {@code true} if this class has any subclasses with finalizers
-     */
-    boolean hasFinalizableSubclass();
-
-    /**
-     * Checks whether this type is an interface.
-     * @return {@code true} if this type is an interface
-     */
-    boolean isInterface();
-
-    /**
-     * Checks whether this type is an instance class.
-     * @return {@code true} if this type is an instance class
-     */
-    boolean isInstanceClass();
-
-    /**
-     * Checks whether this type is an array class.
-     * @return {@code true} if this type is an array class
-     */
-    boolean isArrayClass();
-
-    /**
-     * Gets the access flags for this type. Only the flags specified in the JVM specification
-     * will be included in the returned mask. The utility methods in the {@link Modifier} class
-     * should be used to query the returned mask for the presence/absence of individual flags.
-     * @return the mask of JVM defined class access flags defined for this type
-     */
-    int accessFlags();
-
-    /**
-     * Checks whether this type is initialized.
-     * @return {@code true} if this type is initialized
-     */
-    boolean isInitialized();
-
-    /**
-     * Checks whether this type is a subtype of another type.
-     * @param other the type to test
-     * @return {@code true} if this type a subtype of the specified type
-     */
-    boolean isSubtypeOf(RiResolvedType other);
-
-    /**
-     * Checks whether the specified object is an instance of this type.
-     * @param obj the object to test
-     * @return {@code true} if the object is an instance of this type
-     */
-    boolean isInstance(CiConstant obj);
-
-    /**
-     * Attempts to get an exact type for this type. Final classes,
-     * arrays of final classes, and primitive types all have exact types.
-     * @return the exact type of this type, if it exists; {@code null} otherwise
-     */
-    RiResolvedType exactType();
-
-    /**
-     * Gets the super type of this type or {@code null} if no such type exists.
-     */
-    RiResolvedType superType();
-
-    /**
-     * Attempts to get the unique concrete subtype of this type.
-     * @return the exact type of this type, if it exists; {@code null} otherwise
-     */
-    RiResolvedType uniqueConcreteSubtype();
-
-    /**
-     * For array types, gets the type of the components.
-     * @return the component type of this array type
-     */
-    RiResolvedType componentType();
-
-    /**
-     * Gets the type representing an array with elements of this type.
-     * @return a new compiler interface type representing an array of this type
-     */
-    RiResolvedType arrayOf();
-
-    /**
-     * Resolves the method implementation for virtual dispatches on objects
-     * of this dynamic type.
-     * @param method the method to select the implementation of
-     * @return the method implementation that would be selected at runtime
-     */
-    RiResolvedMethod resolveMethodImpl(RiResolvedMethod method);
-
-    /**
-     * Given an RiMethod a, returns a concrete RiMethod b that is the only possible
-     * unique target for a virtual call on a(). Returns {@code null} if either no
-     * such concrete method or more than one such method exists. Returns the method a
-     * if a is a concrete method that is not overridden. If the compiler uses the
-     * result of this method for its compilation, it must register an assumption
-     * (see {@link CiAssumptions}), because dynamic class loading can invalidate
-     * the result of this method.
-     * @param method the method a for which a unique concrete target is searched
-     * @return the unique concrete target or {@code null} if no such target exists
-     *         or assumptions are not supported by this runtime
-     */
-    RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method);
-
-    /**
-     * Returns the instance fields declared in this class sorted by field offset.
-     * @return an array of instance fields
-     */
-    RiResolvedField[] declaredFields();
-
-    /**
-     * Returns this type's annotation of a specified type.
-     *
-     * @param annotationClass the Class object corresponding to the annotation type
-     * @return the annotation of type {@code annotationClass} for this type if present, else null
-     */
-    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
-
-    /**
-     * Returns the java.lang.Class object representing this RiType instance or {@code null} if none exists.
-     * @return the java.lang.Class object
-     */
-    Class<?> toJava();
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRuntime.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +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.sun.cri.ri;
-
-import java.lang.reflect.*;
-
-import com.sun.cri.ci.*;
-
-/**
- * Encapsulates the main functionality of the runtime for the compiler, including access
- * to constant pools, OSR frames, inlining requirements, and runtime calls such as checkcast.
-s */
-public interface RiRuntime {
-
-    /**
-     * Offset of the lock within the lock object on the stack.
-
-     * Note: superseded by sizeOfLockData() in Graal.
-     *
-     * @return the offset in bytes
-     */
-    int basicObjectLockOffsetInBytes();
-
-    /**
-     * Get the size in bytes of a lock object on the stack.
-     *
-     * Note: superseded by sizeOfLockData() in Graal.
-     */
-    int sizeOfBasicObjectLock();
-
-    /**
-     * Get the size in bytes for locking information on the stack.
-     */
-    int sizeOfLockData();
-
-    /**
-     * The offset of the normal entry to the code. The compiler inserts NOP instructions to satisfy this constraint.
-     *
-     * @return the code offset in bytes
-     */
-    int codeOffset();
-
-    /**
-     * Returns the disassembly of the given code bytes. Used for debugging purposes only.
-     *
-     * @param code the code bytes that should be disassembled
-     * @param address an address at which the bytes are located. This can be used for an address prefix per line of disassembly.
-     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
-     */
-    String disassemble(byte[] code, long address);
-
-    /**
-     * Returns the disassembly of the given code bytes. Used for debugging purposes only.
-     *
-     * @param targetMethod the {@link CiTargetMethod} containing the code bytes that should be disassembled
-     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
-     */
-    String disassemble(CiTargetMethod targetMethod);
-
-    /**
-     * Returns the disassembly of the given method in a {@code javap}-like format.
-     * Used for debugging purposes only.
-     *
-     * @param method the method that should be disassembled
-     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
-     */
-    String disassemble(RiResolvedMethod method);
-
-    /**
-     * Registers the given compiler stub and returns an object that can be used to identify it in the relocation
-     * information.
-     *
-     * @param targetMethod the target method representing the code of the compiler stub
-     * @param name the name of the stub, used for debugging purposes only
-     * @return the identification object
-     */
-    Object registerCompilerStub(CiTargetMethod targetMethod, String name);
-
-    /**
-     * Returns the RiType object representing the base type for the given kind.
-     */
-    RiResolvedType asRiType(CiKind kind);
-
-    /**
-     * Returns the type of the given constant object.
-     *
-     * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()}
-     */
-    RiResolvedType getTypeOf(CiConstant constant);
-
-
-    RiResolvedType getType(Class<?> clazz);
-
-    /**
-     * Returns true if the given type is a subtype of java/lang/Throwable.
-     */
-    boolean isExceptionType(RiResolvedType type);
-
-    /**
-     * Used by the canonicalizer to compare objects, since a given runtime might not want to expose the real objects to the compiler.
-     *
-     * @return true if the two parameters represent the same runtime object, false otherwise
-     */
-    boolean areConstantObjectsEqual(CiConstant x, CiConstant y);
-
-    /**
-     * Gets the register configuration to use when compiling a given method.
-     *
-     * @param method the top level method of a compilation
-     */
-    RiRegisterConfig getRegisterConfig(RiMethod method);
-
-    /**
-     * Custom area on the stack of each compiled method that the VM can use for its own purposes.
-     * @return the size of the custom area in bytes
-     */
-    int getCustomStackAreaSize();
-
-    /**
-     * Minimum size of the stack area reserved for outgoing parameters. This area is reserved in all cases, even when
-     * the compiled method has no regular call instructions.
-     * @return the minimum size of the outgoing parameter area in bytes
-     */
-    int getMinimumOutgoingSize();
-
-    /**
-     * Gets the length of the array that is wrapped in a CiConstant object.
-     */
-    int getArrayLength(CiConstant array);
-
-    /**
-     * Converts the given CiConstant object to a object.
-     *
-     * @return {@code null} if the conversion is not possible <b>OR</b> {@code c.isNull() == true}
-     */
-    Object asJavaObject(CiConstant c);
-
-    /**
-     * Converts the given CiConstant object to a {@link Class} object.
-     *
-     * @return {@code null} if the conversion is not possible.
-     */
-    Class<?> asJavaClass(CiConstant c);
-
-    /**
-     * Performs any runtime-specific conversion on the object used to describe the target of a call.
-     */
-    Object asCallTarget(Object target);
-
-    /**
-     * 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);
-
-    /**
-     * Provides the {@link RiMethod} for a {@link Method} obtained via reflection.
-     */
-    RiResolvedMethod getRiMethod(Method reflectionMethod);
-
-    /**
-     * Installs some given machine code as the implementation of a given method.
-     *
-     * @param method a method whose executable code is being modified
-     * @param code the code to be executed when {@code method} is called
-     */
-    void installMethod(RiMethod method, CiTargetMethod code);
-
-    /**
-     * Adds the given machine code as an implementation of the given method without making it the default implementation.
-     * @param method a method to which the executable code is begin added
-     * @param code the code to be added
-     * @return a reference to the compiled and ready-to-run code
-     */
-    RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiSignature.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +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.sun.cri.ri;
-
-import com.sun.cri.ci.*;
-
-/**
- * Represents a method signature provided by the runtime.
- *
- * @see <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#7035">Method Descriptors</a>
- */
-public interface RiSignature {
-    /**
-     * Gets the number of arguments in this signature, adding 1 for a receiver if requested.
-     *
-     * @param receiver true if 1 is to be added to the result for a receiver
-     * @return the number of arguments + 1 iff {@code receiver == true}
-     */
-    int argumentCount(boolean receiver);
-
-    /**
-     * Gets the argument type at the specified position. This method will return a
-     * {@linkplain RiType#isResolved() resolved} type if possible but without
-     * triggering any class loading or resolution.
-     *
-     * @param index the index into the parameters, with {@code 0} indicating the first parameter
-     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
-     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
-     *        not care for a resolved type.
-     * @return the {@code index}'th argument type
-     */
-    RiType argumentTypeAt(int index, RiType accessingClass);
-
-    /**
-     * Gets the argument kind at the specified position.
-     * @param index the index into the parameters, with {@code 0} indicating the first parameter
-     * @param architecture When true, the architecture-specific kind used for emitting machine code is returned.
-     *        When false, the kind according to the Java specification is returned.
-     * @return the kind of the argument at the specified position
-     */
-    CiKind argumentKindAt(int index, boolean architecture);
-
-    /**
-     * Gets the return type of this signature. This method will return a
-     * {@linkplain RiResolvedType resolved} type if possible but without
-     * triggering any class loading or resolution.
-     *
-     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
-     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
-     *        not care for a resolved type.
-     * @return the compiler interface type representing the return type
-     */
-    RiType returnType(RiType accessingClass);
-
-    /**
-     * Gets the return kind of this signature.
-     * @param architectureSpecific When true, the architecture-specific kind used for emitting machine code is returned.
-     *        When false, the kind according to the Java specification is returned.
-     * @return the return kind
-     */
-    CiKind returnKind(boolean architectureSpecific);
-
-    /**
-     * Converts this signature to a string.
-     * @return the signature as a string
-     */
-    String asString();
-
-    /**
-     * Gets the size, in Java slots, of the arguments to this signature.
-     * @param withReceiver {@code true} if to add a slot for a receiver object; {@code false} not to include the receiver
-     * @return the size of the arguments in slots
-     */
-    int argumentSlots(boolean withReceiver);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiType.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +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.sun.cri.ri;
-
-import com.sun.cri.ci.*;
-
-/**
- * Represents a resolved or unresolved type in the compiler-runtime interface. Types include primitives, objects, {@code void},
- * and arrays thereof.
- */
-public interface RiType {
-
-    /**
-     * Represents each of the several different parts of the runtime representation of
-     * a type which compiled code may need to reference individually. These may or may not be
-     * different objects or data structures, depending on the runtime system.
-     */
-    public enum Representation {
-        /**
-         * The runtime representation of the data structure containing the static fields of this type.
-         */
-        StaticFields,
-
-        /**
-         * The runtime representation of the Java class object of this type.
-         */
-        JavaClass,
-
-        /**
-         * The runtime representation of the "hub" of this type--that is, the closest part of the type
-         * representation which is typically stored in the object header.
-         */
-        ObjectHub,
-
-        /**
-         * The runtime representation of the type information for an object, which is typically used
-         * for subtype tests.
-         */
-        TypeInfo
-    }
-
-    /**
-     * Gets the name of this type in internal form. The following are examples of strings returned by this method:
-     * <pre>
-     *     "Ljava/lang/Object;"
-     *     "I"
-     *     "[[B"
-     * </pre>
-     *
-     * @return the name of this type in internal form
-     */
-    String name();
-
-    /**
-     * For array types, gets the type of the components.
-     * @return the component type of this array type
-     */
-    RiType componentType();
-
-    /**
-     * Gets the type representing an array with elements of this type.
-     * @return a new compiler interface type representing an array of this type
-     */
-    RiType arrayOf();
-
-    /**
-     * Gets the kind of this compiler interface type.
-     * @param architecture When true, the architecture-specific kind used for emitting machine code is returned.
-     *        When false, the kind according to the Java specification is returned.
-     * @return the kind
-     */
-    CiKind kind(boolean architecture);
-
-    /**
-     * Gets the kind used to represent the specified part of this type.
-     * @param r the part of the this type
-     * @return the kind of constants for the specified part of the type
-     */
-    CiKind getRepresentationKind(Representation r);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiTypeProfile.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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.sun.cri.ri;
-
-import java.io.*;
-
-/**
- * This profile object represents the type profile of one call site, cast or instanceof instruction. The precision of
- * the supplied values may vary, but a runtime that provides this information should be aware that it will be used to
- * guide performance-critical decisions like speculative inlining, etc.
- */
-public class RiTypeProfile implements Serializable {
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -6877016333706838441L;
-
-    /**
-     * How often the instruction was executed, which may be used to judge the maturity of this profile.
-     */
-    public int count;
-
-    /**
-     * An estimation of how many different receiver types were encountered. This may or may not be the same as
-     * probabilities.length/types.length, as the runtime may store probabilities for a limited number of receivers.
-     */
-    public int morphism;
-
-    /**
-     * A list of receivers for which the runtime has recorded probability information. This array needs to have the same
-     * length as {@link RiTypeProfile#probabilities}.
-     */
-    public RiResolvedType[] types;
-
-    /**
-     * The estimated probabilities of the different receivers. This array needs to have the same length as
-     * {@link RiTypeProfile#types}.
-     */
-    public float[] probabilities;
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/package-info.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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.
- */
-/**
- * The runtime-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.max.graal.compiler.graphbuilder.Bytecodes}.
- * <p>
- * Unlike the {@link com.sun.cri.ci compiler-provided interface}, the runtime-provided interface is specified largely
- * using interfaces, that must be implemented by classes provided by a specific runtime implementation.
- * <p>
- * {@link com.sun.cri.ri.RiRuntime} encapsulates the main functionality of the runtime for the compiler.
- * <p>
- * Types (i.e., primitives, classes and interfaces}, fields and methods are represented by {@link com.sun.cri.ri.RiType}, {@link com.sun.cri.ri.RiField} and {@link com.sun.cri.ri.RiMethod}, respectively, with additional support from
- * {@link com.sun.cri.ri.RiSignature} and {@link com.sun.cri.ri.RiExceptionHandler}. Access to the runtime constant pool
- * is through {@link com.sun.cri.ri.RiConstantPool}.
- */
-package com.sun.cri.ri;
--- a/graal/com.oracle.max.cri/src/com/sun/cri/xir/CiXirAssembler.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,989 +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.sun.cri.xir;
-
-import static com.sun.cri.xir.CiXirAssembler.XirOp.*;
-
-import java.util.*;
-
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiAddress.*;
-import com.sun.cri.ri.*;
-
-/**
- * Represents an assembler that allows a client such as the runtime system to
- * create {@link XirTemplate XIR templates}.
- */
-public abstract class CiXirAssembler {
-
-    protected XirOperand resultOperand;
-    protected boolean allocateResultOperand;
-
-    protected final List<XirInstruction> instructions = new ArrayList<>();
-    protected final List<XirLabel> labels = new ArrayList<>(5);
-    protected final List<XirParameter> parameters = new ArrayList<>(5);
-    protected final List<XirTemp> temps = new ArrayList<>(5);
-    protected final List<XirConstant> constants = new ArrayList<>(5);
-    protected final List<XirMark> marks = new ArrayList<>(5);
-
-    protected int outgoingStackSize = 0;
-
-    /**
-     * Increases by one for every {@link XirOperand operand} created.
-     */
-    protected int variableCount;
-
-    /**
-     * Marks the assembly complete.
-     */
-    protected boolean finished = true;
-
-    protected final CiTarget target;
-
-    public CiXirAssembler(CiTarget target) {
-        this.target = target;
-    }
-
-    public static class RuntimeCallInformation {
-        public final Object target;
-        public final boolean useInfoAfter;
-
-        public RuntimeCallInformation(Object target, boolean useInfoAfter) {
-            this.target = target;
-            this.useInfoAfter = useInfoAfter;
-        }
-    }
-
-    /**
-     * Represents additional address calculation information.
-     */
-    public static final class AddressAccessInformation {
-
-        /**
-         * The scaling factor for the scaled-index part of an address computation.
-         */
-        public final Scale scale;
-
-        /**
-         * The constant byte-sized displacement part of an address computation.
-         */
-        public final int disp;
-
-        /**
-         * Determines if the memory access through the address can trap.
-         */
-        public final boolean canTrap;
-
-        private AddressAccessInformation(boolean canTrap) {
-            this.canTrap = canTrap;
-            this.scale = Scale.Times1;
-            this.disp = 0;
-        }
-
-        private AddressAccessInformation(boolean canTrap, int disp) {
-            this.canTrap = canTrap;
-            this.scale = Scale.Times1;
-            this.disp = disp;
-        }
-
-        private AddressAccessInformation(boolean canTrap, int disp, Scale scale) {
-            this.canTrap = canTrap;
-            this.scale = scale;
-            this.disp = disp;
-        }
-    }
-
-    /**
-     * A label that is the target of a control flow instruction.
-     */
-    public static final class XirLabel {
-        public static final String TrueSuccessor = "TrueSuccessor";
-        public static final String FalseSuccessor = "FalseSuccessor";
-        public final String name;
-        public final int index;
-        /**
-         * If {@code true} the label is to an instruction in the fast path sequence, otherwise to the slow path.
-         */
-        public final boolean inline;
-
-        private XirLabel(String name, int index, boolean inline) {
-            this.name = name;
-            this.index = index;
-            this.inline = inline;
-        }
-
-        @Override
-        public String toString() {
-            return name;
-        }
-    }
-
-    /**
-     * Tagging interface that indicates that an {@link XirOperand} is a constant.
-     */
-    public interface XirConstantOperand {
-        int getIndex();
-    }
-
-    public static final XirOperand VOID = null;
-
-    /**
-     * Operands for {@link XirInstruction instructions}.
-     * There are three basic variants, {@link XirConstant constant}, {@link XirParameter parameter} and {@link XirTemp}.
-     */
-    public abstract static class XirOperand {
-
-        public final CiKind kind;
-
-        /**
-         * Unique id in range {@code 0} to {@link #variableCount variableCount - 1}.
-         */
-        public final int index;
-
-        /**
-         * Value whose {@link #toString()} method provides a name for this operand.
-         */
-        public final Object name;
-
-        public XirOperand(CiXirAssembler asm, Object name, CiKind kind) {
-            this.kind = kind;
-            this.name = name;
-            this.index = asm.variableCount++;
-        }
-
-        @Override
-        public String toString() {
-            return String.valueOf(name);
-        }
-
-        public String detailedToString() {
-
-            StringBuffer sb = new StringBuffer();
-
-            sb.append(name);
-            sb.append('$');
-            sb.append(kind.typeChar);
-            return sb.toString();
-        }
-    }
-
-    /**
-     * Parameters to {@link XirTemplate templates}.
-     */
-    public static class XirParameter extends XirOperand {
-        /**
-         * Unique id in range {@code 0} to {@code parameters.Size()  - 1}.
-         */
-        public final int parameterIndex;
-
-        public final boolean canBeConstant;
-
-        XirParameter(CiXirAssembler asm, String name, CiKind kind, boolean canBeConstant) {
-            super(asm, name, kind);
-            this.parameterIndex = asm.parameters.size();
-            this.canBeConstant = canBeConstant;
-            asm.parameters.add(this);
-        }
-
-    }
-
-    public static class XirConstantParameter extends XirParameter implements XirConstantOperand {
-        XirConstantParameter(CiXirAssembler asm, String name, CiKind kind) {
-            super(asm, name, kind, true);
-        }
-
-        public int getIndex() {
-            return index;
-        }
-    }
-
-    public static class XirVariableParameter extends XirParameter {
-        XirVariableParameter(CiXirAssembler asm, String name, CiKind kind, boolean canBeConstant) {
-            super(asm, name, kind, canBeConstant);
-        }
-    }
-
-    public static class XirConstant extends XirOperand implements XirConstantOperand {
-        public final CiConstant value;
-
-        XirConstant(CiXirAssembler asm, CiConstant value) {
-            super(asm, value, value.kind);
-            this.value = value;
-        }
-
-        public int getIndex() {
-            return index;
-        }
-    }
-
-    public static class XirTemp extends XirOperand {
-        public final boolean reserve;
-
-        XirTemp(CiXirAssembler asm, String name, CiKind kind, boolean reserve) {
-            super(asm, name, kind);
-            this.reserve = reserve;
-        }
-    }
-
-    public static class XirRegister extends XirTemp {
-        public final CiValue register;
-
-        XirRegister(CiXirAssembler asm, String name, CiRegisterValue register, boolean reserve) {
-            super(asm, name, register.kind, reserve);
-            this.register = register;
-        }
-    }
-
-    /**
-     * Start a new assembly with no initial {@link #resultOperand result operand}.
-     */
-    public void restart() {
-        reset();
-        resultOperand = null;
-    }
-
-    /**
-     * Start a new assembly with a {@link #resultOperand result operand} of type {@code kind}.
-     * @param kind the result kind
-     * @return an {@code XirOperand} for the result operand
-     */
-    public XirOperand restart(CiKind kind) {
-        reset();
-        resultOperand = new XirTemp(this, "result", kind, true);
-        allocateResultOperand = true;
-        return resultOperand;
-    }
-
-    /**
-     * Reset the state of the class to the initial conditions to facilitate a new assembly.
-     */
-    private void reset() {
-        assert finished : "must be finished before!";
-        variableCount = 0;
-        allocateResultOperand = false;
-        finished = false;
-        instructions.clear();
-        labels.clear();
-        parameters.clear();
-        temps.clear();
-        constants.clear();
-        marks.clear();
-        outgoingStackSize = 0;
-    }
-
-    /**
-     * Represents an XIR instruction, characterized by an {@link XirOp operation}, a {@link CiKind kind}, an optional {@link XirOperand result}, a variable number of {@link XirOperand arguments},
-     * and some optional instruction-specific state. The {@link #x}, {@link #y} and {@link #z} methods are convenient ways to access the first, second and third
-     * arguments, respectively. Only the {@link XirOp#CallStub} and {@link XirOp#CallRuntime} instructions can have more than three arguments.
-     *
-     */
-    public static final class XirInstruction {
-        /**
-         * The {@link CiKind kind} of values the instruction operates on.
-         */
-        public final CiKind kind;
-        /**
-         * The {@link XirOp operation}.
-         */
-        public final XirOp op;
-        /**
-         * The result, if any.
-         */
-        public final XirOperand result;
-        /**
-         * The arguments.
-         */
-        public final XirOperand[] arguments;
-        /**
-         * Arbitrary additional data associated with the instruction.
-         */
-        public final Object extra;
-
-        public XirInstruction(CiKind kind, XirOp op, XirOperand result, XirOperand... arguments) {
-            this(kind, null, op, result, arguments);
-        }
-
-        public XirInstruction(CiKind kind, Object extra, XirOp op, XirOperand result, XirOperand... arguments) {
-            this.extra = extra;
-            this.kind = kind;
-            this.op = op;
-            this.result = result;
-            this.arguments = arguments;
-        }
-
-        public XirOperand x() {
-            assert arguments.length > 0 : "no x operand for this instruction";
-            return arguments[0];
-        }
-
-        public XirOperand y() {
-            assert arguments.length > 1 : "no y operand for this instruction";
-            return arguments[1];
-        }
-
-        public XirOperand z() {
-            assert arguments.length > 2 : "no z operand for this instruction";
-            return arguments[2];
-        }
-
-        @Override
-        public String toString() {
-            StringBuffer sb = new StringBuffer();
-
-            if (result != null) {
-                sb.append(result.toString());
-                sb.append(" = ");
-            }
-
-            sb.append(op.name());
-
-            if (kind != CiKind.Void) {
-                sb.append('$');
-                sb.append(kind.typeChar);
-            }
-
-            if (arguments != null && arguments.length > 0) {
-                sb.append("(");
-
-                for (int i = 0; i < arguments.length; i++) {
-                    if (i != 0) {
-                        sb.append(", ");
-                    }
-                    sb.append(arguments[i]);
-                }
-
-                sb.append(")");
-            }
-
-            if (extra != null) {
-                sb.append(" ");
-                sb.append(extra);
-            }
-
-            return sb.toString();
-        }
-    }
-
-    /**
-     * These marks let the RiXirGenerator mark positions in the generated native code and bring them in relationship with on another.
-     * This is necessary for code patching, etc.
-     */
-    public static class XirMark {
-        public final XirMark[] references;
-        public final Object id;
-
-        // special mark used to refer to the actual call site of an invoke
-        public static final XirMark CALLSITE = new XirMark(null);
-
-        public XirMark(Object id, XirMark... references) {
-            this.id = id;
-            this.references = references;
-        }
-    }
-
-    /**
-     * The set of opcodes for XIR instructions.
-     * {@link XirInstruction} defines {@code x}, {@code y} and {@code z} as the first, second and third arguments, respectively.
-     * We use these mnemonics, plus {@code args} for the complete set of arguments, {@code r} for the result, and {@code extra}
-     * for the instruction-specific extra data, in the opcode specifications. Note that the opcodes that operate on values do not directly
-     * specify the size (kind) of the data operated on;  this is is encoded in {@link XirInstruction#kind}.
-     * Note: If the instruction kind differs from the argument/result kinds, the behavior is undefined.
-     *
-     */
-    public enum XirOp {
-        /**
-         * Move {@code x} to {@code r}.
-         */
-        Mov,
-        /**
-         * Add {@code y} to {@code x} and put the result in {@code r}.
-         */
-        Add,
-        /**
-         * Subtract {@code y} from {@code x} and put the result in {@code r}.
-         */
-        Sub,
-        /**
-         * Divide {@code y} by {@code x} and put the result in {@code r}.
-         */
-        Div,
-        /**
-         * Multiply {@code y} by {@code x} and put the result in {@code r}.
-         */
-        Mul,
-        /**
-         * {@code y} modulus {@code x} and put the result in {@code r}.
-         */
-        Mod,
-        /**
-         * Shift  {@code y} left by {@code x} and put the result in {@code r}.
-         */
-        Shl,
-        /**
-         * Arithmetic shift  {@code y} right by {@code x} and put the result in {@code r}.
-         */
-        Sar,
-        /**
-         * Shift  {@code y} right by {@code x} and put the result in {@code r}.
-         */
-        Shr,
-        /**
-         * And {@code y} by {@code x} and put the result in {@code r}.
-         */
-        And,
-        /**
-         * Or {@code y} by {@code x} and put the result in {@code r}.
-         */
-        Or,
-        /**
-         * Exclusive Or {@code y} by {@code x} and put the result in {@code r}.
-         */
-        Xor,
-        /**
-         * Null check on {@code x}.
-         */
-        NullCheck,
-        /**
-         * Load value at address {@code x} and put the result in {@code r}.
-         */
-        PointerLoad,
-        /**
-         * Store {@code y} at address {@code x}.
-         */
-        PointerStore,
-        /**
-         * Load value at an effective address defined by base {@code x} and either a scaled index {@code y} plus displacement
-         * or an offset {@code y} and put the result in {@code r}.
-         */
-        PointerLoadDisp,
-        /**
-         * Load an effective address defined by base {@code x} and either a scaled index {@code y} plus displacement
-         * or an offset {@code y} and put the result in {@code r}.
-         */
-        LoadEffectiveAddress,
-        /**
-         * Store {@code z} at address defined by base {@code x} and index {@code y}.
-         */
-        PointerStoreDisp,
-        /**
-         * Repeat move from {@code x} to {@code y} using {@code z} words.
-         */
-        RepeatMoveWords,
-        /**
-         * Repeat move from {@code x} to {@code y} using {@code z} words.
-         */
-        RepeatMoveBytes,
-        /**
-         * Compare value at at address {@code x} with value in {@code y} and store value {@code z} at address {@code x}
-         * if it was equal to {@code y}.
-         */
-        PointerCAS,
-        /**
-         * Call the {@link XirTemplate.GlobalFlags#GLOBAL_STUB shared stub} defined by {@code extra} with {@code args} and put the result in {@code r}.
-         */
-        CallStub,
-        /**
-         * Call the {@link RiMethod} defined by {@code extra}  with {@code args} and put the result in {@code r}.
-         */
-        CallRuntime,
-        /**
-         * Transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jmp,
-       /**
-         * If {@code x == y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jeq,
-        /**
-         * If {@code x != y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jneq,
-        /**
-         * If {@code x > y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jgt,
-        /**
-         * If {@code x >= y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jgteq,
-        /**
-         * If {@code x unsigned >= y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jugteq,
-        /**
-         * If {@code x < y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jlt,
-        /**
-         * If {@code x <= y}, transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jlteq,
-        /**
-         * Decreases the input by one and jumps to the target if the input is not 0.
-         */
-        DecAndJumpNotZero,
-        /**
-         * If bit designated by {@code z} at effective address defined by base {@code x} and offset {@code y}
-         * is set transfer control to the instruction at the {@link XirLabel label} identified by {@code extra}.
-         */
-        Jbset,
-        /**
-         * Bind the {@link XirLabel label} identified by {@code extra} to the current instruction and update any references to it.
-         * A label may be bound more than once to the same location.
-         */
-        Bind,
-        /**
-         * Record a safepoint.
-         */
-        Safepoint,
-        /**
-         * Align the code following this instruction to a multiple of (int)extra.
-         */
-        Align,
-        /**
-         * Creates the stack banging overflow check.
-         */
-        StackOverflowCheck,
-        /**
-         * Creates the stack frame for the method and spills callee-save registers (if any) to the {@linkplain CiRegisterSaveArea register save area}.
-         */
-        PushFrame,
-        /**
-         * Restores all callee-save registers (if any) and removes the stack frame of the method.
-         */
-        PopFrame,
-        /**
-         * Inserts an array of bytes directly into the code output.
-         */
-        RawBytes,
-        /**
-         * Pushes a value onto the stack.
-         */
-        Push,
-        /**
-         * Pops a value from the stack.
-         */
-        Pop,
-        /**
-         * Marks a position in the generated native code.
-         */
-        Mark,
-        /**
-         * Load instruction pointer of the next instruction in a destination register.
-         */
-        Here,
-        /**
-         * Inserts nop instructions, with the given size in bytes.
-         */
-        Nop,
-        /**
-         * This instruction should never be reached, this is useful for debugging purposes.
-         */
-         ShouldNotReachHere
-    }
-
-    public/*private*/ void append(XirInstruction xirInstruction) {
-        assert !finished : "no instructions can be added to finished template";
-        instructions.add(xirInstruction);
-    }
-
-    public XirLabel createInlineLabel(String name) {
-        final XirLabel result = new XirLabel(name, this.labels.size(), true);
-        labels.add(result);
-        return result;
-    }
-
-    public XirLabel createOutOfLineLabel(String name) {
-        final XirLabel result = new XirLabel(name, this.labels.size(), false);
-        labels.add(result);
-        return result;
-    }
-
-    public void mov(XirOperand result, XirOperand a) {
-        append(new XirInstruction(result.kind, Mov, result, a));
-    }
-
-    public void add(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Add, result, a, b));
-    }
-
-    public void sub(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Sub, result, a, b));
-    }
-
-    public void div(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Div, result, a, b));
-    }
-
-    public void mul(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Mul, result, a, b));
-    }
-
-    public void mod(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Mod, result, a, b));
-    }
-
-    public void shl(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Shl, result, a, b));
-    }
-
-    public void shr(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Shr, result, a, b));
-    }
-
-    public void and(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, And, result, a, b));
-    }
-
-    public void or(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Or, result, a, b));
-    }
-
-    public void xor(XirOperand result, XirOperand a, XirOperand b) {
-        append(new XirInstruction(result.kind, Xor, result, a, b));
-    }
-
-    public void nullCheck(XirOperand pointer) {
-        append(new XirInstruction(CiKind.Object, NullCheck, VOID, pointer));
-    }
-
-    public void pload(CiKind kind, XirOperand result, XirOperand pointer, boolean canTrap) {
-        append(new XirInstruction(kind, canTrap, PointerLoad, result, pointer));
-    }
-
-    public void pstore(CiKind kind, XirOperand pointer, XirOperand value, boolean canTrap) {
-        append(new XirInstruction(kind, canTrap, PointerStore, null, pointer, value));
-    }
-
-    public void pload(CiKind kind, XirOperand result, XirOperand pointer, XirOperand offset, boolean canTrap) {
-        append(new XirInstruction(kind, new AddressAccessInformation(canTrap), PointerLoadDisp, result, pointer, offset));
-    }
-
-    public void pstore(CiKind kind, XirOperand pointer, XirOperand offset, XirOperand value, boolean canTrap) {
-        append(new XirInstruction(kind, new AddressAccessInformation(canTrap), PointerStoreDisp, VOID, pointer, offset, value));
-    }
-
-    public void pload(CiKind kind, XirOperand result, XirOperand pointer, XirOperand index, int disp, Scale scale,  boolean canTrap) {
-        append(new XirInstruction(kind, new AddressAccessInformation(canTrap, disp, scale), PointerLoadDisp, result, pointer, index));
-    }
-
-    public void lea(XirOperand result, XirOperand pointer, XirOperand index, int disp, Scale scale) {
-        append(new XirInstruction(target.wordKind, new AddressAccessInformation(false, disp, scale), LoadEffectiveAddress, result, pointer, index));
-    }
-
-    public void repmov(XirOperand src, XirOperand dest, XirOperand length) {
-        append(new XirInstruction(target.wordKind, null, RepeatMoveWords, null, src, dest, length));
-    }
-
-    public void here(XirOperand dst) {
-        append(new XirInstruction(target.wordKind, null, Here, dst));
-    }
-
-    public void repmovb(XirOperand src, XirOperand dest, XirOperand length) {
-        append(new XirInstruction(target.wordKind, null, RepeatMoveBytes, null, src, dest, length));
-    }
-
-    public void pstore(CiKind kind, XirOperand pointer, XirOperand index, XirOperand value, int disp, Scale scale, boolean canTrap) {
-        append(new XirInstruction(kind, new AddressAccessInformation(canTrap, disp, scale), PointerStoreDisp, VOID, pointer, index, value));
-    }
-
-    public void pcas(CiKind kind, XirOperand result, XirOperand pointer, XirOperand newValue, XirOperand oldValue) {
-        append(new XirInstruction(kind, null, PointerCAS, result, pointer, newValue, oldValue));
-    }
-
-    public void jmp(XirLabel l) {
-        append(new XirInstruction(CiKind.Void, l, Jmp, null));
-    }
-
-    public void decAndJumpNotZero(XirLabel l, XirOperand val) {
-        append(new XirInstruction(CiKind.Void, l, DecAndJumpNotZero, null, val));
-    }
-
-    public void jmpRuntime(Object rt) {
-        append(new XirInstruction(CiKind.Void, rt, Jmp, null));
-    }
-
-    public void jeq(XirLabel l, XirOperand a, XirOperand b) {
-        jcc(Jeq, l, a, b);
-    }
-
-    private void jcc(XirOp op, XirLabel l, XirOperand a, XirOperand b) {
-        append(new XirInstruction(CiKind.Void, l, op, null, a, b));
-    }
-
-    public void jneq(XirLabel l, XirOperand a, XirOperand b) {
-        jcc(Jneq, l, a, b);
-    }
-
-    public void jgt(XirLabel l, XirOperand a, XirOperand b) {
-        jcc(Jgt, l, a, b);
-    }
-
-    public void jgteq(XirLabel l, XirOperand a, XirOperand b) {
-        jcc(Jgteq, l, a, b);
-    }
-
-    public void jugteq(XirLabel l, XirOperand a, XirOperand b) {
-        jcc(Jugteq, l, a, b);
-    }
-
-    public void jlt(XirLabel l, XirOperand a, XirOperand b) {
-        jcc(Jlt, l, a, b);
-    }
-
-    public void jlteq(XirLabel l, XirOperand a, XirOperand b) {
-        jcc(Jlteq, l, a, b);
-    }
-
-    public void jbset(XirLabel l, XirOperand a, XirOperand b, XirOperand c) {
-        append(new XirInstruction(CiKind.Void, l, Jbset, null, a, b, c));
-    }
-
-    public void bindInline(XirLabel l) {
-        assert l.inline;
-        append(new XirInstruction(CiKind.Void, l, Bind, null));
-    }
-
-    public void bindOutOfLine(XirLabel l) {
-        assert !l.inline;
-        append(new XirInstruction(CiKind.Void, l, Bind, null));
-    }
-
-    public void safepoint() {
-        append(new XirInstruction(CiKind.Void, null, Safepoint, null));
-    }
-
-    public void align(int multiple) {
-        assert multiple > 0;
-        append(new XirInstruction(CiKind.Void, multiple, Align, null));
-    }
-
-    public void stackOverflowCheck() {
-        append(new XirInstruction(CiKind.Void, null, StackOverflowCheck, null));
-    }
-
-    public void pushFrame() {
-        append(new XirInstruction(CiKind.Void, null, PushFrame, null));
-    }
-
-    public void popFrame() {
-        append(new XirInstruction(CiKind.Void, null, PopFrame, null));
-    }
-
-    public void rawBytes(byte[] bytes) {
-        append(new XirInstruction(CiKind.Void, bytes, RawBytes, null));
-    }
-
-    public void push(XirOperand value) {
-        append(new XirInstruction(CiKind.Void, Push, VOID, value));
-    }
-
-    public void pop(XirOperand result) {
-        append(new XirInstruction(result.kind, Pop, result));
-    }
-
-    public XirMark mark(Object id, XirMark... references) {
-        XirMark mark = new XirMark(id, references);
-        marks.add(mark);
-        append(new XirInstruction(CiKind.Void, mark, Mark, null));
-        return mark;
-    }
-
-    public void nop(int size) {
-        append(new XirInstruction(CiKind.Void, size, Nop, null));
-    }
-
-    public void shouldNotReachHere() {
-        append(new XirInstruction(CiKind.Void, null, ShouldNotReachHere, null));
-    }
-
-    public void shouldNotReachHere(String message) {
-        append(new XirInstruction(CiKind.Void, message, ShouldNotReachHere, null));
-    }
-
-    public void callStub(XirTemplate stub, XirOperand result, XirOperand... args) {
-        CiKind resultKind = result == null ? CiKind.Void : result.kind;
-        append(new XirInstruction(resultKind, stub, CallStub, result, args));
-    }
-
-    public void callRuntime(Object rt, XirOperand result, XirOperand... args) {
-        callRuntime(rt, result, false, args);
-    }
-
-    public void callRuntime(Object rt, XirOperand result, boolean useInfoAfter, XirOperand... args) {
-        CiKind resultKind = result == null ? CiKind.Void : result.kind;
-        append(new XirInstruction(resultKind, new RuntimeCallInformation(rt, useInfoAfter), CallRuntime, result, args));
-    }
-
-    /**
-     * Terminates the assembly, checking invariants, in particular that {@link resultOperand} is set, and setting {@link #finished} to {@code true}.
-     */
-    private void end() {
-        assert !finished : "template may only be finished once!";
-        assert resultOperand != null : "result operand should be set";
-        finished = true;
-    }
-
-    /**
-     * Creates an {@link XirVariableParameter variable input parameter}  of given name and {@link CiKind kind}.
-     * @param name a name for the parameter
-     * @param kind the parameter kind
-     * @return the  {@link XirVariableParameter}
-     */
-    public XirVariableParameter createInputParameter(String name, CiKind kind, boolean canBeConstant) {
-        assert !finished;
-        return new XirVariableParameter(this, name, kind, canBeConstant);
-    }
-
-    public XirVariableParameter createInputParameter(String name, CiKind kind) {
-        return createInputParameter(name, kind, false);
-    }
-
-    /**
-     * Creates an {@link XirConstantParameter constant input parameter}  of given name and {@link CiKind kind}.
-     * @param name a name for the parameter
-     * @param kind the parameter kind
-     * @return the  {@link XirConstantParameter}
-     */
-    public XirConstantParameter createConstantInputParameter(String name, CiKind kind) {
-        assert !finished;
-        return new XirConstantParameter(this, name, kind);
-    }
-
-    public XirConstant createConstant(CiConstant constant) {
-        assert !finished;
-        XirConstant temp = new XirConstant(this, constant);
-        constants.add(temp);
-        return temp;
-    }
-
-    public XirOperand createTemp(String name, CiKind kind) {
-        assert !finished;
-        XirTemp temp = new XirTemp(this, name, kind, true);
-        temps.add(temp);
-        return temp;
-    }
-
-    public XirOperand createRegister(String name, CiKind kind, CiRegister register) {
-        return createRegister(name, kind, register, false);
-    }
-
-    public XirOperand createRegisterTemp(String name, CiKind kind, CiRegister register) {
-        return createRegister(name, kind, register, true);
-    }
-
-    private XirOperand createRegister(String name, CiKind kind, CiRegister register, boolean reserve) {
-        assert !finished;
-        XirRegister fixed = new XirRegister(this, name, register.asValue(kind), reserve);
-        temps.add(fixed);
-        return fixed;
-    }
-
-    public XirParameter getParameter(String name) {
-        for (XirParameter param : parameters) {
-            if (param.name.toString().equals(name)) {
-                return param;
-            }
-        }
-        throw new IllegalArgumentException("no parameter: " + name);
-    }
-
-    public XirTemp getTemp(String name) {
-        for (XirTemp temp : temps) {
-            if (temp.name.toString().equals(name)) {
-                return temp;
-            }
-        }
-        throw new IllegalArgumentException("no temp: " + name);
-    }
-
-    public XirConstant i(int v) {
-        return createConstant(CiConstant.forInt(v));
-    }
-
-    public XirConstant l(int v) {
-        return createConstant(CiConstant.forLong(v));
-    }
-
-    public XirConstant b(boolean v) {
-        return createConstant(CiConstant.forBoolean(v));
-    }
-
-    public XirConstant o(Object obj) {
-        return createConstant(CiConstant.forObject(obj));
-    }
-
-    public void reserveOutgoingStack(int size) {
-        outgoingStackSize = Math.max(outgoingStackSize, size);
-    }
-
-    /**
-     * Finishes the assembly of a non-stub template, providing the {@link #resultOperand} and constructs the {@link XirTemplate}.
-     * @param result the {@link XirOperand} to be set as the {@link #resultOperand}
-     * @param name the name of the template
-     * @return the generated template
-     */
-    public XirTemplate finishTemplate(XirOperand result, String name) {
-        assert this.resultOperand == null;
-        assert result != null;
-        this.resultOperand = result;
-        final XirTemplate template = buildTemplate(name, false);
-        end();
-        return template;
-    }
-
-    /**
-     * Finishes the assembly of a non-stub template and constructs the {@link XirTemplate}.
-     * @param name the name of the template
-     * @return the generated template
-     */
-    public XirTemplate finishTemplate(String name) {
-        final XirTemplate template = buildTemplate(name, false);
-        end();
-        return template;
-    }
-
-    /**
-     * Finishes the assembly of a {@link XirTemplate.GlobalFlags#GLOBAL_STUB stub} and constructs the {@link XirTemplate}.
-     * @param name the name of the template
-     * @return the generated template
-     */
-    public XirTemplate finishStub(String name) {
-        final XirTemplate template = buildTemplate(name, true);
-        end();
-        return template;
-    }
-
-    /**
-     * Builds the {@link XirTemplate} from the assembly state in this object.
-     * The actual assembly is dependent on the target architecture and implemented
-     * in a concrete subclass.
-     * @param name the name of the template
-     * @param isStub {@code true} if the template represents a {@link XirTemplate.GlobalFlags#GLOBAL_STUB stub}
-     * @return the generated template
-     */
-    protected abstract XirTemplate buildTemplate(String name, boolean isStub);
-
-    public abstract CiXirAssembler copy();
-
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/xir/RiXirGenerator.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +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.sun.cri.xir;
-
-import java.util.*;
-
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.ri.RiType.*;
-
-/**
- * Represents the interface through which the compiler requests the XIR for a given bytecode from the runtime system.
- */
-public interface RiXirGenerator {
-
-    /**
-     * Note: may return {@code null}.
-     */
-    XirSnippet genPrologue(XirSite site, RiResolvedMethod method);
-
-    /**
-     * Note: may return {@code null} in which case the compiler will not emit a return instruction.
-     */
-    XirSnippet genEpilogue(XirSite site, RiResolvedMethod method);
-
-    XirSnippet genSafepointPoll(XirSite site);
-
-    XirSnippet genExceptionObject(XirSite site);
-
-    XirSnippet genResolveClass(XirSite site, RiType type, Representation representation);
-
-    XirSnippet genIntrinsic(XirSite site, XirArgument[] arguments, RiMethod method);
-
-    XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, RiMethod method);
-
-    XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, RiMethod method);
-
-    XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, RiMethod method);
-
-    XirSnippet genInvokeStatic(XirSite site, RiMethod method);
-
-    XirSnippet genMonitorEnter(XirSite site, XirArgument receiver, XirArgument lockAddress);
-
-    XirSnippet genMonitorExit(XirSite site, XirArgument receiver, XirArgument lockAddress);
-
-    XirSnippet genGetField(XirSite site, XirArgument receiver, RiField field);
-
-    XirSnippet genPutField(XirSite site, XirArgument receiver, RiField field, XirArgument value);
-
-    XirSnippet genGetStatic(XirSite site, XirArgument staticTuple, RiField field);
-
-    XirSnippet genPutStatic(XirSite site, XirArgument staticTuple, RiField field, XirArgument value);
-
-    XirSnippet genNewInstance(XirSite site, RiType type);
-
-    XirSnippet genNewArray(XirSite site, XirArgument length, CiKind elementKind, RiType componentType, RiType arrayType);
-
-    XirSnippet genNewObjectArrayClone(XirSite site, XirArgument newLength, XirArgument referenceArray);
-
-    XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType type);
-
-    XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, RiType type);
-
-    XirSnippet genInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, RiType type);
-
-    XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, XirArgument trueValue, XirArgument falseValue, RiType type);
-
-    XirSnippet genArrayLoad(XirSite site, XirArgument array, XirArgument index, CiKind elementKind, RiType elementType);
-
-    XirSnippet genArrayStore(XirSite site, XirArgument array, XirArgument index, XirArgument value, CiKind elementKind, RiType elementType);
-
-    XirSnippet genArrayLength(XirSite site, XirArgument array);
-
-    XirSnippet genWriteBarrier(XirArgument object);
-
-    XirSnippet genArrayCopy(XirSite site, XirArgument src, XirArgument srcPos, XirArgument dest, XirArgument destPos, XirArgument length, RiType elementType, boolean inputsSame, boolean inputsDifferent);
-
-    XirSnippet genCurrentThread(XirSite site);
-
-    XirSnippet genGetClass(XirSite site, XirArgument xirArgument);
-
-    /**
-     * Generates code that checks that the {@linkplain Representation#ObjectHub hub} of
-     * an object is identical to a given hub constant. In pseudo code:
-     * <pre>
-     *     if (object.getHub() != hub) {
-     *         uncommonTrap();
-     *     }
-     * </pre>
-     * This snippet should only be used when the object is guaranteed not to be null.
-     */
-    XirSnippet genTypeCheck(XirSite site, XirArgument object, XirArgument hub, RiType type);
-
-    /**
-     * Gets the list of XIR templates, using the given XIR assembler to create them if
-     * they haven't yet been created.
-     *
-     * @param asm the XIR assembler
-     * @return the list of templates
-     */
-    List<XirTemplate> makeTemplates(CiXirAssembler asm);
-
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/xir/XirArgument.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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.sun.cri.xir;
-
-import com.sun.cri.ci.*;
-
-/**
- * Represents an argument to an {@link XirSnippet}.
- * Currently, this is a <i>union </i> type; it is either a {@link CiConstant} or an {@code Object}.
- */
-public final class XirArgument {
-
-    public final CiConstant constant;
-    public final Object object;
-
-    private XirArgument(CiConstant value) {
-        this.constant = value;
-        this.object = null;
-    }
-
-    private XirArgument(Object o) {
-        this.constant = null;
-        this.object = o;
-    }
-
-    public static XirArgument forInternalObject(Object o) {
-        return new XirArgument(o);
-    }
-
-    public static XirArgument forInt(int x) {
-        return new XirArgument(CiConstant.forInt(x));
-    }
-
-    public static XirArgument forLong(long x) {
-        return new XirArgument(CiConstant.forLong(x));
-    }
-
-    public static XirArgument forObject(Object o) {
-        return new XirArgument(CiConstant.forObject(o));
-    }
-
-    @Override
-    public String toString() {
-        if (constant != null) {
-            return constant.toString();
-        } else {
-            return "" + object;
-        }
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/xir/XirSite.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +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.sun.cri.xir;
-
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-
-/**
- * Encapsulates the notion of a site where XIR can be supplied. It is supplied to the {@link RiXirGenerator} by the
- * compiler for each place where XIR can be generated. This interface allows a number of queries, including the
- * bytecode-level location and optimization hints computed by the compiler.
- */
-public interface XirSite {
-
-    /**
-     * Gets the {@link CiCodePos code position} associated with this site. This is useful for inserting
-     * instrumentation at the XIR level.
-     * @return the code position if it is available; {@code null} otherwise
-     */
-    CiCodePos getCodePos();
-
-    /**
-     * Checks whether the specified argument is guaranteed to be non-null at this site.
-     * @param argument the argument
-     * @return {@code true} if the argument is non null at this site
-     */
-    boolean isNonNull(XirArgument argument);
-
-    /**
-     * Checks whether this site requires a null check.
-     * @return {@code true} if a null check is required
-     */
-    boolean requiresNullCheck();
-
-    /**
-     * Checks whether this site requires a range check.
-     * @return {@code true} if a range check is required
-     */
-    boolean requiresBoundsCheck();
-
-    /**
-     * Checks whether this site requires a read barrier.
-     * @return {@code true} if a read barrier is required
-     */
-    boolean requiresReadBarrier();
-
-    /**
-     * Checks whether this site requires a write barrier.
-     * @return {@code true} if a write barrier is required
-     */
-    boolean requiresWriteBarrier();
-
-    /**
-     * Checks whether this site requires an array store check.
-     * @return {@code true} if an array store check is required
-     */
-    boolean requiresArrayStoreCheck();
-
-    /**
-     * Checks whether an approximation of the type for the specified argument is available.
-     * @param argument the argument
-     * @return an {@link RiType} indicating the most specific type known for the argument, if any;
-     * {@code null} if no particular type is known
-     */
-    RiType getApproximateType(XirArgument argument);
-
-    /**
-     * Checks whether an exact type is known for the specified argument.
-     * @param argument the argument
-     * @return an {@link RiType} indicating the exact type known for the argument, if any;
-     * {@code null} if no particular type is known
-     */
-    RiType getExactType(XirArgument argument);
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/xir/XirSnippet.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +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.sun.cri.xir;
-
-import java.util.*;
-
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiTargetMethod.Mark;
-import com.sun.cri.xir.CiXirAssembler.*;
-
-/**
- * Represents a {@link XirTemplate template of XIR} along with the {@link XirArgument arguments} to be passed to the
- * template. The runtime generates such snippets for each bytecode being compiled at the request of the compiler, and
- * the compiler can generate machine code for the XIR snippet.
- */
-public class XirSnippet {
-
-    public final XirArgument[] arguments;
-    public final XirTemplate template;
-    public final Map<XirMark, Mark> marks;
-
-    public XirSnippet(XirTemplate template, XirArgument... inputs) {
-        assert template != null;
-        this.template = template;
-        this.arguments = inputs;
-        this.marks = (template.marks != null && template.marks.length > 0) ? new HashMap<XirMark, Mark>() : null;
-        assert assertArgumentsCorrect();
-    }
-
-    private boolean assertArgumentsCorrect() {
-        int argLength = arguments == null ? 0 : arguments.length;
-        int paramLength = template.parameters == null ? 0 : template.parameters.length;
-        assert argLength == paramLength : "expected param count: " + paramLength + ", actual: " + argLength;
-        for (int i = 0; i < arguments.length; i++) {
-            assert assertArgumentCorrect(template.parameters[i], arguments[i]) : "mismatch in parameter " + i + ": " + arguments[i] + " instead of " + template.parameters[i];
-        }
-        return true;
-    }
-
-    private static boolean assertArgumentCorrect(XirParameter param, XirArgument arg) {
-        if (param.kind == CiKind.Illegal || param.kind == CiKind.Void) {
-            if (arg != null) {
-                return false;
-            }
-        } else {
-            if (arg == null) {
-                return false;
-            }
-            if (arg.constant != null) {
-                if (arg.constant != null && arg.constant.kind != param.kind) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public String toString() {
-
-        StringBuffer sb = new StringBuffer();
-
-        sb.append(template.toString());
-        sb.append("(");
-        for (XirArgument a : arguments) {
-            sb.append(" ");
-            sb.append(a);
-        }
-
-        sb.append(" )");
-
-        return sb.toString();
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/xir/XirTemplate.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +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.sun.cri.xir;
-
-import java.io.*;
-import java.util.*;
-
-import com.sun.cri.xir.CiXirAssembler.*;
-
-/**
- * Represents a completed template of XIR code that has been first assembled by
- * the runtime, and then verified and preprocessed by the compiler. An {@code XirTemplate}
- * instance is immutable.
- */
-public class XirTemplate {
-
-    /**
-     * Flags that indicate key features of the template for quick checking.
-     */
-    public enum GlobalFlags {
-        /**
-         * Contains a call to a {@link GlobalFlags#GLOBAL_STUB} template.
-         */
-        HAS_STUB_CALL,
-
-        /**
-         * Contains a call to the runtime.
-         */
-        HAS_RUNTIME_CALL,
-
-        /**
-         * Not simply a linear sequence of instructions, contains control transfers.
-         */
-        HAS_CONTROL_FLOW,
-
-        /**
-         * Is a shared instruction sequence for use by other templates.
-         */
-        GLOBAL_STUB;
-
-        public final int mask = 1 << ordinal();
-    }
-
-    /**
-     * Name of the template.
-     */
-    public final String name;
-
-    public final XirOperand resultOperand;
-
-    /**
-     * The sequence of instructions for the fast (inline) path.
-     */
-    public final CiXirAssembler.XirInstruction[] fastPath;
-
-    /**
-     * The sequence of instructions for the slow (out of line) path.
-     */
-    public final CiXirAssembler.XirInstruction[] slowPath;
-
-    /**
-     * Labels used in control transfers.
-     */
-    public final XirLabel[] labels;
-
-    /**
-     * Parameters to the template.
-     */
-    public final XirParameter[] parameters;
-
-    /**
-     * An array of same length as {@link #parameters} where {@code parameterDestroyed[i]} is {@code true}
-     * iff {@code parameters[i]} is the {@link XirInstruction#result result} of any {@link XirInstruction} in either
-     * {@link #fastPath} or {@link #slowPath}.
-     */
-    public final boolean[] parameterDestroyed;
-
-    /**
-     * Temporary variables used by the template.
-     */
-    public final XirTemp[] temps;
-
-    /**
-     * Constants used in the template.
-     */
-    public final XirConstant[] constants;
-
-    /**
-     * The total number of variables. (relation to temps/parameters???)
-     */
-    public final int variableCount;
-
-    public final boolean allocateResultOperand;
-
-    public final XirTemplate[] calleeTemplates;
-
-    public final XirMark[] marks;
-
-    public final int outgoingStackSize;
-
-    public final XirOperand[] inputOperands;
-    public final XirOperand[] inputTempOperands;
-    public final XirOperand[] tempOperands;
-
-
-    /**
-     * The {@link GlobalFlags} associated with the template.
-     */
-    public final int flags;
-
-    public XirTemplate(String name,
-                       int variableCount,
-                       boolean allocateResultOperand,
-                       XirOperand resultOperand,
-                       CiXirAssembler.XirInstruction[] fastPath,
-                       CiXirAssembler.XirInstruction[] slowPath,
-                       XirLabel[] labels,
-                       XirParameter[] parameters,
-                       XirTemp[] temps,
-                       XirConstant[] constantValues,
-                       int flags,
-                       XirTemplate[] calleeTemplates,
-                       XirMark[] marks,
-                       int outgoingStackSize) {
-        this.name = name;
-        this.variableCount = variableCount;
-        this.resultOperand = resultOperand;
-        this.fastPath = fastPath;
-        this.slowPath = slowPath;
-        this.labels = labels;
-        this.parameters = parameters;
-        this.flags = flags;
-        this.temps = temps;
-        this.allocateResultOperand = allocateResultOperand;
-        this.constants = constantValues;
-        this.calleeTemplates = calleeTemplates;
-        this.marks = marks;
-        this.outgoingStackSize = outgoingStackSize;
-
-        assert fastPath != null;
-        assert labels != null;
-        assert parameters != null;
-
-        List<XirOperand> inputOperandList = new ArrayList<>(4);
-        List<XirOperand> inputTempOperandList = new ArrayList<>(4);
-        List<XirOperand> tempOperandList = new ArrayList<>(4);
-
-        parameterDestroyed = new boolean[parameters.length];
-        for (int i = 0; i < parameters.length; i++) {
-            for (XirInstruction ins : fastPath) {
-                if (ins.result == parameters[i]) {
-                    parameterDestroyed[i] = true;
-                    break;
-                }
-            }
-
-            if (slowPath != null && !parameterDestroyed[i]) {
-                for (XirInstruction ins : slowPath) {
-                    if (ins.result == parameters[i]) {
-                        parameterDestroyed[i] = true;
-                    }
-                }
-            }
-
-            if (parameterDestroyed[i]) {
-                inputTempOperandList.add(parameters[i]);
-            } else {
-                inputOperandList.add(parameters[i]);
-            }
-        }
-
-        for (XirTemp temp : temps) {
-            if (temp.reserve) {
-                tempOperandList.add(temp);
-            }
-        }
-
-        this.inputOperands = inputOperandList.toArray(new XirOperand[inputOperandList.size()]);
-        this.inputTempOperands = inputTempOperandList.toArray(new XirOperand[inputTempOperandList.size()]);
-        this.tempOperands = tempOperandList.toArray(new XirOperand[tempOperandList.size()]);
-    }
-
-    /**
-     * Convenience getter that returns the value at a given index in the {@link #parameterDestroyed} array.
-     * @param index
-     * @return the value at {@code parameterDestroyed[index]}
-     */
-    public boolean isParameterDestroyed(int index) {
-        return parameterDestroyed[index];
-    }
-
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    public void print(PrintStream p) {
-        final String indent = "   ";
-
-        p.println();
-        p.println("Template " + name);
-
-        p.print("Param:");
-        for (XirParameter param : parameters) {
-            p.print(" " + param.detailedToString());
-        }
-        p.println();
-
-        if (temps.length > 0) {
-            p.print("Temps:");
-            for (XirTemp temp : temps) {
-                p.print(" " + temp.detailedToString());
-            }
-            p.println();
-        }
-
-        if (constants.length > 0) {
-            p.print("Constants:");
-            for (XirConstant c : constants) {
-                p.print(" " + c.detailedToString());
-            }
-            p.println();
-        }
-
-        if (flags != 0) {
-            p.print("Flags:");
-            for (XirTemplate.GlobalFlags flag : XirTemplate.GlobalFlags.values()) {
-                if ((this.flags & flag.mask) != 0) {
-                    p.print(" " + flag.name());
-                }
-            }
-            p.println();
-        }
-
-        p.println("Fast path:");
-        for (XirInstruction i : fastPath) {
-            p.println(indent + i.toString());
-        }
-
-        if (slowPath != null) {
-            p.println("Slow path:");
-            for (XirInstruction i : slowPath) {
-                p.println(indent + i.toString());
-            }
-        }
-    }
-}
--- a/graal/com.oracle.max.cri/src/com/sun/cri/xir/package-info.java	Tue Jan 03 16:24:22 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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.
- */
-/**
- * XIR defines a domain specific instruction set for expressing the lowering of bytecode operations. The details of the
- * lowering operations are entirely encapsulated in the runtime and are provided to the compiler on request using
- * {@link com.sun.cri.xir.XirSnippet XIR snippets}. A snippet is a combination of a {@link com.sun.cri.xir.XirTemplate
- * template}, which is a sequence of {@link com.sun.cri.xir.CiXirAssembler.XirInstruction XIR instructions} that has
- * unbound {@link com.sun.cri.xir.CiXirAssembler.XirParameter parameters}, and site-specific
- * {@link com.sun.cri.xir.XirArgument arguments} that are bound to the parameters.
- * <p>
- * The runtime is responsible for creating the {@link com.sun.cri.xir.XirTemplate templates} and provides these to the
- * compiler as part of the initialization process.
- * <p>
- * The XIR instruction set has no textual representation, and therefore no parser. An assembly is represented by an
- * instance of {@link com.sun.cri.xir.CiXirAssembler}, which provides methods to create instructions and operands.
- */
-package com.sun.cri.xir;
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.criutils;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 /**
  * A implementation of {@link RiField} for an unresolved field.
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.criutils;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 /**
  * A implementation of {@link RiMethod} for an unresolved method.
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,8 +24,8 @@
 
 import java.io.*;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 /**
  * Utility for printing compilation related data structures at various compilation phases.
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java	Tue Jan 03 16:29:28 2012 +0100
@@ -27,11 +27,8 @@
 import java.util.*;
 import java.util.regex.*;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiTargetMethod.CodeAnnotation;
-import com.sun.cri.ci.CiTargetMethod.CodeComment;
-import com.sun.cri.ci.CiTargetMethod.JumpTable;
-import com.sun.cri.ci.CiTargetMethod.LookupTable;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
 
 
 /**
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/AssignRegisters.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/AssignRegisters.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,12 @@
 
 import static com.oracle.max.graal.alloc.util.ValueUtil.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.alloc.util.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
-import com.sun.cri.ci.*;
 
 public abstract class AssignRegisters {
     public final LIR lir;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/DataFlowAnalysis.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/DataFlowAnalysis.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,14 +26,14 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
 import com.oracle.max.graal.compiler.schedule.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class DataFlowAnalysis {
     private final GraalContext context;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/ResolveDataFlow.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/ResolveDataFlow.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,6 +26,7 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.alloc.util.*;
 import com.oracle.max.graal.compiler.*;
@@ -33,7 +34,6 @@
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
 import com.oracle.max.graal.compiler.lir.LIRPhiMapping.PhiValueProcedure;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public abstract class ResolveDataFlow {
     public final LIR lir;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/simple/SpillAllAllocator.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,6 +26,9 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiRegister.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.alloc.util.*;
 import com.oracle.max.graal.alloc.util.MoveResolver;
@@ -36,9 +39,6 @@
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
-import com.sun.cri.ri.*;
 
 public class SpillAllAllocator {
     private final GraalContext context;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LIRVerifier.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,14 +26,14 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.alloc.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public final class LIRVerifier {
     private final LIR lir;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/Location.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/Location.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.alloc.util;
 
-import com.sun.cri.ci.*;
+import com.oracle.max.cri.ci.*;
 
 public class Location extends CiValue {
     private static final long serialVersionUID = -1786677729152726126L;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LocationMap.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/LocationMap.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,8 +26,8 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
-import com.sun.cri.ci.*;
 
 public class LocationMap {
     private final Location[] locations;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/MoveResolver.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/MoveResolver.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,12 +26,12 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public final class MoveResolver {
     private final FrameMap frameMap;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/RegisterVerifier.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/RegisterVerifier.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,13 +26,13 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public final class RegisterVerifier {
     private final FrameMap frameMap;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/ValueUtil.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/alloc/util/ValueUtil.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.alloc.util;
 
-import com.sun.cri.ci.*;
+import com.oracle.max.cri.ci.*;
 
 public class ValueUtil extends CiValueUtil {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompilation.java	Tue Jan 03 16:29:28 2012 +0100
@@ -23,11 +23,15 @@
 
 package com.oracle.max.graal.compiler;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.asm.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiCompiler.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.alloc.simple.*;
 import com.oracle.max.graal.compiler.alloc.*;
@@ -42,10 +46,6 @@
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.virtual.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiCompiler.DebugInfoLevel;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
 
 /**
  * This class encapsulates global information about the compilation of a particular method,
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalCompiler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,15 +24,15 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.target.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
 
 public class GraalCompiler {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/ControlFlowOptimizer.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/ControlFlowOptimizer.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,11 +24,11 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 /**
  * This class performs basic optimizations on the control flow graph after LIR generation.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/Interval.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/Interval.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,15 +22,15 @@
  */
 package com.oracle.max.graal.compiler.alloc;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 /**
  * Represents an interval in the {@linkplain LinearScan linear scan register allocator}.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScan.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,13 @@
  */
 package com.oracle.max.graal.compiler.alloc;
 
-import static com.sun.cri.ci.CiUtil.*;
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.Interval.RegisterBinding;
@@ -39,8 +41,6 @@
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * An implementation of the linear scan register allocator algorithm described
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScanWalker.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/LinearScanWalker.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,13 @@
  */
 package com.oracle.max.graal.compiler.alloc;
 
-import static com.sun.cri.ci.CiUtil.*;
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiRegister.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.Interval.RegisterBinding;
@@ -35,8 +37,6 @@
 import com.oracle.max.graal.compiler.alloc.Interval.State;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
 
 /**
  */
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/MoveResolver.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,15 +22,15 @@
  */
 package com.oracle.max.graal.compiler.alloc;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 /**
  */
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/OperandPool.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/OperandPool.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,14 +22,14 @@
  */
 package com.oracle.max.graal.compiler.alloc;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * An ordered, 0-based indexable pool of instruction operands for a method being compiled.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/alloc/RegisterVerifier.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,15 +22,15 @@
  */
 package com.oracle.max.graal.compiler.alloc;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 /**
  */
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/asm/TargetMethodAssembler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,17 +22,17 @@
  */
 package com.oracle.max.graal.compiler.asm;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.asm.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class TargetMethodAssembler {
     public final GraalCompilation compilation;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,13 @@
  */
 package com.oracle.max.graal.compiler.debug;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.io.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
@@ -39,8 +41,6 @@
 import com.oracle.max.graal.graph.NodeClass.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Utility for printing Graal IR at various compilation phases.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinterObserver.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinterObserver.java	Tue Jan 03 16:29:28 2012 +0100
@@ -25,6 +25,8 @@
 import java.io.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
@@ -34,8 +36,6 @@
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Observes compilation events and uses {@link CFGPrinter} to produce a control flow graph for the <a
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,6 +26,7 @@
 import java.util.*;
 import java.util.Map.Entry;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.debug.BasicIdealGraphPrinter.Edge;
 import com.oracle.max.graal.compiler.graphbuilder.*;
@@ -38,7 +39,6 @@
 import com.oracle.max.graal.graph.NodeClass.Position;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.loop.*;
-import com.sun.cri.ri.*;
 
 /**
  * Generates a representation of {@link Graph Graphs} that can be visualized and inspected with the <a
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinterObserver.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinterObserver.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,12 +26,12 @@
 import java.net.*;
 import java.util.regex.*;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.observer.*;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.graph.*;
-import com.sun.cri.ri.*;
 
 /**
  * Observes compilation events and uses {@link IdealGraphPrinter} to generate a graph representation that can be
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/DebugInfoBuilder.java	Tue Jan 03 16:29:28 2012 +0100
@@ -25,12 +25,12 @@
 import java.util.*;
 import java.util.Map.Entry;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.virtual.*;
-import com.sun.cri.ci.*;
 
 public class DebugInfoBuilder {
     public final GraalCompilation compilation;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,15 +22,20 @@
  */
 package com.oracle.max.graal.compiler.gen;
 
+import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
+import static com.oracle.max.cri.ci.CiValue.*;
 import static com.oracle.max.cri.util.MemoryBarriers.*;
 import static com.oracle.max.graal.alloc.util.ValueUtil.*;
-import static com.sun.cri.ci.CiCallingConvention.Type.*;
-import static com.sun.cri.ci.CiValue.*;
 
 import java.lang.reflect.*;
 import java.util.*;
 
 import com.oracle.max.asm.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.*;
+import com.oracle.max.cri.xir.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.alloc.*;
@@ -49,16 +54,6 @@
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.ri.RiType.Representation;
-import com.sun.cri.xir.CiXirAssembler.XirConstant;
-import com.sun.cri.xir.CiXirAssembler.XirInstruction;
-import com.sun.cri.xir.CiXirAssembler.XirOperand;
-import com.sun.cri.xir.CiXirAssembler.XirParameter;
-import com.sun.cri.xir.CiXirAssembler.XirRegister;
-import com.sun.cri.xir.CiXirAssembler.XirTemp;
-import com.sun.cri.xir.*;
 
 /**
  * This class traverses the HIR instructions and generates LIR instructions from them.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/PhiResolver.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/PhiResolver.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.gen;
 
-import static com.sun.cri.ci.CiValue.*;
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValue.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * Converts {@link PhiNode} instructions into moves.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/BlockMap.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/BlockMap.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,10 +26,10 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Builds a mapping between bytecodes and basic blocks and builds a conservative control flow
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/FrameStateBuilder.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/FrameStateBuilder.java	Tue Jan 03 16:29:28 2012 +0100
@@ -27,12 +27,12 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.PhiNode.PhiType;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 
 public class FrameStateBuilder implements FrameStateAccess {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/GraphBuilderPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/GraphBuilderPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -28,6 +28,9 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.graphbuilder.BlockMap.Block;
@@ -45,9 +48,6 @@
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.java.MethodCallTargetNode.InvokeKind;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.ri.RiType.Representation;
 
 /**
  * The {@code GraphBuilder} class parses the bytecode of a method and builds the IR graph.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/JsrNotSupportedBailout.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graphbuilder/JsrNotSupportedBailout.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.compiler.graphbuilder;
 
-import com.sun.cri.ci.*;
+import com.oracle.max.cri.ci.*;
 
 
 public class JsrNotSupportedBailout extends CiBailout{
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/FrameMap.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/FrameMap.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,11 +26,11 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiCallingConvention.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiCallingConvention.Type;
-import com.sun.cri.ri.*;
 
 /**
  * This class is used to build the stack frame layout for a compiled method.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRBranch.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRBranch.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.compiler.lir;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.calc.*;
-import com.sun.cri.ci.*;
 
 public abstract class LIRBranch extends LIRInstruction {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRCall.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRCall.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,14 +22,14 @@
  */
 package com.oracle.max.graal.compiler.lir;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiTargetMethod.Mark;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.CiXirAssembler.XirMark;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
 
 /**
  * This class represents a call instruction; either to a {@linkplain CiRuntimeCall runtime method},
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRDebugInfo.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRDebugInfo.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,8 +26,8 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
-import com.sun.cri.ci.*;
 
 /**
  * This class represents garbage collection and deoptimization information attached to a LIR instruction.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRInstruction.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRInstruction.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.compiler.lir;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code LIRInstruction} class definition.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRPhiMapping.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRPhiMapping.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,11 +24,11 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.LIRInstruction.ValueProcedure;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.PhiNode.*;
-import com.sun.cri.ci.*;
 
 public class LIRPhiMapping {
     private final LIRBlock block;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRXirInstruction.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/LIRXirInstruction.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.lir;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
 
 public abstract class LIRXirInstruction extends LIRInstruction {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/StandardOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/lir/StandardOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,11 +24,11 @@
 
 import java.util.*;
 
-import com.sun.cri.ci.CiTargetMethod.Mark;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.CiXirAssembler.XirMark;
-import com.sun.cri.xir.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
 
 public class StandardOpcode {
     // Checkstyle: stop
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java	Tue Jan 03 16:29:28 2012 +0100
@@ -43,7 +43,7 @@
  * While there is only one {@code GraalCompiler} instance, there may be several compilations proceeding concurrently, each of
  * which is represented by a unique {@code GraalCompilation} instance. The static method {@link com.oracle.max.graal.compiler.GraalCompilation#currentInterval}} returns the
  * {@code GraalCompilation} instance associated with the current thread, and is managed using a {@link java.lang.ThreadLocal} variable.
- * Each {@code GraalCompilation} instance has an associated {@link com.sun.cri.ci.CiStatistics} object that accumulates information about the compilation process.
+ * Each {@code GraalCompilation} instance has an associated {@link com.oracle.max.cri.ci.CiStatistics} object that accumulates information about the compilation process.
  * </p>
  * <H3>Supported backends</H3>
  *
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/BoxingEliminationPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,13 +24,13 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.PhiNode.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.virtual.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class BoxingEliminationPhase extends Phase {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/CanonicalizerPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/CanonicalizerPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,6 +22,8 @@
  */
 package com.oracle.max.graal.compiler.phases;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.graph.*;
@@ -29,8 +31,6 @@
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class CanonicalizerPhase extends Phase {
     private static final int MAX_ITERATION_PER_NODE = 10;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/EscapeAnalysisPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,6 +24,7 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.graph.*;
@@ -36,7 +37,6 @@
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.virtual.*;
-import com.sun.cri.ci.*;
 
 
 public class EscapeAnalysisPhase extends Phase {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FindInductionVariablesPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FindInductionVariablesPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,13 +24,13 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.compiler.util.LoopUtil.Loop;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.loop.*;
-import com.sun.cri.ci.*;
 
 
 /**
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FloatingReadPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/FloatingReadPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,6 +24,7 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.loop.*;
@@ -32,7 +33,6 @@
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.PhiNode.*;
 import com.oracle.max.graal.nodes.extended.*;
-import com.sun.cri.ci.*;
 
 public class FloatingReadPhase extends Phase {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IdentifyBoxingPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IdentifyBoxingPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,12 @@
 
 import java.lang.reflect.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class IdentifyBoxingPhase extends Phase {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,6 +24,8 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.graphbuilder.*;
@@ -34,8 +36,6 @@
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 
 public class InliningPhase extends Phase implements InliningCallback {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IntrinsificationPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/IntrinsificationPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.compiler.phases;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ri.*;
 
 public class IntrinsificationPhase extends Phase {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/Phase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.compiler.phases;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.schedule.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 public abstract class Phase {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/SnippetIntrinsificationPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/SnippetIntrinsificationPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,6 +24,8 @@
 
 import java.lang.reflect.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.graph.Node.ConstantNodeParameter;
 import com.oracle.max.graal.graph.Node.NodeIntrinsic;
@@ -31,8 +33,6 @@
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class SnippetIntrinsificationPhase extends Phase {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/IdentifyBlocksPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,6 +24,7 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.phases.*;
@@ -33,7 +34,6 @@
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.loop.*;
 import com.oracle.max.graal.nodes.virtual.*;
-import com.sun.cri.ci.*;
 
 
 public class IdentifyBlocksPhase extends Phase {
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/stub/CompilerStub.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/stub/CompilerStub.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.compiler.stub;
 
-import static com.sun.cri.ci.CiKind.*;
+import static com.oracle.max.cri.ci.CiKind.*;
 
-import com.sun.cri.ci.*;
+import com.oracle.max.cri.ci.*;
 
 /**
  * A compiler stub is a shared routine that performs an operation on behalf of compiled code.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/Backend.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/Backend.java	Tue Jan 03 16:29:28 2012 +0100
@@ -25,13 +25,13 @@
 import java.lang.reflect.*;
 
 import com.oracle.max.asm.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.stub.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
 
 /**
  * The {@code Backend} class represents a compiler backend for Graal.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ArithmeticOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ArithmeticOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64ArithmeticOpcode implements LIROpcode {
     IADD, ISUB, IAND, IOR, IXOR,
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Backend.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,16 +24,16 @@
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiCompiler.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.stub.CompilerStub.Id;
 import com.oracle.max.graal.compiler.target.*;
-import com.sun.cri.ci.CiCompiler.DebugInfoLevel;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
 
 /**
  * The {@code X86Backend} class represents the backend for the AMD64 architecture.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CallOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CallOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,19 +22,19 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiTargetMethod.Mark;
-import com.sun.cri.xir.CiXirAssembler.XirMark;
 
 public enum AMD64CallOpcode implements StandardOpcode.CallOpcode {
     DIRECT_CALL, INDIRECT_CALL, NATIVE_CALL;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64CompareOpcode implements LIROpcode {
     ICMP, LCMP, ACMP, FCMP, DCMP;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareToIntOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompareToIntOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,15 +22,15 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 /**
  * Implementation of the Java bytecodes that compare a long, float, or double value and produce the
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompilerStubEmitter.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64CompilerStubEmitter.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,27 +22,22 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiCallingConvention.Type.*;
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiRegister.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.stub.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
-import com.sun.cri.xir.CiXirAssembler.XirConstant;
-import com.sun.cri.xir.CiXirAssembler.XirConstantOperand;
-import com.sun.cri.xir.CiXirAssembler.XirOperand;
-import com.sun.cri.xir.CiXirAssembler.XirParameter;
-import com.sun.cri.xir.CiXirAssembler.XirRegister;
-import com.sun.cri.xir.CiXirAssembler.XirTemp;
 
 /**
  * An object used to produce a single compiler stub.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ControlFlowOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ControlFlowOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,18 +22,18 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiAddress.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.nodes.calc.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiAddress.Scale;
-import com.sun.cri.ci.CiTargetMethod.JumpTable;
 
 public class AMD64ControlFlowOpcode {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFIOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFIOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,16 +22,16 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64ConvertFIOpcode implements LIROpcode {
     F2I, D2I;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFLOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertFLOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,16 +22,16 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.stub.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64ConvertFLOpcode implements LIROpcode {
     F2L, D2L;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ConvertOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64ConvertOpcode implements LIROpcode {
     I2L, L2I, I2B, I2C, I2S,
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,12 +26,12 @@
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.nodes.DeoptimizeNode.DeoptAction;
-import com.sun.cri.ci.*;
 
 public class AMD64DeoptimizationStub implements LIR.SlowPath {
     public final Label label = new Label();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DivOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64DivOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,15 +22,15 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64DivOpcode implements LIROpcode {
     IDIV, IREM, UIDIV, UIREM,
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRGenerator.java	Tue Jan 03 16:29:28 2012 +0100
@@ -23,6 +23,7 @@
 
 package com.oracle.max.graal.compiler.target.amd64;
 
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64ArithmeticOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64CompareOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64CompareToIntOpcode.*;
@@ -35,10 +36,11 @@
 import static com.oracle.max.graal.compiler.target.amd64.AMD64Op1Opcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64ShiftOpcode.*;
 import static com.oracle.max.graal.compiler.target.amd64.AMD64StandardOpcode.*;
-import static com.sun.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.xir.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.gen.*;
 import com.oracle.max.graal.compiler.lir.*;
@@ -48,8 +50,6 @@
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.java.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.xir.*;
 
 /**
  * This class implements the X86-specific portion of the LIR generator.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRInstruction.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LIRInstruction.java	Tue Jan 03 16:29:28 2012 +0100
@@ -23,9 +23,9 @@
 package com.oracle.max.graal.compiler.target.amd64;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
-import com.sun.cri.ci.*;
 
 /**
  * Convenience class to cast AbstractAssembler to AMD64MacroAssembler for the {@link #emitCode} method.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LogicFloatOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64LogicFloatOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64LogicFloatOpcode implements LIROpcode {
     FAND, FOR, FXOR,
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MoveOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MoveOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,15 +22,15 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static java.lang.Double.*;
 import static java.lang.Float.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public class AMD64MoveOpcode {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MulOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64MulOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64MulOpcode implements LIROpcode {
     IMUL, LMUL;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Op1Opcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64Op1Opcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64Op1Opcode implements LIROpcode {
     INEG, LNEG;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ShiftOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64ShiftOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64ShiftOpcode implements LIROpcode {
     ISHL, ISHR, UISHR,
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirAssembler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirAssembler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.xir.XirTemplate.GlobalFlags.*;
+import static com.oracle.max.cri.xir.XirTemplate.GlobalFlags.*;
 
 import java.util.*;
 
 import com.oracle.max.asm.target.amd64.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.xir.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.xir.*;
 
 /**
  * AMD64 version of {@link CiXirAssembler}.
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/target/amd64/AMD64XirOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,28 +22,25 @@
  */
 package com.oracle.max.graal.compiler.target.amd64;
 
-import static com.sun.cri.ci.CiCallingConvention.Type.*;
-import static com.sun.cri.ci.CiValue.*;
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
+import static com.oracle.max.cri.ci.CiValue.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import java.util.*;
 
 import com.oracle.max.asm.*;
 import com.oracle.max.asm.target.amd64.*;
 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiTargetMethod.Mark;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
-import com.sun.cri.xir.CiXirAssembler.RuntimeCallInformation;
-import com.sun.cri.xir.CiXirAssembler.XirInstruction;
-import com.sun.cri.xir.CiXirAssembler.XirLabel;
-import com.sun.cri.xir.CiXirAssembler.XirMark;
 
 public enum AMD64XirOpcode implements StandardOpcode.XirOpcode {
     XIR;
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java	Tue Jan 03 16:29:28 2012 +0100
@@ -25,6 +25,8 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.graphbuilder.*;
@@ -36,8 +38,6 @@
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.java.MethodCallTargetNode.InvokeKind;
 import com.oracle.max.graal.nodes.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class InliningUtil {
 
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,11 +24,11 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code Util} class contains a motley collection of utility methods used throughout the compiler.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/Compiler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/Compiler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.hotspot;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.hotspot.ri.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public interface Compiler {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/CompilerImpl.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/CompilerImpl.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,14 +26,14 @@
 import java.net.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.xir.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.hotspot.logging.*;
 import com.oracle.max.graal.hotspot.ri.*;
 import com.oracle.max.graal.hotspot.server.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.xir.*;
 
 /**
  * Singleton class holding the instance of the GraalCompiler.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotCompiledMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotCompiledMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.hotspot;
 
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ri.*;
 
 /**
  * Implementation of RiCompiledMethod for HotSpot. Stores a reference to the nmethod which contains the compiled code.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotConstantPool.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotConstantPool.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.hotspot;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.ri.*;
-import com.sun.cri.ri.*;
 
 /**
  * Implementation of RiConstantPool for HotSpot.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotExceptionHandler.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotExceptionHandler.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.hotspot;
 
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ri.*;
 
 
 public class HotSpotExceptionHandler extends CompilerObject implements RiExceptionHandler {
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotField.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotField.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,10 +26,10 @@
 import java.lang.annotation.*;
 import java.lang.reflect.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.*;
 import com.oracle.max.graal.compiler.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
-import com.sun.cri.ri.RiType.Representation;
 
 /**
  * Represents a field in a HotSpot type.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRegisterConfig.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRegisterConfig.java	Tue Jan 03 16:29:28 2012 +0100
@@ -27,11 +27,11 @@
 import java.util.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiCallingConvention.*;
+import com.oracle.max.cri.ci.CiRegister.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiCallingConvention.Type;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
-import com.sun.cri.ri.*;
 
 public class HotSpotRegisterConfig implements RiRegisterConfig {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRuntime.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRuntime.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,6 +26,10 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
@@ -36,11 +40,6 @@
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.snippets.nodes.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiTargetMethod.DataPatch;
-import com.sun.cri.ci.CiTargetMethod.Safepoint;
-import com.sun.cri.ri.*;
-import com.sun.cri.ri.RiType.Representation;
 import com.sun.max.asm.dis.*;
 import com.sun.max.lang.*;
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotSignature.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotSignature.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,10 +24,10 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.graphbuilder.*;
 import com.oracle.max.graal.hotspot.ri.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Represents a method signature.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotTargetMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotTargetMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,10 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiTargetMethod.*;
 import com.oracle.max.graal.hotspot.logging.*;
 import com.oracle.max.graal.hotspot.ri.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiTargetMethod.ExceptionHandler;
-import com.sun.cri.ci.CiTargetMethod.Mark;
-import com.sun.cri.ci.CiTargetMethod.Site;
 
 /**
  * CiTargetMethod augmented with HotSpot-specific information.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotVMConfig.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotVMConfig.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.hotspot;
 
-import com.sun.cri.ci.*;
+import com.oracle.max.cri.ci.*;
 
 /**
  * Used to communicate configuration details, runtime offsets, etc. to graal upon compileMethod.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotXirGenerator.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotXirGenerator.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,28 +22,24 @@
  */
 package com.oracle.max.graal.hotspot;
 
+import static com.oracle.max.cri.ci.CiCallingConvention.Type.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 import static com.oracle.max.graal.hotspot.TemplateFlag.*;
-import static com.sun.cri.ci.CiCallingConvention.Type.*;
-import static com.sun.cri.ci.CiValueUtil.*;
 
 import java.lang.reflect.*;
 import java.util.*;
 import java.util.concurrent.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiAddress.*;
+import com.oracle.max.cri.ci.CiRegister.*;
+import com.oracle.max.cri.ri.*;
+import com.oracle.max.cri.ri.RiType.*;
+import com.oracle.max.cri.xir.*;
+import com.oracle.max.cri.xir.CiXirAssembler.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.hotspot.ri.*;
-import com.sun.cri.ci.CiAddress.Scale;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiRegister.RegisterFlag;
-import com.sun.cri.ri.*;
-import com.sun.cri.ri.RiType.Representation;
-import com.sun.cri.xir.*;
-import com.sun.cri.xir.CiXirAssembler.XirConstant;
-import com.sun.cri.xir.CiXirAssembler.XirLabel;
-import com.sun.cri.xir.CiXirAssembler.XirMark;
-import com.sun.cri.xir.CiXirAssembler.XirOperand;
-import com.sun.cri.xir.CiXirAssembler.XirParameter;
 
 public class HotSpotXirGenerator implements RiXirGenerator {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMEntries.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMEntries.java	Tue Jan 03 16:29:28 2012 +0100
@@ -25,9 +25,9 @@
 
 import java.lang.reflect.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.ri.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Entries into the HotSpot VM from Java code.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMEntriesNative.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMEntriesNative.java	Tue Jan 03 16:29:28 2012 +0100
@@ -25,10 +25,10 @@
 
 import java.lang.reflect.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.ri.*;
 import com.oracle.max.graal.hotspot.server.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Entries into the HotSpot VM from Java code.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMExits.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMExits.java	Tue Jan 03 16:29:28 2012 +0100
@@ -23,9 +23,9 @@
 
 package com.oracle.max.graal.hotspot;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.ri.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Exits from the HotSpot VM into Java code.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMExitsNative.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/VMExitsNative.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,15 +26,15 @@
 import java.lang.reflect.*;
 import java.util.concurrent.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiCompiler.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.hotspot.ri.*;
 import com.oracle.max.graal.hotspot.server.*;
 import com.oracle.max.graal.snippets.*;
-import com.sun.cri.ci.CiCompiler.DebugInfoLevel;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Exits from the HotSpot VM into Java code.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/ArrayWriteBarrier.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/ArrayWriteBarrier.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.hotspot.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 public final class ArrayWriteBarrier extends WriteBarrier implements LIRLowerable {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/CurrentThread.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/CurrentThread.java	Tue Jan 03 16:29:28 2012 +0100
@@ -23,10 +23,10 @@
 package com.oracle.max.graal.hotspot.nodes;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 public final class CurrentThread extends FloatingNode implements LIRLowerable {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/FieldWriteBarrier.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/FieldWriteBarrier.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.hotspot.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 public final class FieldWriteBarrier extends WriteBarrier implements LIRLowerable {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/WriteBarrier.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/nodes/WriteBarrier.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.hotspot.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 public abstract class WriteBarrier extends FixedWithNextNode {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethod.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethod.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.hotspot.ri;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.hotspot.Compiler;
-import com.sun.cri.ri.*;
 
 public abstract class HotSpotMethod extends CompilerObject implements RiMethod {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolved.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolved.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.hotspot.ri;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.server.*;
-import com.sun.cri.ri.*;
 
 public interface HotSpotMethodResolved extends RiResolvedMethod, Remote {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Tue Jan 03 16:29:28 2012 +0100
@@ -27,10 +27,10 @@
 import java.util.*;
 import java.util.concurrent.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.criutils.*;
 import com.oracle.max.graal.hotspot.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Implementation of RiMethod for resolved HotSpot methods.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodUnresolved.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodUnresolved.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.hotspot.ri;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.hotspot.Compiler;
-import com.sun.cri.ri.*;
 
 /**
  * Implementation of RiMethod for unresolved HotSpot methods.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotType.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotType.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.hotspot.ri;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.*;
 import com.oracle.max.graal.hotspot.Compiler;
-import com.sun.cri.ri.*;
 
 /**
  * Common interface for all HotSpot RiType-implementations.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypePrimitive.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypePrimitive.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,10 +24,10 @@
 
 import java.lang.annotation.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.hotspot.Compiler;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Implementation of RiType for primitive HotSpot types.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolved.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolved.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.hotspot.ri;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.server.*;
-import com.sun.cri.ri.*;
 
 public interface HotSpotTypeResolved extends RiResolvedType, Remote {
 
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,9 +26,9 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Implementation of RiType for resolved non-primitive HotSpot classes.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeUnresolved.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotTypeUnresolved.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.hotspot.ri;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.hotspot.Compiler;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Implementation of RiType for unresolved HotSpot classes.
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/server/ReplacingStreams.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/server/ReplacingStreams.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,8 +26,8 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.hotspot.*;
-import com.sun.cri.ci.*;
 
 public class ReplacingStreams {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/cri/GraalRuntime.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/cri/GraalRuntime.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,9 +24,9 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ri.*;
 
 /**
  * Graal-specific extensions for the runtime interface that must be implemented by the VM.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/CallTargetNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/CallTargetNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public abstract class CallTargetNode extends ValueNode implements LIRLowerable {
     @Input protected final NodeInputList<ValueNode> arguments;
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ConstantNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ConstantNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code ConstantNode} represents a constant such as an integer value,
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/FrameState.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,12 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.PhiNode.PhiType;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.virtual.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code FrameState} class encapsulates the frame state (i.e. local variables and
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,12 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code InvokeNode} represents all kinds of method calls.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeWithExceptionNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/InvokeWithExceptionNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,13 +24,13 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.util.*;
-import com.sun.cri.ci.*;
 
 public class InvokeWithExceptionNode extends ControlSplitNode implements Node.IterableNodeType, Invoke, MemoryCheckpoint, LIRLowerable {
     private static final int NORMAL_EDGE = 0;
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LocalNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LocalNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code Local} instruction is a placeholder for an incoming argument
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LoopBeginNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/LoopBeginNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,10 +24,10 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.loop.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 
 public class LoopBeginNode extends MergeNode implements Node.IterableNodeType, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/PhiNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/PhiNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code PhiNode} represents the merging of dataflow in the graph. It refers to a merge
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ReturnNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ReturnNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 public final class ReturnNode extends FixedNode implements LIRLowerable, Node.IterableNodeType {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/UnwindNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/UnwindNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * Unwind takes an exception object, destroys the current stack frame and passes the exception object to the system's exception dispatch code.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ValueNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ValueNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * This class represents a value within the graph, including local variables, phis, and
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ValueUtil.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/ValueUtil.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,9 +24,9 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.graph.Node.Verbosity;
-import com.sun.cri.ci.*;
 
 
 public class ValueUtil {
@@ -96,7 +96,7 @@
 
     /**
      * Converts a given instruction to a value string. The representation of an node as
-     * a value is formed by concatenating the {@linkplain com.sun.cri.ci.CiKind#typeChar character} denoting its
+     * a value is formed by concatenating the {@linkplain com.oracle.max.cri.ci.CiKind#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.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/AndNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/AndNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "&")
 public final class AndNode extends LogicNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ArithmeticNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ArithmeticNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code ArithmeticOp} class represents arithmetic operations such as addition, subtraction, etc.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/BinaryNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/BinaryNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code BinaryNode} class is the base of arithmetic and logic operations with two inputs.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/CompareNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/CompareNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /* TODO(tw/gd) For high-level optimization purpose the compare node should be a boolean *value* (it is currently only a helper node)
  * But in the back-end the comparison should not always be materialized (for example in x86 the comparison result will not be in a register but in a flag)
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/Condition.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/Condition.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.cri.util.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Condition codes used in conditionals.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConditionalNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConditionalNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.PhiNode.PhiType;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code ConditionalNode} class represents a comparison that yields one of two values. Note that these nodes are not
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConvertNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ConvertNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
-import static com.sun.cri.ci.CiKind.*;
+import static com.oracle.max.cri.ci.CiKind.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code ConvertNode} class represents a conversion between primitive types.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatAddNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatAddNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "+")
 public final class FloatAddNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatArithmeticNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatArithmeticNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 public abstract class FloatArithmeticNode extends ArithmeticNode {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatDivNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatDivNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "/")
 public final class FloatDivNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatMulNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatMulNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "*")
 public final class FloatMulNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatRemNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatRemNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "%")
 public final class FloatRemNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatSubNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/FloatSubNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "-")
 public final class FloatSubNode extends FloatArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerAddNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerAddNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "+")
 public final class IntegerAddNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerArithmeticNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerArithmeticNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 
 public abstract class IntegerArithmeticNode extends ArithmeticNode {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerDivNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerDivNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "/")
 public final class IntegerDivNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerMulNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerMulNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "*")
 public final class IntegerMulNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerRemNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerRemNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "%")
 public final class IntegerRemNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerSubNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/IntegerSubNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "-")
 public final class IntegerSubNode extends IntegerArithmeticNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/LeftShiftNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/LeftShiftNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "<<")
 public final class LeftShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/LogicNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/LogicNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code LogicNode} class definition.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NormalizeCompareNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NormalizeCompareNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,9 +24,9 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 /**
  * Returns -1, 0, or 1 if either x > y, x == y, or x < y.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NullCheckNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/NullCheckNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 public final class NullCheckNode extends BooleanNode implements Canonicalizable, LIRLowerable {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/OrNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/OrNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "|")
 public final class OrNode extends LogicNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/RightShiftNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/RightShiftNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = ">>")
 public final class RightShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ShiftNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/ShiftNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code ShiftOp} class represents shift operations.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/UnsignedRightShiftNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/UnsignedRightShiftNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = ">>>")
 public final class UnsignedRightShiftNode extends ShiftNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/XorNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/calc/XorNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.calc;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 @NodeInfo(shortName = "^")
 public final class XorNode extends LogicNode implements Canonicalizable, LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/AccessNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/AccessNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 public abstract class AccessNode extends AbstractStateSplit {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/BoxNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/BoxNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.java.MethodCallTargetNode.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 
 public final class BoxNode extends AbstractStateSplit implements Node.IterableNodeType {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/BoxingMethodPool.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/BoxingMethodPool.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,8 +24,8 @@
 
 import java.util.*;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 public class BoxingMethodPool {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/IndexedLocationNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/IndexedLocationNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiAddress.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiAddress.Scale;
 
 public final class IndexedLocationNode extends LocationNode implements LIRLowerable, Canonicalizable {
     @Input private ValueNode index;
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/LocationNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/LocationNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,14 +22,14 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ci.CiAddress.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.graph.Node.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ci.CiAddress.Scale;
 
 public class LocationNode extends FloatingNode implements LIRLowerable, ValueNumberable {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ReadNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ReadNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,11 +24,11 @@
 
 import sun.misc.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 
 public final class ReadNode extends AccessNode implements Node.ValueNumberable, Node.IterableNodeType, LIRLowerable, Canonicalizable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/RuntimeCallNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/RuntimeCallNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 public final class RuntimeCallNode extends AbstractCallNode implements LIRLowerable {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeAccessNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeAccessNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 
 public abstract class SafeAccessNode extends AbstractStateSplit {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeReadNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeReadNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 
 public class SafeReadNode extends SafeAccessNode implements Lowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeWriteNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/SafeWriteNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 
 public class SafeWriteNode extends SafeAccessNode implements Lowerable{
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnboxNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnboxNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 
 public final class UnboxNode extends FixedWithNextNode implements Node.IterableNodeType, Canonicalizable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeCastNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeCastNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code UnsafeCastNode} produces the same value as its input, but with a different type.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeLoadNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeLoadNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * Load of a value from a location specified as an offset relative to an object.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeStoreNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/UnsafeStoreNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * Store of a value at a location specified as an offset relative to an object.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ValueAnchorNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/ValueAnchorNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The ValueAnchor instruction keeps non-CFG (floating) nodes above a certain point in the graph.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/WriteNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/extended/WriteNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.extended;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 
 public final class WriteNode extends AccessNode implements LIRLowerable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/AccessFieldNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/AccessFieldNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -25,12 +25,12 @@
 import java.lang.reflect.*;
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The base class of all instructions that access fields.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/AccessIndexedNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/AccessIndexedNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code AccessIndexedNode} class is the base class of instructions that read or write
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ArrayLengthNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ArrayLengthNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code ArrayLength} instruction gets the length of an array.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CheckCastNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CheckCastNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code CheckCastNode} represents a {@link Bytecodes#CHECKCAST}.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CompareAndSwapNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/CompareAndSwapNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * Represents an atomic compare-and-swap operation. If {@link #directResult} is true then the value read from the memory location is produced.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ExceptionObjectNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/ExceptionObjectNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code ExceptionObject} instruction represents the incoming exception object to an exception handler.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/InstanceOfNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/InstanceOfNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,13 +22,13 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code InstanceOfNode} represents an instanceof test.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/IsTypeNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/IsTypeNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,12 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public final class IsTypeNode extends BooleanNode implements Canonicalizable, LIRLowerable {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/LoadFieldNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/LoadFieldNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code LoadFieldNode} represents a read of a static or instance field.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/LoadIndexedNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/LoadIndexedNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code LoadIndexedNode} represents a read from an element of an array.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/MethodCallTargetNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/MethodCallTargetNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 public class MethodCallTargetNode extends CallTargetNode implements Node.IterableNodeType, Canonicalizable {
     public enum InvokeKind {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewArrayNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewArrayNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,12 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code NewArrayNode} class is the base of all instructions that allocate arrays.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewInstanceNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewInstanceNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,11 +24,11 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code NewInstanceNode} represents the allocation of an instance class object.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewMultiArrayNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewMultiArrayNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code NewMultiArrayNode} represents an allocation of a multi-dimensional object
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewObjectArrayNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewObjectArrayNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code NewObjectArrayNode} represents an allocation of an object array.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewTypeArrayNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/NewTypeArrayNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code NewTypeArrayNode} class definition.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/RegisterFinalizerNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/RegisterFinalizerNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * This node is used to perform the finalizer registration at the end of the java.lang.Object constructor.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/StoreFieldNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/StoreFieldNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code StoreFieldNode} represents a write to a static or instance field.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/StoreIndexedNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/StoreIndexedNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 /**
  * The {@code StoreIndexedNode} represents a write to an array element.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/TypeCheckNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/java/TypeCheckNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.java;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 /**
  * The {@code TypeCheckNode} is the base class of casts and instanceof tests.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/BasicInductionVariableNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/BasicInductionVariableNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.loop;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.PhiNode.PhiType;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 /**
  * LinearInductionVariable that is computed in the loops thanks to Phi(init, this + stride).
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/DerivedInductionVariableNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/DerivedInductionVariableNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.loop;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ci.*;
 
 /**
  * LinearInductionVariable that is computed in the loops with offset + scale * base.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/InductionVariableNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/InductionVariableNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.nodes.loop;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.type.*;
 import com.oracle.max.graal.util.*;
-import com.sun.cri.ci.*;
 
 /**
  * This is a base class for all induction variables nodes.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/LinearInductionVariableNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/LinearInductionVariableNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.loop;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * InductionVariable of the form a*x+b.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/LoopCounterNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/loop/LoopCounterNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.loop;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
 
 /**
  * Counts loop iterations from 0 to Niter.
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/CanonicalizerTool.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/CanonicalizerTool.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.nodes.spi;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 
 public interface CanonicalizerTool {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/EscapeField.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/EscapeField.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,7 +22,7 @@
  */
 package com.oracle.max.graal.nodes.spi;
 
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ri.*;
 
 public class EscapeField {
 
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/EscapeOp.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/EscapeOp.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,12 +24,12 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.java.*;
 import com.oracle.max.graal.nodes.virtual.*;
-import com.sun.cri.ci.*;
 
 
 public abstract class EscapeOp {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/LIRGeneratorTool.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/spi/LIRGeneratorTool.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,12 +22,12 @@
  */
 package com.oracle.max.graal.nodes.spi;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.DeoptimizeNode.DeoptAction;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
-import com.sun.cri.ci.*;
 
 public abstract class LIRGeneratorTool {
     public abstract CiTarget target();
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/Stamp.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/Stamp.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.nodes.type;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 
 public interface Stamp {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/StampFactory.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/type/StampFactory.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,8 +24,8 @@
 
 import java.util.*;
 
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 
 
 public class StampFactory {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/virtual/BoxedVirtualObjectNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/virtual/BoxedVirtualObjectNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.nodes.virtual;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
-import com.sun.cri.ri.*;
 
 
 public class BoxedVirtualObjectNode extends VirtualObjectNode implements LIRLowerable, Node.ValueNumberable {
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/virtual/VirtualObjectNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/virtual/VirtualObjectNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,10 +24,10 @@
 
 import java.util.*;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ri.*;
 
 
 public class VirtualObjectNode extends ValueNode implements LIRLowerable {
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/ArrayCopySnippets.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/ArrayCopySnippets.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.snippets;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.snippets.nodes.*;
-import com.sun.cri.ci.*;
 
 
 public class ArrayCopySnippets implements SnippetsInterface{
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/GraalIntrinsics.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/GraalIntrinsics.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.snippets;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.compiler.phases.PhasePlan.PhasePosition;
 import com.oracle.max.graal.cri.*;
-import com.sun.cri.ci.*;
 
 /**
  * Definition of the snippets that are VM-independent and can be intrinsified by Graal in any VM.
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/IntrinsifyArrayCopyPhase.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/IntrinsifyArrayCopyPhase.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,13 +24,13 @@
 
 import java.lang.reflect.*;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.java.*;
-import com.sun.cri.ri.*;
 
 public class IntrinsifyArrayCopyPhase extends Phase {
     private final GraalRuntime runtime;
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/MathSnippetsX86.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/MathSnippetsX86.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.snippets;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.snippets.nodes.*;
 import com.oracle.max.graal.snippets.nodes.MathIntrinsicNode.Operation;
-import com.sun.cri.ci.*;
 
 /**
  * Snippets for {@link java.lang.Math} methods.
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/NodeClassSnippets.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/NodeClassSnippets.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,9 +22,9 @@
  */
 package com.oracle.max.graal.snippets;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.graph.*;
 import com.oracle.max.graal.nodes.extended.*;
-import com.sun.cri.ci.*;
 
 /**
  * Snippets for {@link NodeClass} methods.
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/Snippets.java	Tue Jan 03 16:29:28 2012 +0100
@@ -24,6 +24,8 @@
 
 import java.lang.reflect.*;
 
+import com.oracle.max.cri.ci.*;
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.debug.*;
 import com.oracle.max.graal.compiler.graphbuilder.*;
@@ -35,8 +37,6 @@
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
-import com.sun.cri.ci.*;
-import com.sun.cri.ri.*;
 
 /**
  * Utilities for snippet installation and management.
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/SystemSnippets.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/SystemSnippets.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,8 +22,8 @@
  */
 package com.oracle.max.graal.snippets;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.nodes.extended.*;
-import com.sun.cri.ci.*;
 
 /**
  * Snippets for {@link java.lang.System} methods.
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/UnsafeSnippets.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/UnsafeSnippets.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,10 +22,10 @@
  */
 package com.oracle.max.graal.snippets;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.cri.util.*;
 import com.oracle.max.graal.nodes.extended.*;
 import com.oracle.max.graal.nodes.java.*;
-import com.sun.cri.ci.*;
 
 /**
  * Snippets for {@link sun.misc.Unsafe} methods.
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/nodes/ArrayHeaderSizeNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/nodes/ArrayHeaderSizeNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,11 +22,11 @@
  */
 package com.oracle.max.graal.snippets.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.nodes.calc.*;
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
-import com.sun.cri.ci.*;
 
 public class ArrayHeaderSizeNode extends FloatingNode implements Lowerable {
     @Data private final CiKind elementKind;
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/nodes/MathIntrinsicNode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/nodes/MathIntrinsicNode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,6 +22,7 @@
  */
 package com.oracle.max.graal.snippets.nodes;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.target.amd64.*;
 import com.oracle.max.graal.compiler.util.*;
 import com.oracle.max.graal.graph.*;
@@ -30,7 +31,6 @@
 import com.oracle.max.graal.nodes.spi.*;
 import com.oracle.max.graal.nodes.type.*;
 import com.oracle.max.graal.snippets.target.amd64.*;
-import com.sun.cri.ci.*;
 
 public class MathIntrinsicNode extends FloatingNode implements Canonicalizable, AMD64LIRLowerable {
 
--- a/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/target/amd64/AMD64MathIntrinsicOpcode.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.snippets/src/com/oracle/max/graal/snippets/target/amd64/AMD64MathIntrinsicOpcode.java	Tue Jan 03 16:29:28 2012 +0100
@@ -22,14 +22,14 @@
  */
 package com.oracle.max.graal.snippets.target.amd64;
 
-import static com.sun.cri.ci.CiValueUtil.*;
+import static com.oracle.max.cri.ci.CiValueUtil.*;
 
 import com.oracle.max.asm.target.amd64.*;
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.asm.*;
 import com.oracle.max.graal.compiler.lir.*;
 import com.oracle.max.graal.compiler.target.amd64.*;
 import com.oracle.max.graal.compiler.util.*;
-import com.sun.cri.ci.*;
 
 public enum AMD64MathIntrinsicOpcode implements LIROpcode {
     SQRT,
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/EscapeAnalysisTest.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/EscapeAnalysisTest.java	Tue Jan 03 16:29:28 2012 +0100
@@ -26,10 +26,10 @@
 
 import org.junit.Test;
 
+import com.oracle.max.cri.ci.*;
 import com.oracle.max.graal.compiler.phases.*;
 import com.oracle.max.graal.nodes.*;
 import com.oracle.max.graal.nodes.java.*;
-import com.sun.cri.ci.*;
 
 /**
  * In these test cases the probability of all invokes is set to a high value, such that an InliningPhase should inline them all.
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/GraphTest.java	Tue Jan 03 16:24:22 2012 +0100
+++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/GraphTest.java	Tue Jan 03 16:29:28 2012 +0100
@@ -28,12 +28,12 @@
 
 import junit.framework.Assert;
 
+import com.oracle.max.cri.ri.*;
 import com.oracle.max.graal.compiler.*;
 import com.oracle.max.graal.compiler.debug.*;
 import com.oracle.max.graal.compiler.graphbuilder.*;
 import com.oracle.max.graal.cri.*;
 import com.oracle.max.graal.nodes.*;
-import com.sun.cri.ri.*;
 
 /**
  * Base class for Graal compiler unit tests. These are white box tests
--- a/src/share/vm/classfile/vmSymbols.hpp	Tue Jan 03 16:24:22 2012 +0100
+++ b/src/share/vm/classfile/vmSymbols.hpp	Tue Jan 03 16:29:28 2012 +0100
@@ -282,37 +282,37 @@
   template(com_sun_hotspot_graal_HotSpotProxy,        "com/oracle/max/graal/hotspot/HotSpotProxy")                      \
   template(com_sun_hotspot_graal_Compiler,            "com/oracle/max/graal/hotspot/Compiler")                          \
   template(com_sun_hotspot_graal_CompilerImpl,        "com/oracle/max/graal/hotspot/CompilerImpl")                      \
-  template(com_sun_cri_ri_RiMethod,                   "com/sun/cri/ri/RiMethod")                                        \
-  template(com_sun_cri_ri_RiResolvedField,            "com/sun/cri/ri/RiResolvedField")                                 \
-  template(com_sun_cri_ri_RiType,                     "com/sun/cri/ri/RiType")                                          \
-  template(com_sun_cri_ri_RiTypeProfile,              "com/sun/cri/ri/RiTypeProfile")                                   \
-  template(com_sun_cri_ri_RiConstantPool,             "com/sun/cri/ri/RiConstantPool")                                  \
-  template(com_sun_cri_ri_RiExceptionHandler,         "com/sun/cri/ri/RiExceptionHandler")                              \
-  template(com_sun_cri_ci_CiAssumptions,              "com/sun/cri/ci/CiAssumptions")                                   \
-  template(com_sun_cri_ci_CiAssumptions_ConcreteSubtype, "com/sun/cri/ci/CiAssumptions$ConcreteSubtype")                \
-  template(com_sun_cri_ci_CiAssumptions_ConcreteMethod, "com/sun/cri/ci/CiAssumptions$ConcreteMethod")                  \
-  template(com_sun_cri_ci_CiGenericCallback,          "com/sun/cri/ci/CiGenericCallback")                               \
-  template(com_sun_cri_ci_CiTargetMethod,             "com/sun/cri/ci/CiTargetMethod")                                  \
-  template(com_sun_cri_ci_CiTargetMethod_Site,        "com/sun/cri/ci/CiTargetMethod$Site")                             \
-  template(com_sun_cri_ci_CiTargetMethod_Call,        "com/sun/cri/ci/CiTargetMethod$Call")                             \
-  template(com_sun_cri_ci_CiTargetMethod_DataPatch,   "com/sun/cri/ci/CiTargetMethod$DataPatch")                        \
-  template(com_sun_cri_ci_CiTargetMethod_Safepoint,   "com/sun/cri/ci/CiTargetMethod$Safepoint")                        \
-  template(com_sun_cri_ci_CiTargetMethod_ExceptionHandler, "com/sun/cri/ci/CiTargetMethod$ExceptionHandler")            \
-  template(com_sun_cri_ci_CiTargetMethod_Mark,        "com/sun/cri/ci/CiTargetMethod$Mark")                             \
+  template(com_sun_cri_ri_RiMethod,                   "com/oracle/max/cri/ri/RiMethod")                                        \
+  template(com_sun_cri_ri_RiResolvedField,            "com/oracle/max/cri/ri/RiResolvedField")                                 \
+  template(com_sun_cri_ri_RiType,                     "com/oracle/max/cri/ri/RiType")                                          \
+  template(com_sun_cri_ri_RiTypeProfile,              "com/oracle/max/cri/ri/RiTypeProfile")                                   \
+  template(com_sun_cri_ri_RiConstantPool,             "com/oracle/max/cri/ri/RiConstantPool")                                  \
+  template(com_sun_cri_ri_RiExceptionHandler,         "com/oracle/max/cri/ri/RiExceptionHandler")                              \
+  template(com_sun_cri_ci_CiAssumptions,              "com/oracle/max/cri/ci/CiAssumptions")                                   \
+  template(com_sun_cri_ci_CiAssumptions_ConcreteSubtype, "com/oracle/max/cri/ci/CiAssumptions$ConcreteSubtype")                \
+  template(com_sun_cri_ci_CiAssumptions_ConcreteMethod, "com/oracle/max/cri/ci/CiAssumptions$ConcreteMethod")                  \
+  template(com_sun_cri_ci_CiGenericCallback,          "com/oracle/max/cri/ci/CiGenericCallback")                               \
+  template(com_sun_cri_ci_CiTargetMethod,             "com/oracle/max/cri/ci/CiTargetMethod")                                  \
+  template(com_sun_cri_ci_CiTargetMethod_Site,        "com/oracle/max/cri/ci/CiTargetMethod$Site")                             \
+  template(com_sun_cri_ci_CiTargetMethod_Call,        "com/oracle/max/cri/ci/CiTargetMethod$Call")                             \
+  template(com_sun_cri_ci_CiTargetMethod_DataPatch,   "com/oracle/max/cri/ci/CiTargetMethod$DataPatch")                        \
+  template(com_sun_cri_ci_CiTargetMethod_Safepoint,   "com/oracle/max/cri/ci/CiTargetMethod$Safepoint")                        \
+  template(com_sun_cri_ci_CiTargetMethod_ExceptionHandler, "com/oracle/max/cri/ci/CiTargetMethod$ExceptionHandler")            \
+  template(com_sun_cri_ci_CiTargetMethod_Mark,        "com/oracle/max/cri/ci/CiTargetMethod$Mark")                             \
   template(com_oracle_max_graal_graph_BitMap,         "com/oracle/max/graal/graph/BitMap")                              \
-  template(com_sun_cri_ci_CiBitMap,	                  "com/sun/cri/ci/CiBitMap")                                        \
-  template(com_sun_cri_ci_CiDebugInfo,                "com/sun/cri/ci/CiDebugInfo")                                     \
-  template(com_sun_cri_ci_CiFrame,                    "com/sun/cri/ci/CiFrame")                                         \
-  template(com_sun_cri_ci_CiValue,                    "com/sun/cri/ci/CiValue")                                         \
-  template(com_sun_cri_ci_CiStackSlot,                "com/sun/cri/ci/CiStackSlot")                                     \
-  template(com_sun_cri_ci_CiRegisterValue,            "com/sun/cri/ci/CiRegisterValue")                                 \
-  template(com_sun_cri_ci_CiRegister,                 "com/sun/cri/ci/CiRegister")                                      \
-  template(com_sun_cri_ci_CiCodePos,                  "com/sun/cri/ci/CiCodePos")                                       \
-  template(com_sun_cri_ci_CiConstant,                 "com/sun/cri/ci/CiConstant")                                      \
-  template(com_sun_cri_ci_CiVirtualObject,            "com/sun/cri/ci/CiVirtualObject")                                 \
-  template(com_sun_cri_ci_CiMonitorValue,             "com/sun/cri/ci/CiMonitorValue")                                  \
-  template(com_sun_cri_ci_CiKind,                     "com/sun/cri/ci/CiKind")                                          \
-  template(com_sun_cri_ci_CiRuntimeCall,              "com/sun/cri/ci/CiRuntimeCall")                                   \
+  template(com_sun_cri_ci_CiBitMap,	                  "com/oracle/max/cri/ci/CiBitMap")                                        \
+  template(com_sun_cri_ci_CiDebugInfo,                "com/oracle/max/cri/ci/CiDebugInfo")                                     \
+  template(com_sun_cri_ci_CiFrame,                    "com/oracle/max/cri/ci/CiFrame")                                         \
+  template(com_sun_cri_ci_CiValue,                    "com/oracle/max/cri/ci/CiValue")                                         \
+  template(com_sun_cri_ci_CiStackSlot,                "com/oracle/max/cri/ci/CiStackSlot")                                     \
+  template(com_sun_cri_ci_CiRegisterValue,            "com/oracle/max/cri/ci/CiRegisterValue")                                 \
+  template(com_sun_cri_ci_CiRegister,                 "com/oracle/max/cri/ci/CiRegister")                                      \
+  template(com_sun_cri_ci_CiCodePos,                  "com/oracle/max/cri/ci/CiCodePos")                                       \
+  template(com_sun_cri_ci_CiConstant,                 "com/oracle/max/cri/ci/CiConstant")                                      \
+  template(com_sun_cri_ci_CiVirtualObject,            "com/oracle/max/cri/ci/CiVirtualObject")                                 \
+  template(com_sun_cri_ci_CiMonitorValue,             "com/oracle/max/cri/ci/CiMonitorValue")                                  \
+  template(com_sun_cri_ci_CiKind,                     "com/oracle/max/cri/ci/CiKind")                                          \
+  template(com_sun_cri_ci_CiRuntimeCall,              "com/oracle/max/cri/ci/CiRuntimeCall")                                   \
   template(startCompiler_name,                        "startCompiler")                                                  \
   template(bootstrap_name,                            "bootstrap")                                                      \
   template(shutdownCompiler_name,                     "shutdownCompiler")                                               \
@@ -322,27 +322,27 @@
   template(setDefaultOptions_name,                    "setDefaultOptions")                                              \
   template(setOption_signature,                       "(Ljava/lang/String;)Z")                                          \
   template(createRiMethodResolved_name,               "createRiMethodResolved")                                         \
-  template(createRiMethodResolved_signature,          "(JLjava/lang/String;)Lcom/sun/cri/ri/RiMethod;")                 \
+  template(createRiMethodResolved_signature,          "(JLjava/lang/String;)Lcom/oracle/max/cri/ri/RiMethod;")                 \
   template(createRiMethodUnresolved_name,             "createRiMethodUnresolved")                                       \
-  template(createRiMethodUnresolved_signature,        "(Ljava/lang/String;Ljava/lang/String;Lcom/sun/cri/ri/RiType;)Lcom/sun/cri/ri/RiMethod;") \
+  template(createRiMethodUnresolved_signature,        "(Ljava/lang/String;Ljava/lang/String;Lcom/oracle/max/cri/ri/RiType;)Lcom/oracle/max/cri/ri/RiMethod;") \
   template(createRiSignature_name,                    "createRiSignature")                                              \
-  template(createRiSignature_signature,               "(Ljava/lang/String;)Lcom/sun/cri/ri/RiSignature;")               \
+  template(createRiSignature_signature,               "(Ljava/lang/String;)Lcom/oracle/max/cri/ri/RiSignature;")               \
   template(createRiField_name,                        "createRiField")                                                  \
-  template(createRiField_signature,                   "(Lcom/sun/cri/ri/RiType;Ljava/lang/String;Lcom/sun/cri/ri/RiType;II)Lcom/sun/cri/ri/RiField;") \
+  template(createRiField_signature,                   "(Lcom/oracle/max/cri/ri/RiType;Ljava/lang/String;Lcom/oracle/max/cri/ri/RiType;II)Lcom/oracle/max/cri/ri/RiField;") \
   template(createRiType_name,                         "createRiType")                                                   \
-  template(createRiType_signature,                    "(JLjava/lang/String;)Lcom/sun/cri/ri/RiType;")                   \
+  template(createRiType_signature,                    "(JLjava/lang/String;)Lcom/oracle/max/cri/ri/RiType;")                   \
   template(createRiTypePrimitive_name,                "createRiTypePrimitive")                                          \
-  template(createRiTypePrimitive_signature,           "(I)Lcom/sun/cri/ri/RiType;")                                     \
+  template(createRiTypePrimitive_signature,           "(I)Lcom/oracle/max/cri/ri/RiType;")                                     \
   template(createRiTypeUnresolved_name,               "createRiTypeUnresolved")                                         \
-  template(createRiTypeUnresolved_signature,          "(Ljava/lang/String;)Lcom/sun/cri/ri/RiType;")                    \
+  template(createRiTypeUnresolved_signature,          "(Ljava/lang/String;)Lcom/oracle/max/cri/ri/RiType;")                    \
   template(createCiConstant_name,                     "createCiConstant")                                               \
-  template(createCiConstant_signature,                "(Lcom/sun/cri/ci/CiKind;J)Lcom/sun/cri/ci/CiConstant;")          \
+  template(createCiConstant_signature,                "(Lcom/oracle/max/cri/ci/CiKind;J)Lcom/oracle/max/cri/ci/CiConstant;")          \
   template(createCiConstantFloat_name,                "createCiConstantFloat")                                          \
-  template(createCiConstantFloat_signature,           "(F)Lcom/sun/cri/ci/CiConstant;")                                 \
+  template(createCiConstantFloat_signature,           "(F)Lcom/oracle/max/cri/ci/CiConstant;")                                 \
   template(createCiConstantDouble_name,               "createCiConstantDouble")                                         \
-  template(createCiConstantDouble_signature,          "(D)Lcom/sun/cri/ci/CiConstant;")                                 \
+  template(createCiConstantDouble_signature,          "(D)Lcom/oracle/max/cri/ci/CiConstant;")                                 \
   template(createCiConstantObject_name,               "createCiConstantObject")                                         \
-  template(createCiConstantObject_signature,          "(Ljava/lang/Object;)Lcom/sun/cri/ci/CiConstant;")                \
+  template(createCiConstantObject_signature,          "(Ljava/lang/Object;)Lcom/oracle/max/cri/ci/CiConstant;")                \
   template(getVMExits_name,                           "getVMExits")                                                     \
   template(getVMExits_signature,                      "()Lcom/oracle/max/graal/hotspot/VMExits;")                       \
   template(getInstance_name,                          "getInstance")                                                    \
--- a/src/share/vm/graal/graalJavaAccess.hpp	Tue Jan 03 16:24:22 2012 +0100
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Tue Jan 03 16:29:28 2012 +0100
@@ -61,7 +61,7 @@
   start_class(HotSpotMethodResolved)                                                    \
     oop_field(HotSpotMethodResolved, compiler, "Lcom/oracle/max/graal/hotspot/Compiler;") \
     oop_field(HotSpotMethodResolved, name, "Ljava/lang/String;")                        \
-    oop_field(HotSpotMethodResolved, holder, "Lcom/sun/cri/ri/RiResolvedType;")         \
+    oop_field(HotSpotMethodResolved, holder, "Lcom/oracle/max/cri/ri/RiResolvedType;")         \
     oop_field(HotSpotMethodResolved, javaMirror, "Ljava/lang/Object;")                  \
     int_field(HotSpotMethodResolved, codeSize)                                          \
     int_field(HotSpotMethodResolved, accessFlags)                                       \
@@ -72,79 +72,79 @@
     oop_field(HotSpotType, name, "Ljava/lang/String;")                                  \
   end_class                                                                             \
   start_class(HotSpotField)                                                             \
-    oop_field(HotSpotField, constant, "Lcom/sun/cri/ci/CiConstant;")                    \
+    oop_field(HotSpotField, constant, "Lcom/oracle/max/cri/ci/CiConstant;")                    \
     int_field(HotSpotField, offset)                                                     \
     int_field(HotSpotField, accessFlags)                                                \
   end_class                                                                             \
   start_class(HotSpotCompiledMethod)                                                    \
     long_field(HotSpotCompiledMethod, nmethod)                                          \
-    oop_field(HotSpotCompiledMethod, method, "Lcom/sun/cri/ri/RiResolvedMethod;")       \
+    oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/max/cri/ri/RiResolvedMethod;")       \
   end_class                                                                             \
   start_class(HotSpotProxy)                                                             \
     static_oop_field(HotSpotProxy, DUMMY_CONSTANT_OBJ, "Ljava/lang/Long;")              \
   end_class                                                                             \
   start_class(HotSpotTargetMethod)                                                      \
-    oop_field(HotSpotTargetMethod, targetMethod, "Lcom/sun/cri/ci/CiTargetMethod;")     \
+    oop_field(HotSpotTargetMethod, targetMethod, "Lcom/oracle/max/cri/ci/CiTargetMethod;")     \
     oop_field(HotSpotTargetMethod, method, "Lcom/oracle/max/graal/hotspot/ri/HotSpotMethodResolved;") \
     oop_field(HotSpotTargetMethod, name, "Ljava/lang/String;")                          \
-    oop_field(HotSpotTargetMethod, sites, "[Lcom/sun/cri/ci/CiTargetMethod$Site;")      \
-    oop_field(HotSpotTargetMethod, exceptionHandlers, "[Lcom/sun/cri/ci/CiTargetMethod$ExceptionHandler;") \
+    oop_field(HotSpotTargetMethod, sites, "[Lcom/oracle/max/cri/ci/CiTargetMethod$Site;")      \
+    oop_field(HotSpotTargetMethod, exceptionHandlers, "[Lcom/oracle/max/cri/ci/CiTargetMethod$ExceptionHandler;") \
   end_class                                                                             \
   start_class(HotSpotExceptionHandler)                                                  \
     int_field(HotSpotExceptionHandler, startBci)                                        \
     int_field(HotSpotExceptionHandler, endBci)                                          \
     int_field(HotSpotExceptionHandler, handlerBci)                                      \
     int_field(HotSpotExceptionHandler, catchClassIndex)                                 \
-    oop_field(HotSpotExceptionHandler, catchClass, "Lcom/sun/cri/ri/RiType;")           \
+    oop_field(HotSpotExceptionHandler, catchClass, "Lcom/oracle/max/cri/ri/RiType;")           \
   end_class                                                                             \
   start_class(CiTargetMethod)                                                           \
     int_field(CiTargetMethod, frameSize)                                                \
     int_field(CiTargetMethod, customStackAreaOffset)                                    \
     oop_field(CiTargetMethod, targetCode, "[B")                                         \
-    oop_field(CiTargetMethod, assumptions, "Lcom/sun/cri/ci/CiAssumptions;")            \
+    oop_field(CiTargetMethod, assumptions, "Lcom/oracle/max/cri/ci/CiAssumptions;")            \
     int_field(CiTargetMethod, targetCodeSize)                                           \
   end_class                                                                             \
   start_class(CiAssumptions)                                                            \
-    oop_field(CiAssumptions, list, "[Lcom/sun/cri/ci/CiAssumptions$Assumption;")        \
+    oop_field(CiAssumptions, list, "[Lcom/oracle/max/cri/ci/CiAssumptions$Assumption;")        \
   end_class                                                                             \
   start_class(CiAssumptions_ConcreteSubtype)                                            \
-    oop_field(CiAssumptions_ConcreteSubtype, context, "Lcom/sun/cri/ri/RiResolvedType;")\
-    oop_field(CiAssumptions_ConcreteSubtype, subtype, "Lcom/sun/cri/ri/RiResolvedType;")\
+    oop_field(CiAssumptions_ConcreteSubtype, context, "Lcom/oracle/max/cri/ri/RiResolvedType;")\
+    oop_field(CiAssumptions_ConcreteSubtype, subtype, "Lcom/oracle/max/cri/ri/RiResolvedType;")\
   end_class                                                                             \
   start_class(CiAssumptions_ConcreteMethod)                                             \
-  oop_field(CiAssumptions_ConcreteMethod, method, "Lcom/sun/cri/ri/RiResolvedMethod;")       \
-    oop_field(CiAssumptions_ConcreteMethod, context, "Lcom/sun/cri/ri/RiResolvedType;")       \
-    oop_field(CiAssumptions_ConcreteMethod, impl, "Lcom/sun/cri/ri/RiResolvedMethod;")        \
+  oop_field(CiAssumptions_ConcreteMethod, method, "Lcom/oracle/max/cri/ri/RiResolvedMethod;")       \
+    oop_field(CiAssumptions_ConcreteMethod, context, "Lcom/oracle/max/cri/ri/RiResolvedType;")       \
+    oop_field(CiAssumptions_ConcreteMethod, impl, "Lcom/oracle/max/cri/ri/RiResolvedMethod;")        \
   end_class                                                                             \
   start_class(CiTargetMethod_Site)                                                      \
     int_field(CiTargetMethod_Site, pcOffset)                                            \
   end_class                                                                             \
   start_class(CiTargetMethod_Call)                                                      \
     oop_field(CiTargetMethod_Call, target, "Ljava/lang/Object;")                        \
-    oop_field(CiTargetMethod_Call, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;")           \
+    oop_field(CiTargetMethod_Call, debugInfo, "Lcom/oracle/max/cri/ci/CiDebugInfo;")           \
   end_class                                                                             \
   start_class(CiTargetMethod_DataPatch)                                                 \
-    oop_field(CiTargetMethod_DataPatch, constant, "Lcom/sun/cri/ci/CiConstant;")        \
+    oop_field(CiTargetMethod_DataPatch, constant, "Lcom/oracle/max/cri/ci/CiConstant;")        \
     int_field(CiTargetMethod_DataPatch, alignment)                                      \
   end_class                                                                             \
   start_class(CiTargetMethod_Safepoint)                                                 \
-    oop_field(CiTargetMethod_Safepoint, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;")      \
+    oop_field(CiTargetMethod_Safepoint, debugInfo, "Lcom/oracle/max/cri/ci/CiDebugInfo;")      \
   end_class                                                                             \
   start_class(CiTargetMethod_ExceptionHandler)                                          \
     int_field(CiTargetMethod_ExceptionHandler, handlerPos)                              \
     int_field(CiTargetMethod_ExceptionHandler, handlerBci)                              \
     int_field(CiTargetMethod_ExceptionHandler, bci)                                     \
     int_field(CiTargetMethod_ExceptionHandler, scopeLevel)                              \
-    oop_field(CiTargetMethod_ExceptionHandler, exceptionType, "Lcom/sun/cri/ri/RiType;")\
+    oop_field(CiTargetMethod_ExceptionHandler, exceptionType, "Lcom/oracle/max/cri/ri/RiType;")\
   end_class                                                                             \
   start_class(CiTargetMethod_Mark)                                                      \
     oop_field(CiTargetMethod_Mark, id, "Ljava/lang/Object;")                            \
-    oop_field(CiTargetMethod_Mark, references, "[Lcom/sun/cri/ci/CiTargetMethod$Mark;") \
+    oop_field(CiTargetMethod_Mark, references, "[Lcom/oracle/max/cri/ci/CiTargetMethod$Mark;") \
   end_class                                                                             \
   start_class(CiDebugInfo)                                                              \
-    oop_field(CiDebugInfo, codePos, "Lcom/sun/cri/ci/CiCodePos;")                       \
-    oop_field(CiDebugInfo, registerRefMap, "Lcom/sun/cri/ci/CiBitMap;")                 \
-    oop_field(CiDebugInfo, frameRefMap, "Lcom/sun/cri/ci/CiBitMap;")                    \
+    oop_field(CiDebugInfo, codePos, "Lcom/oracle/max/cri/ci/CiCodePos;")                       \
+    oop_field(CiDebugInfo, registerRefMap, "Lcom/oracle/max/cri/ci/CiBitMap;")                 \
+    oop_field(CiDebugInfo, frameRefMap, "Lcom/oracle/max/cri/ci/CiBitMap;")                    \
   end_class                                                                             \
   start_class(GraalBitMap)                                                              \
     int_field(GraalBitMap, size)                                                        \
@@ -152,62 +152,62 @@
     oop_field(GraalBitMap, extra, "[J")                                                 \
   end_class                                                                             \
   start_class(CiFrame)                                                                  \
-    oop_field(CiFrame, values, "[Lcom/sun/cri/ci/CiValue;")                             \
+    oop_field(CiFrame, values, "[Lcom/oracle/max/cri/ci/CiValue;")                             \
     int_field(CiFrame, numLocals)                                                       \
     int_field(CiFrame, numStack)                                                        \
     int_field(CiFrame, numLocks)                                                        \
     boolean_field(CiFrame, rethrowException)                                            \
   end_class                                                                             \
   start_class(CiCodePos)                                                                \
-    oop_field(CiCodePos, caller, "Lcom/sun/cri/ci/CiCodePos;")                          \
-    oop_field(CiCodePos, method, "Lcom/sun/cri/ri/RiResolvedMethod;")                   \
+    oop_field(CiCodePos, caller, "Lcom/oracle/max/cri/ci/CiCodePos;")                          \
+    oop_field(CiCodePos, method, "Lcom/oracle/max/cri/ri/RiResolvedMethod;")                   \
     int_field(CiCodePos, bci)                                                           \
   end_class                                                                             \
   start_class(CiConstant)                                                               \
-    oop_field(CiConstant, kind, "Lcom/sun/cri/ci/CiKind;")                              \
+    oop_field(CiConstant, kind, "Lcom/oracle/max/cri/ci/CiKind;")                              \
     oop_field(CiConstant, object, "Ljava/lang/Object;")                                 \
     long_field(CiConstant, primitive)                                                   \
   end_class                                                                             \
   start_class(CiKind)                                                                   \
     char_field(CiKind, typeChar)                                                        \
-    static_oop_field(CiKind, Boolean, "Lcom/sun/cri/ci/CiKind;");                       \
-    static_oop_field(CiKind, Byte, "Lcom/sun/cri/ci/CiKind;");                          \
-    static_oop_field(CiKind, Char, "Lcom/sun/cri/ci/CiKind;");                          \
-    static_oop_field(CiKind, Short, "Lcom/sun/cri/ci/CiKind;");                         \
-    static_oop_field(CiKind, Int, "Lcom/sun/cri/ci/CiKind;");                           \
-    static_oop_field(CiKind, Long, "Lcom/sun/cri/ci/CiKind;");                          \
+    static_oop_field(CiKind, Boolean, "Lcom/oracle/max/cri/ci/CiKind;");                       \
+    static_oop_field(CiKind, Byte, "Lcom/oracle/max/cri/ci/CiKind;");                          \
+    static_oop_field(CiKind, Char, "Lcom/oracle/max/cri/ci/CiKind;");                          \
+    static_oop_field(CiKind, Short, "Lcom/oracle/max/cri/ci/CiKind;");                         \
+    static_oop_field(CiKind, Int, "Lcom/oracle/max/cri/ci/CiKind;");                           \
+    static_oop_field(CiKind, Long, "Lcom/oracle/max/cri/ci/CiKind;");                          \
   end_class                                                                             \
   start_class(CiRuntimeCall)                                                            \
-    static_oop_field(CiRuntimeCall, UnwindException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, RegisterFinalizer, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, HandleException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, SetDeoptInfo, "Lcom/sun/cri/ci/CiRuntimeCall;");    \
-    static_oop_field(CiRuntimeCall, CreateNullPointerException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, CreateOutOfBoundsException, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, OSRMigrationEnd, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, JavaTimeMillis, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, JavaTimeNanos, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, Debug, "Lcom/sun/cri/ci/CiRuntimeCall;");           \
-    static_oop_field(CiRuntimeCall, ArithmethicLrem, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, ArithmeticLdiv, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticFrem, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticDrem, "Lcom/sun/cri/ci/CiRuntimeCall;");  \
-    static_oop_field(CiRuntimeCall, ArithmeticCos, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticTan, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticLog, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, ArithmeticLog10, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
-    static_oop_field(CiRuntimeCall, ArithmeticSin, "Lcom/sun/cri/ci/CiRuntimeCall;");   \
-    static_oop_field(CiRuntimeCall, Deoptimize, "Lcom/sun/cri/ci/CiRuntimeCall;");      \
-    static_oop_field(CiRuntimeCall, GenericCallback, "Lcom/sun/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, UnwindException, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, RegisterFinalizer, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, HandleException, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, SetDeoptInfo, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");    \
+    static_oop_field(CiRuntimeCall, CreateNullPointerException, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, CreateOutOfBoundsException, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, OSRMigrationEnd, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, JavaTimeMillis, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, JavaTimeNanos, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, Debug, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");           \
+    static_oop_field(CiRuntimeCall, ArithmethicLrem, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, ArithmeticLdiv, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticFrem, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticDrem, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");  \
+    static_oop_field(CiRuntimeCall, ArithmeticCos, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticTan, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticLog, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, ArithmeticLog10, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
+    static_oop_field(CiRuntimeCall, ArithmeticSin, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");   \
+    static_oop_field(CiRuntimeCall, Deoptimize, "Lcom/oracle/max/cri/ci/CiRuntimeCall;");      \
+    static_oop_field(CiRuntimeCall, GenericCallback, "Lcom/oracle/max/cri/ci/CiRuntimeCall;"); \
   end_class                                                                             \
   start_class(RiMethod)                                                                 \
   end_class                                                                             \
   start_class(CiValue)                                                                  \
-    oop_field(CiValue, kind, "Lcom/sun/cri/ci/CiKind;")                                 \
-    static_oop_field(CiValue, IllegalValue, "Lcom/sun/cri/ci/CiValue;");                \
+    oop_field(CiValue, kind, "Lcom/oracle/max/cri/ci/CiKind;")                                 \
+    static_oop_field(CiValue, IllegalValue, "Lcom/oracle/max/cri/ci/CiValue;");                \
   end_class                                                                             \
   start_class(CiRegisterValue)                                                          \
-    oop_field(CiRegisterValue, reg, "Lcom/sun/cri/ci/CiRegister;")                      \
+    oop_field(CiRegisterValue, reg, "Lcom/oracle/max/cri/ci/CiRegister;")                      \
   end_class                                                                             \
   start_class(CiRegister)                                                               \
     int_field(CiRegister, number)                                                       \
@@ -218,19 +218,19 @@
   end_class                                                                             \
   start_class(CiVirtualObject)                                                          \
     int_field(CiVirtualObject, id)                                                      \
-    oop_field(CiVirtualObject, type, "Lcom/sun/cri/ri/RiType;")                         \
-    oop_field(CiVirtualObject, values, "[Lcom/sun/cri/ci/CiValue;")                     \
+    oop_field(CiVirtualObject, type, "Lcom/oracle/max/cri/ri/RiType;")                         \
+    oop_field(CiVirtualObject, values, "[Lcom/oracle/max/cri/ci/CiValue;")                     \
   end_class                                                                             \
   start_class(CiMonitorValue)                                                           \
-    oop_field(CiMonitorValue, owner, "Lcom/sun/cri/ci/CiValue;")                        \
-    oop_field(CiMonitorValue, lockData, "Lcom/sun/cri/ci/CiValue;")                     \
+    oop_field(CiMonitorValue, owner, "Lcom/oracle/max/cri/ci/CiValue;")                        \
+    oop_field(CiMonitorValue, lockData, "Lcom/oracle/max/cri/ci/CiValue;")                     \
     boolean_field(CiMonitorValue, eliminated)                                           \
   end_class                                                                             \
   start_class(RiTypeProfile)                                                            \
     int_field(RiTypeProfile, count)                                                     \
     int_field(RiTypeProfile, morphism)                                                  \
     oop_field(RiTypeProfile, probabilities, "[F")                                       \
-    oop_field(RiTypeProfile, types, "[Lcom/sun/cri/ri/RiResolvedType;")                 \
+    oop_field(RiTypeProfile, types, "[Lcom/oracle/max/cri/ri/RiResolvedType;")                 \
   end_class                                                                             \
   /* end*/
 
--- a/src/share/vm/graal/graalVMEntries.cpp	Tue Jan 03 16:24:22 2012 +0100
+++ b/src/share/vm/graal/graalVMEntries.cpp	Tue Jan 03 16:29:28 2012 +0100
@@ -980,24 +980,24 @@
 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
 
 #define PROXY           "J"
-#define TYPE            "Lcom/sun/cri/ri/RiType;"
+#define TYPE            "Lcom/oracle/max/cri/ri/RiType;"
 #define RESOLVED_TYPE   "Lcom/oracle/max/graal/hotspot/ri/HotSpotTypeResolved;"
-#define METHOD          "Lcom/sun/cri/ri/RiMethod;"
+#define METHOD          "Lcom/oracle/max/cri/ri/RiMethod;"
 #define RESOLVED_METHOD "Lcom/oracle/max/graal/hotspot/ri/HotSpotMethodResolved;"
 #define REFLECT_METHOD  "Ljava/lang/reflect/Method;"
-#define TYPE_PROFILE    "Lcom/sun/cri/ri/RiTypeProfile;"
-#define SIGNATURE       "Lcom/sun/cri/ri/RiSignature;"
-#define FIELD           "Lcom/sun/cri/ri/RiField;"
-#define RESOLVED_FIELD  "Lcom/sun/cri/ri/RiResolvedField;"
-#define CONSTANT_POOL   "Lcom/sun/cri/ri/RiConstantPool;"
-#define EXCEPTION_HANDLERS "[Lcom/sun/cri/ri/RiExceptionHandler;"
+#define TYPE_PROFILE    "Lcom/oracle/max/cri/ri/RiTypeProfile;"
+#define SIGNATURE       "Lcom/oracle/max/cri/ri/RiSignature;"
+#define FIELD           "Lcom/oracle/max/cri/ri/RiField;"
+#define RESOLVED_FIELD  "Lcom/oracle/max/cri/ri/RiResolvedField;"
+#define CONSTANT_POOL   "Lcom/oracle/max/cri/ri/RiConstantPool;"
+#define EXCEPTION_HANDLERS "[Lcom/oracle/max/cri/ri/RiExceptionHandler;"
 #define TARGET_METHOD   "Lcom/oracle/max/graal/hotspot/HotSpotTargetMethod;"
 #define CONFIG          "Lcom/oracle/max/graal/hotspot/HotSpotVMConfig;"
 #define HS_METHOD       "Lcom/oracle/max/graal/hotspot/ri/HotSpotMethod;"
 #define HS_COMP_METHOD  "Lcom/oracle/max/graal/hotspot/HotSpotCompiledMethod;"
-#define CI_CONSTANT     "Lcom/sun/cri/ci/CiConstant;"
-#define CI_KIND         "Lcom/sun/cri/ci/CiKind;"
-#define CI_RUNTIME_CALL "Lcom/sun/cri/ci/CiRuntimeCall;"
+#define CI_CONSTANT     "Lcom/oracle/max/cri/ci/CiConstant;"
+#define CI_KIND         "Lcom/oracle/max/cri/ci/CiKind;"
+#define CI_RUNTIME_CALL "Lcom/oracle/max/cri/ci/CiRuntimeCall;"
 #define STRING          "Ljava/lang/String;"
 #define OBJECT          "Ljava/lang/Object;"
 #define CLASS           "Ljava/lang/Class;"